Hi!

When trying to use a Postgres database server on a remote host with
Funambol I came across this issue:

I have one database server "db.example.com" that hosts SOGo's and
Funambol's databases. As it is a remote host, I set transparent usage of
SSL in postgres' pg_hba.conf like this:
| # TYPE  DATABASE        USER    WHO                     METHOD
| hostssl all             all     0.0.0.0/0               md5

JDBC connector requires to explicitly set SSL options. (Connectors for
other languages do this transparently). So you end up specifying:
|| 
jdbc.url=jdbc:postgresql://db.example.com/funambol?ssl=true&sslfactory=org.postgresql.ssl.NonValidatingFactory
in install.properties

|| ssl=true -> enable SSL to connect to the database
|| org.postgresql.ssl.NonValidatingFactory -> do not try to find the CA
||                           signing the server cert in the trust store.

When following the howto you will be presented with an error in the
database config file:
/opt/Funambol/config/com/funambol/server/db/db.xml
the funambol installer is unable to properly convert the bootstrap config
file into XML: just replace the ampersand "&" with "&" and it will work
out fine...
|| 
jdbc.url=jdbc:postgresql://db.example.com/funambol?ssl=true&sslfactory=org.postgresql.ssl.NonValidatingFactory

The real issue is to find what is going on in Java's really helpful debug
messages and stack traces.

This seems to be a bug in the Funambol installer.

-- Adi

PS: Stack trace in /opt/Funambol/logs/http/catalina.log (for goolge indexing):
04.11.2010 15:12:02 org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
04.11.2010 15:12:02 org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1197 ms
04.11.2010 15:12:02 org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
04.11.2010 15:12:02 org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.16
04.11.2010 15:12:02 org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive funambol.war
04.11.2010 15:12:03 org.apache.catalina.core.StandardContext
addApplicationListener
INFO: The listener "com.funambol.transport.http.server.ServletListener" is
already c
onfigured for this context. The duplicate definition has been ignored.
04.11.2010 15:12:03 org.apache.catalina.core.StandardContext
addApplicationListener
INFO: The listener "com.funambol.transport.http.server.SessionListener" is
already c
onfigured for this context. The duplicate definition has been ignored.
04.11.2010 15:12:03 org.apache.catalina.core.StandardContext
addApplicationListener
INFO: The listener "org.apache.axis.transport.http.AxisHTTPSessionListener"
is alrea
dy configured for this context. The duplicate definition has been ignored.
04.11.2010 15:12:03 org.apache.naming.NamingContext lookup
WARNUNG: Unexpected exception resolving reference
com.funambol.server.db.DataSourceConfigurationException: Error reading
'com/funambol
/server/db/db.xml'
        at
com.funambol.server.db.DataSourceConfigurationHelper.getDBConfiguration(D
ataSourceConfigurationHelper.java:165)
        at
com.funambol.server.db.DataSourceConfigurationHelper.getJDBCDataSourceCon
figuration(DataSourceConfigurationHelper.java:132)
        at
com.funambol.server.db.DataSourceFactory.getObjectInstance(DataSourceFact
ory.java:163)
        at
org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFacto
ry.java:140)
        at
javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
        at org.apache.naming.NamingContext.lookup(NamingContext.java:793)
        at org.apache.naming.NamingContext.lookup(NamingContext.java:140)
        at org.apache.naming.NamingContext.lookup(NamingContext.java:781)
        at org.apache.naming.NamingContext.lookup(NamingContext.java:153)
        at
org.apache.catalina.core.NamingContextListener.addResource(NamingContextListener.java:1024)
        at
org.apache.catalina.core.NamingContextListener.createNamingContext(NamingContextListener.java:633)
        at
org.apache.catalina.core.NamingContextListener.lifecycleEvent(NamingContextListener.java:237)
        at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSup
port.java:117)
        at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4252)
        at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.jav
a:791)
        at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
        at
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
        at
org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:829)
        at
org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:718)
        at
org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:490)
        at
org.apache.catalina.startup.HostConfig.start(HostConfig.java:1147)
        at
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311
)
        at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSup
port.java:117)
        at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
        at
org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
        at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
        at
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
        at
