You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@roller.apache.org by Daniel Ruan <da...@gmail.com> on 2012/01/12 04:53:29 UTC

Error Upgrade Roller 4.0 to 5.0 with Oracle DB

Hi Folks,

I had Roller 4.0.1 with Tomcat 6 and Oracle 10g XE as the backend.  I
followed the upgrade steps in the install guide, and when I first started
Tomcat, I got the following error in .log file:

... ...
INFO  2012-01-11 22:06:25,820 WebloggerImpl:initialize - Initializing
Roller Weblogger business tier
FATAL 2012-01-11 22:06:26,120 JPAPropertiesManagerImpl:initialize - Failed
to initialize runtime configuration properties.Please check that the
database has been upgraded!
<openjpa-2.0.1-r422266:989424 fatal user error>
org.apache.openjpa.persistence.ArgumentException: A JDBC Driver or
DataSource class name must be specified in the ConnectionDriverName
property.
at
org.apache.openjpa.jdbc.schema.DataSourceFactory.newDataSource(DataSourceFactory.java:76)
at
org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl.createConnectionFactory(JDBCConfigurationImpl.java:839)
at
org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl.getDBDictionaryInstance(JDBCConfigurationImpl.java:597)
at
org.apache.openjpa.jdbc.meta.MappingRepository.endConfiguration(MappingRepository.java:1489)
at
org.apache.openjpa.lib.conf.Configurations.configureInstance(Configurations.java:507)
at
org.apache.openjpa.lib.conf.Configurations.configureInstance(Configurations.java:432)
at org.apache.openjpa.lib.conf.PluginValue.instantiate(PluginValue.java:104)
at
org.apache.openjpa.conf.MetaDataRepositoryValue.instantiate(MetaDataRepositoryValue.java:68)
at org.apache.openjpa.lib.conf.ObjectValue.instantiate(ObjectValue.java:83)
at
org.apache.openjpa.conf.OpenJPAConfigurationImpl.newMetaDataRepositoryInstance(OpenJPAConfigurationImpl.java:939)
at
org.apache.openjpa.conf.OpenJPAConfigurationImpl.getMetaDataRepositoryInstance(OpenJPAConfigurationImpl.java:930)
at
org.apache.openjpa.kernel.AbstractBrokerFactory.makeReadOnly(AbstractBrokerFactory.java:639)
at
org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:206)
at
org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:156)
at
org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:227)
at
org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:154)
at
org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:60)
at
org.apache.roller.weblogger.business.jpa.JPAPersistenceStrategy.getThreadLocalEntityManager(JPAPersistenceStrategy.java:238)
at
org.apache.roller.weblogger.business.jpa.JPAPersistenceStrategy.getEntityManager(JPAPersistenceStrategy.java:225)
at
org.apache.roller.weblogger.business.jpa.JPAPersistenceStrategy.getNamedQuery(JPAPersistenceStrategy.java:258)
at
org.apache.roller.weblogger.business.jpa.JPAPropertiesManagerImpl.getProperties(JPAPropertiesManagerImpl.java:117)
at
org.apache.roller.weblogger.business.jpa.JPAPropertiesManagerImpl.initialize(JPAPropertiesManagerImpl.java:77)
at
org.apache.roller.weblogger.business.WebloggerImpl.initialize(WebloggerImpl.java:338)
at
org.apache.roller.weblogger.ui.core.RollerContext.contextInitialized(RollerContext.java:161)
at
org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3934)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4429)
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:526)
at
org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:630)
at
org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:556)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:491)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1206)
at
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:314)
at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:722)
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:583)
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)
INFO  2012-01-11 22:26:27,281 DatabaseProvider:successMessage - SUCCESS:
Got parameters. Using configuration type JNDI_NAME
INFO  2012-01-11 22:26:27,287 DatabaseProvider:successMessage - -- Using
JNDI datasource name: java:comp/env/jdbc/rollerdb
INFO  2012-01-11 22:26:27,290 DatabaseProvider:successMessage - SUCCESS:
located JNDI DataSource [java:comp/env/jdbc/rollerdb]
... ...

After reading OpenJPA's online documentation, I went to add the following
in roller-customer.properties:

openjpa.ConnectionDriverName=oracle.jdbc.OracleDriver
openjpa.ConnectionURL=jdbc:oracle:thin:@localhost:1521:XE
openjpa.ConnectionUserName=rollerusername
openjpa.ConnectionPassword=****

On my next try, the error went away.

I am just curious because adding those openjpa properties is not documented
 anywhere in Roller.  Did I miss anything?

Thanks,
Daniel

Re: Error Upgrade Roller 4.0 to 5.0 with Oracle DB

Posted by Marcus <m....@upcmail.nl>.
On 12-1-2012 23:09, Daniel Ruan wrote:
> Hi Marcus,
>
> Thanks for sharing. How did you configure connection pooling if you use a
> straight jdbc connection?
>
> Regards,
> Daniel
>
> I have also the same when I set up a Datasource for jndi  but the other way
>>>> around. it asks for me define the jpa even though the Setup is for a
>>>> Datasource(jndi).  Since this wasn't very clear then I stopped using the
>>>> datasource and reverted just to a straight jdbc connection. that didn't ask
>>>> for any of the others.  Not sure if there is a roller property where you
>>>> have to define which type of db access you are using,
>>>
>> cheers
>> Marcus
>>
>>>
>>> -----
>>> Geen virus gevonden in dit bericht.
>>> Gecontroleerd door AVG - www.avg.com
>>> Versie: 2012.0.1901 / Virusdatabase: 2109/4738 - datum van uitgifte:
>>> 01/12/12
>>>
>>
>
>
> -----
> Geen virus gevonden in dit bericht.
> Gecontroleerd door AVG - www.avg.com
> Versie: 2012.0.1901 / Virusdatabase: 2109/4738 - datum van uitgifte: 01/12/12
Hi Daniel,
I don;t have connection pooling becuase the setup is always asking for 
these JPA properties. The only way it works for me is if the 
connectionType property is set to jdbc
Have you got the connectionType property set to jndi ?
Have you verified you actually have connection pooling ? I think 
probably it is just using your jpa setting and not using the tomcat 
pooling with your jndi context,

cheers
Marcus


Re: Error Upgrade Roller 4.0 to 5.0 with Oracle DB

Posted by Daniel Ruan <da...@gmail.com>.
Hi Marcus,

Thanks for sharing. How did you configure connection pooling if you use a
straight jdbc connection?

Regards,
Daniel

I have also the same when I set up a Datasource for jndi  but the other way
>>> around. it asks for me define the jpa even though the Setup is for a
>>> Datasource(jndi).  Since this wasn't very clear then I stopped using the
>>> datasource and reverted just to a straight jdbc connection. that didn't ask
>>> for any of the others.  Not sure if there is a roller property where you
>>> have to define which type of db access you are using,
>>
>>
> cheers
> Marcus
>
>>
>>
>> -----
>> Geen virus gevonden in dit bericht.
>> Gecontroleerd door AVG - www.avg.com
>> Versie: 2012.0.1901 / Virusdatabase: 2109/4738 - datum van uitgifte:
>> 01/12/12
>>
>
>

Re: Error Upgrade Roller 4.0 to 5.0 with Oracle DB