org.apache.catalina.core.StandardService.start(StandardService.java:516)
        at
org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java
:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorI
mpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by: com.funambol.framework.tools.beans.BeanException: Error in
creating an in
stance of com/funambol/server/db/db.xml
        at
com.funambol.framework.tools.beans.BeanCache.getBeanInstance(BeanCache.ja
va:324)
        at
com.funambol.framework.tools.beans.BeanTool.getBeanInstance(BeanTool.java
:160)
        at
com.funambol.server.db.DataSourceConfigurationHelper.getDBConfiguration(D
ataSourceConfigurationHelper.java:163)
        ... 35 more
Caused by: java.lang.ArrayIndexOutOfBoundsException: 0
        at
com.sun.beans.ObjectHandler.dequeueResult(ObjectHandler.java:139)
        at java.beans.XMLDecoder.readObject(XMLDecoder.java:201)
        at
com.funambol.framework.tools.beans.BeanFactory.unmarshal(BeanFactory.java
:380)
        at
com.funambol.framework.tools.beans.BeanFactory.unmarshal(BeanFactory.java
:415)
        at
com.funambol.framework.tools.beans.BeanFactory.getBeanInstanceFromConfig(
BeanFactory.java:201)
        at
com.funambol.framework.tools.beans.BeanCache.getBeanInstance(BeanCache.java:318)
        ... 37 more
04.11.2010 15:12:03 org.apache.catalina.core.NamingContextListener
addResource
WARNUNG: Failed to register in JMX: javax.naming.NamingException: Error
reading 'com/funambol/server/db/db.xml'
04.11.2010 15:12:03 org.apache.naming.NamingContext lookup
WARNUNG: Unexpected exception resolving reference
com.funambol.server.db.DataSourceConfigurationException: Error reading
'com/funambol/server/db/db.xml'
        at
com.funambol.server.db.DataSourceConfigurationHelper.getDBConfiguration(DataSourceConfigurationHelper.java:165)
        at
com.funambol.server.db.DataSourceConfigurationHelper.getJDBCDataSourceConfiguration(DataSourceConfigurationHelper.java:132)
        at
com.funambol.server.db.DataSourceFactory.getObjectInstance(DataSourceFactory.java:163)
        at
org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFactory.java:140)
        at
javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
        at org.apache.naming.NamingContext.lookup(NamingContext.java:793)
        at org.apache.naming.NamingContext.lookup(NamingContext.java:140)
        at org.apache.naming.NamingContext.lookup(NamingContext.java:781)
        at org.apache.naming.NamingContext.lookup(NamingContext.java:153)
        at
org.apache.catalina.core.NamingContextListener.addResource(NamingContextListener.java:1024)
        at
org.apache.catalina.core.NamingContextListener.createNamingContext(NamingContextListener.java:633)
        at
org.apache.catalina.core.NamingContextListener.lifecycleEvent(NamingContextListener.java:237)
        at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
        at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4252)
        at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
        at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
        at
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
        at
org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:829)
        at
org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:718)
        at
org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:490)
        at
org.apache.catalina.startup.HostConfig.start(HostConfig.java:1147)
        at
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
       at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
        at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
        at
org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
        at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
        at
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
        at
org.apache.catalina.core.StandardService.start(StandardService.java:516)
        at
org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by: com.funambol.framework.tools.beans.BeanException: Error in
creating an instance of com/funambol/server/db/db.xml
        at
com.funambol.framework.tools.beans.BeanCache.getBeanInstance(BeanCache.java:324)
        at
com.funambol.framework.tools.beans.BeanTool.getBeanInstance(BeanTool.java:160)
        at
com.funambol.server.db.DataSourceConfigurationHelper.getDBConfiguration(DataSourceConfigurationHelper.java:163)
        ... 35 more
Caused by: java.lang.ArrayIndexOutOfBoundsException: 0
        at
com.sun.beans.ObjectHandler.dequeueResult(ObjectHandler.java:139)
        at java.beans.XMLDecoder.readObject(XMLDecoder.java:201)
        at
com.funambol.framework.tools.beans.BeanFactory.unmarshal(BeanFactory.java:380)
        at