Posted by Marcus <m....@upcmail.nl>.
On 12-1-2012 21:14, Daniel Ruan wrote:
> A follow-up question.  After I got it to work with the openjpa, I commented
> out database.jndi.name then Roller refused to start.
>
> I am just curious why Roller still requires a JDNI data source now that the
> JPA connection is set.  Is it because the connection check is hard coded in
> the startup code?
>
> Regards,
> Daniel
>
> On Wed, Jan 11, 2012 at 10:53 PM, Daniel Ruan<da...@gmail.com>  wrote:
>
>> Hi Folks,
>>
>> I had Roller 4.0.1 with Tomcat 6 and Oracle 10g XE as the backend.  I
>> followed the upgrade steps in the install guide, and when I first started
>> Tomcat, I got the following error in .log file:
>>
>> ... ...
>> INFO  2012-01-11 22:06:25,820 WebloggerImpl:initialize - Initializing
>> Roller Weblogger business tier
>> FATAL 2012-01-11 22:06:26,120 JPAPropertiesManagerImpl:initialize -
>> Failed to initialize runtime configuration properties.Please check that the
>> database has been upgraded!
>> <openjpa-2.0.1-r422266:989424 fatal user error>
>> org.apache.openjpa.persistence.ArgumentException: A JDBC Driver or
>> DataSource class name must be specified in the ConnectionDriverName
>> property.
>> at
>> org.apache.openjpa.jdbc.schema.DataSourceFactory.newDataSource(DataSourceFactory.java:76)
>>   at
>> org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl.createConnectionFactory(JDBCConfigurationImpl.java:839)
>> at
>> org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl.getDBDictionaryInstance(JDBCConfigurationImpl.java:597)
>>   at
>> org.apache.openjpa.jdbc.meta.MappingRepository.endConfiguration(MappingRepository.java:1489)
>> at
>> org.apache.openjpa.lib.conf.Configurations.configureInstance(Configurations.java:507)
>>   at
>> org.apache.openjpa.lib.conf.Configurations.configureInstance(Configurations.java:432)
>> at
>> org.apache.openjpa.lib.conf.PluginValue.instantiate(PluginValue.java:104)
>>   at
>> org.apache.openjpa.conf.MetaDataRepositoryValue.instantiate(MetaDataRepositoryValue.java:68)
>> at org.apache.openjpa.lib.conf.ObjectValue.instantiate(ObjectValue.java:83)
>>   at
>> org.apache.openjpa.conf.OpenJPAConfigurationImpl.newMetaDataRepositoryInstance(OpenJPAConfigurationImpl.java:939)
>> at
>> org.apache.openjpa.conf.OpenJPAConfigurationImpl.getMetaDataRepositoryInstance(OpenJPAConfigurationImpl.java:930)
>>   at
>> org.apache.openjpa.kernel.AbstractBrokerFactory.makeReadOnly(AbstractBrokerFactory.java:639)
>> at
>> org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:206)
>>   at
>> org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:156)
>> at
>> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:227)
>>   at
>> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:154)
>> at
>> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:60)
>>   at
>> org.apache.roller.weblogger.business.jpa.JPAPersistenceStrategy.getThreadLocalEntityManager(JPAPersistenceStrategy.java:238)
>> at
>> org.apache.roller.weblogger.business.jpa.JPAPersistenceStrategy.getEntityManager(JPAPersistenceStrategy.java:225)
>>   at
>> org.apache.roller.weblogger.business.jpa.JPAPersistenceStrategy.getNamedQuery(JPAPersistenceStrategy.java:258)
>> at
>> org.apache.roller.weblogger.business.jpa.JPAPropertiesManagerImpl.getProperties(JPAPropertiesManagerImpl.java:117)
>>   at
>> org.apache.roller.weblogger.business.jpa.JPAPropertiesManagerImpl.initialize(JPAPropertiesManagerImpl.java:77)
>> at
>> org.apache.roller.weblogger.business.WebloggerImpl.initialize(WebloggerImpl.java:338)
>>   at
>> org.apache.roller.weblogger.ui.core.RollerContext.contextInitialized(RollerContext.java:161)
>> at
>> org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3934)
>>   at
>> org.apache.catalina.core.StandardContext.start(StandardContext.java:4429)
>> 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:526)
>>   at
>> org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:630)
>> at
>> org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:556)
>>   at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:491)
>> at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1206)
>>   at
>> org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:314)
>> at
>> org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
>>   at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
>> at org.apache.catalina.core.StandardHost.start(StandardHost.java:722)
>>   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:583)
>> 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)
>> INFO  2012-01-11 22:26:27,281 DatabaseProvider:successMessage - SUCCESS:
>> Got parameters. Using configuration type JNDI_NAME
>> INFO  2012-01-11 22:26:27,287 DatabaseProvider:successMessage - -- Using
>> JNDI datasource name: java:comp/env/jdbc/rollerdb
>> INFO  2012-01-11 22:26:27,290 DatabaseProvider:successMessage - SUCCESS:
>> located JNDI DataSource [java:comp/env/jdbc/rollerdb]
>> ... ...
>>
>> After reading OpenJPA's online documentation, I went to add the following
>> in roller-customer.properties:
>>
>> openjpa.ConnectionDriverName=oracle.jdbc.OracleDriver
>> openjpa.ConnectionURL=jdbc:oracle:thin:@localhost:1521:XE
>> openjpa.ConnectionUserName=rollerusername
>> openjpa.ConnectionPassword=****
>>
>> On my next try, the error went away.
>>
>> I am just curious because adding those openjpa properties is not
>> documented  anywhere in Roller.  Did I miss anything?
>>
>> Thanks,
>> Daniel
>>
>>
I have also the same when I set up a Datasource for jndi  but the other 
way around. it asks for me define the jpa even though the Setup is for a 
Datasource(jndi).  Since this wasn't very clear then I stopped using the 
datasource and reverted just to a straight jdbc connection. that didn't 
ask for any of the others.  Not sure if there is a roller property where 
you have to define which type of db access you are using,

cheers
Marcus
>
>
> -----
> Geen virus gevonden in dit bericht.
> Gecontroleerd door AVG - www.avg.com
> Versie: 2012.0.1901 / Virusdatabase: 2109/4738 - datum van uitgifte: 01/12/12


Re: Error Upgrade Roller 4.0 to 5.0 with Oracle DB

Posted by Marcus <m....@upcmail.nl>.
On 15-1-2012 19:06, Daniel Ruan wrote:
>   Hi Marcus,
>
> I found another way to get this to work while keeping the jdbc/roller JDNI
> data source name.  I placed commons-pool and commons-dbcp jars in
> WEB-INF/lib, and added the following lines to roller-custom.properties:
>
> openjpa.ConnectionDriverName=org.apache.commons.dbcp.BasicDataSource
>
> openjpa.ConnectionProperties="\
>      DriverClassName=oracle.jdbc.OracleDriver,\
>      Url=jdbc:oracle:thin:@localhost:1521:XE,\
>      Username=scott,\
>      Password=tiger,\
>      initialSize=10,\
>      maxActive=40,\
>      maxIdle=10,\
>      maxWait=10000,\
>      removeAbandoned=true,\
>      removeAbandonedTimeout=60,\
>      logAbandoned=true\
> "
>
> openjpa.DataCache=true(CacheSize=5000) # default CacheSize=1000
> openjpa.IgnoreChanges=true
> openjpa.RetainState=true
>
> Roller will use the Tomcat JNDI data source to do the initial handshake
> (e.g., checking db version).  If you set [ maxActive="1" maxIdle="0" ] in
> the JDNI data source, that connection will be soon released.  After that,
>   the OpenJPA pool is used in the application.
>
> Cheers,
> Daniel
>
>
>>> Versie: 2012.0.1901 / Virusdatabase: 2109/4738 - datum van uitgifte:
>>> 01/12/12
>>>
>> Hi Daniel,
>> I had another look at this and I have seen that if  you define your
>> context datasource prefixed with the jndi namespace then it works.
>> ie use java:comp/env/jdbc/rollerdb instead of just jdbc/rollerdb. That
>> will then be all you need,
>>
>> cheers
>> Marcus
>>
>
>
> -----
> Geen virus gevonden in dit bericht.
> Gecontroleerd door AVG - www.avg.com
> Versie: 2012.0.1901 / Virusdatabase: 2109/4744 - datum van uitgifte: 01/15/12
Hi Daniel,
thanks for the tip on the above. I think we've got it cracked now ! I 
looke din the source code and found the initial test of the connect 
where you get success appends the javanamespace for jndi but the 
properities for OpenJpa is not updated accordingly. It is this that 
stops it working. It gives the message that it needs the drivername but 
in fact this is just a general error message. The error it has is in 
fact it cannot find your jndi name.  For me it means I know it is now 
using the Tomcat Pooling supplied for the context datasource.
My site is  up and running now. I posted a comment for the datasource 
setup in the link to the java blog roll You can add your comments there 
as well if you want ?
link is www.javamarcus.com  , click on the javaposts and you can add 
your solution,

cheers Mate and have a good week,
Marcus

Re: Error Upgrade Roller 4.0 to 5.0 with Oracle DB

Posted by Daniel Ruan <da...@gmail.com>.
 Hi Marcus,

I found another way to get this to work while keeping the jdbc/roller JDNI
data source name.  I placed commons-pool and commons-dbcp jars in
WEB-INF/lib, and added the following lines to roller-custom.properties:

openjpa.ConnectionDriverName=org.apache.commons.dbcp.BasicDataSource