com.funambol.framework.tools.beans.BeanFactory.unmarshal(BeanFactory.java:415)
        at
com.funambol.framework.tools.beans.BeanFactory.getBeanInstanceFromConfig(BeanFactory.java:201)
        at
com.funambol.framework.tools.beans.BeanCache.getBeanInstance(BeanCache.java:318)
        ... 37 more
04.11.2010 15:12:03 org.apache.catalina.core.NamingContextListener
addResource
WARNUNG: Failed to register in JMX: javax.naming.NamingException: Error
reading 'com/funambol/server/db/db.xml'
04.11.2010 15:12:03 org.apache.naming.NamingContext lookup
WARNUNG: Unexpected exception resolving reference
com.funambol.server.db.DataSourceConfigurationException: Error reading
'com/funambol/server/db/db.xml'
        at
com.funambol.server.db.DataSourceConfigurationHelper.getDBConfiguration(DataSourceConfigurationHelper.java:165)
        at
com.funambol.server.db.DataSourceConfigurationHelper.getJDBCDataSourceConfiguration(DataSourceConfigurationHelper.java:132)
        at
com.funambol.server.db.DataSourceFactory.getObjectInstance(DataSourceFactory.java:163)
        at
org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFactory.java:140)
        at
javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
        at org.apache.naming.NamingContext.lookup(NamingContext.java:793)
        at org.apache.naming.NamingContext.lookup(NamingContext.java:140)
        at org.apache.naming.NamingContext.lookup(NamingContext.java:781)
        at org.apache.naming.NamingContext.lookup(NamingContext.java:153)
        at
org.apache.catalina.core.NamingContextListener.addResource(NamingContextListener.java:1024)
        at
org.apache.catalina.core.NamingContextListener.createNamingContext(NamingContextListener.java:633)
        at
org.apache.catalina.core.NamingContextListener.lifecycleEvent(NamingContextListener.java:237)
        at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
        at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4252)
        at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
        at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
        at
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
        at
org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:829)
        at
org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:718)
        at
org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:490)
        at
org.apache.catalina.startup.HostConfig.start(HostConfig.java:1147)
        at
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
        at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
        at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
        at
org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
        at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
        at
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
        at
org.apache.catalina.core.StandardService.start(StandardService.java:516)
        at
org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by: com.funambol.framework.tools.beans.BeanException: Error in
creating an instance of com/funambol/server/db/db.xml
        at
com.funambol.framework.tools.beans.BeanCache.getBeanInstance(BeanCache.java:324)
        at
com.funambol.framework.tools.beans.BeanTool.getBeanInstance(BeanTool.java:160)
        at
com.funambol.server.db.DataSourceConfigurationHelper.getDBConfiguration(DataSourceConfigurationHelper.java:163)
        ... 35 more
Caused by: java.lang.ArrayIndexOutOfBoundsException: 0
        at
com.sun.beans.ObjectHandler.dequeueResult(ObjectHandler.java:139)
        at java.beans.XMLDecoder.readObject(XMLDecoder.java:201)
        at
com.funambol.framework.tools.beans.BeanFactory.unmarshal(BeanFactory.java:380)
        at
com.funambol.framework.tools.beans.BeanFactory.unmarshal(BeanFactory.java:415)
        at
com.funambol.framework.tools.beans.BeanFactory.getBeanInstanceFromConfig(BeanFactory.java:201)
        at
com.funambol.framework.tools.beans.BeanCache.getBeanInstance(BeanCache.java:318)
        ... 37 more
04.11.2010 15:12:03 org.apache.catalina.core.NamingContextListener
addResource
WARNUNG: Failed to register in JMX: javax.naming.NamingException: Error
reading 'com/funambol/server/db/db.xml'
04.11.2010 15:12:03 org.apache.naming.NamingContext lookup
WARNUNG: Unexpected exception resolving reference
com.funambol.server.db.DataSourceConfigurationException: Error reading
'com/funambol/server/db/db.xml'
        at
com.funambol.server.db.DataSourceConfigurationHelper.getDBConfiguration(DataSourceConfigurationHelper.java:165)
        at
com.funambol.server.db.DataSourceConfigurationHelper.getJDBCDataSourceConfiguration(DataSourceConfigurationHelper.java:132)
        at