openjpa.ConnectionProperties="\
    DriverClassName=oracle.jdbc.OracleDriver,\
    Url=jdbc:oracle:thin:@localhost:1521:XE,\
    Username=scott,\
    Password=tiger,\
    initialSize=10,\
    maxActive=40,\
    maxIdle=10,\
    maxWait=10000,\
    removeAbandoned=true,\
    removeAbandonedTimeout=60,\
    logAbandoned=true\
"

openjpa.DataCache=true(CacheSize=5000) # default CacheSize=1000
openjpa.IgnoreChanges=true
openjpa.RetainState=true

Roller will use the Tomcat JNDI data source to do the initial handshake
(e.g., checking db version).  If you set [ maxActive="1" maxIdle="0" ] in
the JDNI data source, that connection will be soon released.  After that,
 the OpenJPA pool is used in the application.

Cheers,
Daniel


>> Versie: 2012.0.1901 / Virusdatabase: 2109/4738 - datum van uitgifte:
>> 01/12/12
>>
> Hi Daniel,
> I had another look at this and I have seen that if  you define your
> context datasource prefixed with the jndi namespace then it works.
> ie use java:comp/env/jdbc/rollerdb instead of just jdbc/rollerdb. That
> will then be all you need,
>
> cheers
> Marcus
>

Re: Error Upgrade Roller 4.0 to 5.0 with Oracle DB

Posted by Marcus <m....@upcmail.nl>.
On 12-1-2012 21:14, Daniel Ruan wrote:
> A follow-up question.  After I got it to work with the openjpa, I commented
> out database.jndi.name then Roller refused to start.
>
> I am just curious why Roller still requires a JDNI data source now that the
> JPA connection is set.  Is it because the connection check is hard coded in
> the startup code?
>
> Regards,
> Daniel
>
> On Wed, Jan 11, 2012 at 10:53 PM, Daniel Ruan<da...@gmail.com>  wrote:
>
>> Hi Folks,
>>
>> I had Roller 4.0.1 with Tomcat 6 and Oracle 10g XE as the backend.  I
>> followed the upgrade steps in the install guide, and when I first started
>> Tomcat, I got the following error in .log file:
>>
>> ... ...
>> INFO  2012-01-11 22:06:25,820 WebloggerImpl:initialize - Initializing
>> Roller Weblogger business tier
>> FATAL 2012-01-11 22:06:26,120 JPAPropertiesManagerImpl:initialize -
>> Failed to initialize runtime configuration properties.Please check that the
>> database has been upgraded!
>> <openjpa-2.0.1-r422266:989424 fatal user error>
>> org.apache.openjpa.persistence.ArgumentException: A JDBC Driver or
>> DataSource class name must be specified in the ConnectionDriverName
>> property.
>> at
>> org.apache.openjpa.jdbc.schema.DataSourceFactory.newDataSource(DataSourceFactory.java:76)
>>   at
>> org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl.createConnectionFactory(JDBCConfigurationImpl.java:839)
>> at
>> org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl.getDBDictionaryInstance(JDBCConfigurationImpl.java:597)
>>   at
>> org.apache.openjpa.jdbc.meta.MappingRepository.endConfiguration(MappingRepository.java:1489)
>> at
>> org.apache.openjpa.lib.conf.Configurations.configureInstance(Configurations.java:507)
>>   at
>> org.apache.openjpa.lib.conf.Configurations.configureInstance(Configurations.java:432)
>> at
>> org.apache.openjpa.lib.conf.PluginValue.instantiate(PluginValue.java:104)
>>   at
>> org.apache.openjpa.conf.MetaDataRepositoryValue.instantiate(MetaDataRepositoryValue.java:68)
>> at org.apache.openjpa.lib.conf.ObjectValue.instantiate(ObjectValue.java:83)
>>   at
>> org.apache.openjpa.conf.OpenJPAConfigurationImpl.newMetaDataRepositoryInstance(OpenJPAConfigurationImpl.java:939)
>> at
>> org.apache.openjpa.conf.OpenJPAConfigurationImpl.getMetaDataRepositoryInstance(OpenJPAConfigurationImpl.java:930)
>>   at
>> org.apache.openjpa.kernel.AbstractBrokerFactory.makeReadOnly(AbstractBrokerFactory.java:639)
>> at
>> org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:206)
>>   at
>> org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:156)
>> at
>> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:227)
>>   at
>> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:154)
>> at
>> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:60)
>>   at
>> org.apache.roller.weblogger.business.jpa.JPAPersistenceStrategy.getThreadLocalEntityManager(JPAPersistenceStrategy.java:238)
>> at
>> org.apache.roller.weblogger.business.jpa.JPAPersistenceStrategy.getEntityManager(JPAPersistenceStrategy.java:225)
>>   at
>> org.apache.roller.weblogger.business.jpa.JPAPersistenceStrategy.getNamedQuery(JPAPersistenceStrategy.java:258)
>> at
>> org.apache.roller.weblogger.business.jpa.JPAPropertiesManagerImpl.getProperties(JPAPropertiesManagerImpl.java:117)
>>   at
>> org.apache.roller.weblogger.business.jpa.JPAPropertiesManagerImpl.initialize(JPAPropertiesManagerImpl.java:77)
>> at
>> org.apache.roller.weblogger.business.WebloggerImpl.initialize(WebloggerImpl.java:338)
>>   at
>> org.apache.roller.weblogger.ui.core.RollerContext.contextInitialized(RollerContext.java:161)
>> at
>> org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3934)
>>   at
>> org.apache.catalina.core.StandardContext.start(StandardContext.java:4429)
>> 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:526)
>>   at
>> org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:630)
>> at
>> org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:556)
>>   at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:491)
>> at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1206)
>>   at
>> org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:314)
>> at
>> org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
>>   at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
>> at org.apache.catalina.core.StandardHost.start(StandardHost.java:722)
>>   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:583)
>> 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)
>> INFO  2012-01-11 22:26:27,281 DatabaseProvider:successMessage - SUCCESS:
>> Got parameters. Using configuration type JNDI_NAME
>> INFO  2012-01-11 22:26:27,287 DatabaseProvider:successMessage - -- Using
>> JNDI datasource name: java:comp/env/jdbc/rollerdb
>> INFO  2012-01-11 22:26:27,290 DatabaseProvider:successMessage - SUCCESS:
>> located JNDI DataSource [java:comp/env/jdbc/rollerdb]
>> ... ...
>>
>> After reading OpenJPA's online documentation, I went to add the following
>> in roller-customer.properties:
>>
>> openjpa.ConnectionDriverName=oracle.jdbc.OracleDriver
>> openjpa.ConnectionURL=jdbc:oracle:thin:@localhost:1521:XE
>> openjpa.ConnectionUserName=rollerusername
>> openjpa.ConnectionPassword=****
>>
>> On my next try, the error went away.
>>
>> I am just curious because adding those openjpa properties is not
>> documented  anywhere in Roller.  Did I miss anything?
>>
>> Thanks,
>> Daniel
>>
>>
>>
>
>
> -----
> Geen virus gevonden in dit bericht.
> Gecontroleerd door AVG - www.avg.com
> Versie: 2012.0.1901 / Virusdatabase: 2109/4738 - datum van uitgifte: 01/12/12
Hi Daniel,
I had another look at this and I have seen that if  you define your 
context datasource prefixed with the jndi namespace then it works.
ie use java:comp/env/jdbc/rollerdb instead of just jdbc/rollerdb. That 
will then be all you need,

cheers
Marcus

Re: Error Upgrade Roller 4.0 to 5.0 with Oracle DB

Posted by Daniel Ruan <da...@gmail.com>.
A follow-up question.  After I got it to work with the openjpa, I commented
out database.jndi.name then Roller refused to start.

I am just curious why Roller still requires a JDNI data source now that the
JPA connection is set.  Is it because the connection check is hard coded in
the startup code?

Regards,
Daniel

On Wed, Jan 11, 2012 at 10:53 PM, Daniel Ruan <da...@gmail.com> wrote:

> Hi Folks,
>
> I had Roller 4.0.1 with Tomcat 6 and Oracle 10g XE as the backend.  I
> followed the upgrade steps in the install guide, and when I first started
> Tomcat, I got the following error in .log file:
>
> ... ...
> INFO  2012-01-11 22:06:25,820 WebloggerImpl:initialize - Initializing
> Roller Weblogger business tier
> FATAL 2012-01-11 22:06:26,120 JPAPropertiesManagerImpl:initialize -
> Failed to initialize runtime configuration properties.Please check that the
> database has been upgraded!
> <openjpa-2.0.1-r422266:989424 fatal user error>
> org.apache.openjpa.persistence.ArgumentException: A JDBC Driver or
> DataSource class name must be specified in the ConnectionDriverName
> property.
> at
> org.apache.openjpa.jdbc.schema.DataSourceFactory.newDataSource(DataSourceFactory.java:76)
>  at
> org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl.createConnectionFactory(JDBCConfigurationImpl.java:839)
> at
> org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl.getDBDictionaryInstance(JDBCConfigurationImpl.java:597)
>  at
> org.apache.openjpa.jdbc.meta.MappingRepository.endConfiguration(MappingRepository.java:1489)
> at
> org.apache.openjpa.lib.conf.Configurations.configureInstance(Configurations.java:507)
>  at
> org.apache.openjpa.lib.conf.Configurations.configureInstance(Configurations.java:432)
> at
> org.apache.openjpa.lib.conf.PluginValue.instantiate(PluginValue.java:104)
>  at
> org.apache.openjpa.conf.MetaDataRepositoryValue.instantiate(MetaDataRepositoryValue.java:68)
> at org.apache.openjpa.lib.conf.ObjectValue.instantiate(ObjectValue.java:83)
>  at
> org.apache.openjpa.conf.OpenJPAConfigurationImpl.newMetaDataRepositoryInstance(OpenJPAConfigurationImpl.java:939)
> at
> org.apache.openjpa.conf.OpenJPAConfigurationImpl.getMetaDataRepositoryInstance(OpenJPAConfigurationImpl.java:930)
>  at
> org.apache.openjpa.kernel.AbstractBrokerFactory.makeReadOnly(AbstractBrokerFactory.java:639)
> at
> org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:206)
>  at
> org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:156)
> at
> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:227)
>  at
> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:154)
> at
> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:60)
>  at
> org.apache.roller.weblogger.business.jpa.JPAPersistenceStrategy.getThreadLocalEntityManager(JPAPersistenceStrategy.java:238)
> at
> org.apache.roller.weblogger.business.jpa.JPAPersistenceStrategy.getEntityManager(JPAPersistenceStrategy.java:225)
>  at
> org.apache.roller.weblogger.business.jpa.JPAPersistenceStrategy.getNamedQuery(JPAPersistenceStrategy.java:258)
> at
> org.apache.roller.weblogger.business.jpa.JPAPropertiesManagerImpl.getProperties(JPAPropertiesManagerImpl.java:117)
>  at
> org.apache.roller.weblogger.business.jpa.JPAPropertiesManagerImpl.initialize(JPAPropertiesManagerImpl.java:77)
> at
> org.apache.roller.weblogger.business.WebloggerImpl.initialize(WebloggerImpl.java:338)
>  at
> org.apache.roller.weblogger.ui.core.RollerContext.contextInitialized(RollerContext.java:161)
> at
> org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3934)
>  at
> org.apache.catalina.core.StandardContext.start(StandardContext.java:4429)
> 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:526)
>  at
> org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:630)
> at
> org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:556)
>  at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:491)
> at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1206)
>  at
> org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:314)
> at
> org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
>  at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
> at org.apache.catalina.core.StandardHost.start(StandardHost.java:722)
>  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:583)
> 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)
> INFO  2012-01-11 22:26:27,281 DatabaseProvider:successMessage - SUCCESS:
> Got parameters. Using configuration type JNDI_NAME
> INFO  2012-01-11 22:26:27,287 DatabaseProvider:successMessage - -- Using
> JNDI datasource name: java:comp/env/jdbc/rollerdb
> INFO  2012-01-11 22:26:27,290 DatabaseProvider:successMessage - SUCCESS:
> located JNDI DataSource [java:comp/env/jdbc/rollerdb]
> ... ...
>
> After reading OpenJPA's online documentation, I went to add the following
> in roller-customer.properties:
>
> openjpa.ConnectionDriverName=oracle.jdbc.OracleDriver
> openjpa.ConnectionURL=jdbc:oracle:thin:@localhost:1521:XE
> openjpa.ConnectionUserName=rollerusername
> openjpa.ConnectionPassword=****
>
> On my next try, the error went away.
>
> I am just curious because adding those openjpa properties is not
> documented  anywhere in Roller.  Did I miss anything?
>
> Thanks,
> Daniel
>
>
>