com.funambol.server.db.DataSourceFactory.getObjectInstance(DataSourceFactory.java:163)
        at
org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFactory.java:140)
        at
javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
        at org.apache.naming.NamingContext.lookup(NamingContext.java:793)
        at org.apache.naming.NamingContext.lookup(NamingContext.java:140)
        at org.apache.naming.NamingContext.lookup(NamingContext.java:781)
        at org.apache.naming.NamingContext.lookup(NamingContext.java:140)
        at org.apache.naming.NamingContext.lookup(NamingContext.java:781)
        at org.apache.naming.NamingContext.lookup(NamingContext.java:140)
        at org.apache.naming.NamingContext.lookup(NamingContext.java:781)
        at org.apache.naming.NamingContext.lookup(NamingContext.java:153)
        at
org.apache.naming.SelectorContext.lookup(SelectorContext.java:137)
        at javax.naming.InitialContext.lookup(InitialContext.java:392)
        at
com.funambol.framework.tools.DataSourceTools.lookupDataSource(DataSourceTools.java:134)
        at
com.funambol.framework.tools.DataSourceTools.lookupDataSource(DataSourceTools.java:165)
        at
com.funambol.framework.server.store.BasePersistentStore.init(BasePersistentStore.java:170)
        at
com.funambol.framework.tools.beans.BeanFactory.getBeanInstanceFromConfig(BeanFactory.java:204)
        at
com.funambol.framework.tools.beans.BeanCache.getNewBeanInstance(BeanCache.java:162)
        at
com.funambol.framework.tools.beans.BeanTool.getNewBeanInstance(BeanTool.java:120)
        at
com.funambol.server.config.Configuration.getBeanInstanceByName(Configuration.java:832)
        at
com.funambol.server.config.Configuration.getBeanInstanceByName(Configuration.java:790)
        at
com.funambol.server.config.Configuration.configurePersistentStoreManager(Configuration.java:1189)
        at
com.funambol.server.config.Configuration.getConfiguration(Configuration.java:264)
        at
com.funambol.transport.http.server.Sync4jServlet.bootstrap(Sync4jServlet.java:619)
        at
com.funambol.transport.http.server.Sync4jServlet.init(Sync4jServlet.java:232)
        at javax.servlet.GenericServlet.init(GenericServlet.java:212)
        at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1161)
        at
org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:981)
        at
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4058)
        at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4364)
        at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
        at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
        at
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
        at
org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:829)
        at
org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:718)
        at
org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:490)
        at
org.apache.catalina.startup.HostConfig.start(HostConfig.java:1147)
        at
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
        at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
        at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
        at
org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
        at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
        at
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
        at
org.apache.catalina.core.StandardService.start(StandardService.java:516)
        at
org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by: com.funambol.framework.tools.beans.BeanException: Error in
creating an instance of com/funambol/server/db/db.xml
        at
com.funambol.framework.tools.beans.BeanCache.getBeanInstance(BeanCache.java:324)
        at
com.funambol.framework.tools.beans.BeanTool.getBeanInstance(BeanTool.java:160)
        at
com.funambol.server.db.DataSourceConfigurationHelper.getDBConfiguration(DataSourceConfigurationHelper.java:163)
        ... 53 more
Caused by: java.lang.ArrayIndexOutOfBoundsException: 0
        at
com.sun.beans.ObjectHandler.dequeueResult(ObjectHandler.java:139)
        at java.beans.XMLDecoder.readObject(XMLDecoder.java:201)
        at
com.funambol.framework.tools.beans.BeanFactory.unmarshal(BeanFactory.java:380)
        at
com.funambol.framework.tools.beans.BeanFactory.unmarshal(BeanFactory.java:415)
        at
com.funambol.framework.tools.beans.BeanFactory.getBeanInstanceFromConfig(BeanFactory.java:201)
        at
com.funambol.framework.tools.beans.BeanCache.getBeanInstance(BeanCache.java:318)
        ... 55 more
04.11.2010 15:12:03 org.apache.naming.NamingContext lookup
(...and so on...)
-- 
users@sogo.nu
https://inverse.ca/sogo/lists

Reply via email to