-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 7 posts ] 
Author Message
 Post subject: org.apache.openjpa.persistence.ArgumentException:
PostPosted: Fri Jun 24, 2011 12:14 am 
Newbie

Joined: Thu Jun 23, 2011 11:58 pm
Posts: 4
Hi All,

I am using Hibernate with JPA in weblogic 10.3.3, i got the following error.


****************************************************************************************************************************************************

1 WARN [pool-1-thread-1] openjpa.Runtime - The configuration property named "openjpa.Id" was not recognized and will be ignored, although the name closely matches a valid property called "openjpa.Id".
10 INFO [pool-1-thread-1] openjpa.Runtime - Starting BEA Kodo 4.2.0
<openjpa-1.1.1-SNAPSHOT-r422266:965591 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:72)
at org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl.createConnectionFactory(JDBCConfigurationImpl.java:776)
at org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl.getDBDictionaryInstance(JDBCConfigurationImpl.java:553)
at org.apache.openjpa.jdbc.meta.MappingRepository.endConfiguration(MappingRepository.java:1250)
at org.apache.openjpa.lib.conf.Configurations.configureInstance(Configurations.java:505)
at org.apache.openjpa.lib.conf.Configurations.configureInstance(Configurations.java:430)
at org.apache.openjpa.lib.conf.PluginValue.instantiate(PluginValue.java:103)
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:843)
at org.apache.openjpa.conf.OpenJPAConfigurationImpl.getMetaDataRepositoryInstance(OpenJPAConfigurationImpl.java:834)
at org.apache.openjpa.kernel.AbstractBrokerFactory.makeReadOnly(AbstractBrokerFactory.java:638)
at org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:183)
at org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:142)
at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:199)
at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:152)
at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:56)
at com.apple.gcrmws.core.persistency.RetriveCaseDetails.retriveCase(RetriveCaseDetails.java:30)
at com.apple.gcrmws.provider.services.gsxchlk.service.GSXCaseHistoryGateway.invoke(GSXCaseHistoryGateway.java:116)
at com.apple.gcrmws.provider.services.gsxchlk.service.GSXCaseHistoryGateway.call(GSXCaseHistoryGateway.java:54)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)



persistence.xml file contains the following content and we placed this in META-INF. We are deploying the application as war

<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/ ... ce_1_0.xsd"
version="1.0">
<persistence-unit name="jpa" transaction-type="JTA">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>jdbc/test</jta-data-source>
<class>com.test.Issue</class>
<class>com.test.CaseDetails</class>
<properties>
<property name="hibernate.connection.url" value="jdbc:oracle:thin:@host:port:sid"/>
<property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect"/>
<property name="hibernate.connection.driver_class" value="oracle.jdbc.driver.OracleDriver"/>
<property name="hibernate.connection.password" value="password"/>
<property name="hibernate.connection.username" value="username"/>
<property name="hibernate.hbm2ddl.auto" value="update"/>
<property name="hibernate.show_sql" value="true" />
<property name="hibernate.format_sql" value="true" />
<property name="hibernate.cache.use_query_cache" value="false" />

</properties>
</persistence-unit>

<persistence-unit name="jpaJNDI" transaction-type="JTA">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>jdbc/test</jta-data-source>
<class>com.test.PsRdSegment</class>
<class>com.test.CaseDetails</class>
<properties>
<property name="hibernate.ejb.cfgfile" value="META-INF/hibernate.cfg.xml"/>
<property name="hibernate.transaction.factory_class" value="org.hibernate.ejb.transaction.JoinableCMTTransactionFactory"/>
<property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.WeblogicTransactionManagerLookup"/>
<property name="hibernate.cache.provider_class" value="org.hibernate.cache.EhCacheProvider"/>
<property name="hibernate.cache.jndi" value="evolv-cache"/>
</properties>
</persistence-unit>
</persistence>


hibernate.cfg.xml contains as folloes

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

<hibernate-configuration>
<session-factory>
<property name="connection.datasource">jdbc/test</property>
<property name="show_sql">true</property>
<property name="dialect">org.hibernate.dialect.OracleDialect</property>
<property name="jndi.url">t3://host:port</property>
<property name="jndi.class">weblogic.jndi.WLInitialContextFactory</property>
</session-factory>
</hibernate-configuration>


If any one knows the about the error help me out.



Thanks in advance.


Top
 Profile  
 
 Post subject: Re: org.apache.openjpa.persistence.ArgumentException:
PostPosted: Fri Jun 24, 2011 2:48 am 
Expert
Expert

Joined: Tue Jun 16, 2009 3:36 am
Posts: 990
Code:
<property name="hibernate.connection.url" value="jdbc:oracle:thin:@host:port:sid"/>
<property name="hibernate.connection.driver_class" value="oracle.jdbc.driver.OracleDriver"/>
<property name="hibernate.connection.password" value="password"/>
<property name="hibernate.connection.username" value="username"/>


These hibernate.connection settings above are for RESOURCE_LOCAL transaction-type only.
If you choose transaction-type="JTA" then you should omit these RESOURCE_LOCAL configuration values.
Maybe that's the problem.


Top
 Profile  
 
 Post subject: Re: org.apache.openjpa.persistence.ArgumentException:
PostPosted: Fri Jun 24, 2011 4:41 am 
Newbie

Joined: Thu Jun 23, 2011 11:58 pm
Posts: 4
Thanks for the reply, but error still persists.
Please confirm that, we are follow correct process to deploy JPA Hibernate into Weblogic
Please find the below code which we are use for JPA hibernate
Code:
public class TestJPA {
   EntityManagerFactory emf = null;
   @PersistenceContext(type=PersistenceContextType.EXTENDED)
   EntityManager em = null;
   /**
    * @param args
    */
   @SuppressWarnings("unchecked")
   public List retriveCase(String serailId) {
      emf = Persistence.createEntityManagerFactory("jpa");
      em = emf.createEntityManager();
      List<CaseDetails> caseList = new ArrayList<CaseDetails>();
      EntityTransaction entr = em.getTransaction();
      try {
         entr.begin();
         Query query = em.createQuery("SELECT A FROM CaseDetails A WHERE A.caseId =(SELECT B FROM CaseDetails B WHERE B.serileId='"+serailId+"')");
         caseList = query.getResultList();
         entr.commit();
      }catch( RuntimeException ex ) {
            if( entr != null && entr.isActive() ) entr.rollback();
            throw ex;
      }catch( Exception ex ) {
            try { entr.rollback(); } catch( Exception e ) {}
            throw new RuntimeException( ex );
      }


Can you please provide alternative solutions to resolve the issue.


Top
 Profile  
 
 Post subject: Re: org.apache.openjpa.persistence.ArgumentException:
PostPosted: Sun Jun 26, 2011 12:10 pm 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Hi,
it looks like that OpenJPA is being booted, while you've correctly defined in the persistence.xml to use the Hibernate implementation.

Are you experiencing this error when running your test only, or when you deploy the application (or both) ?
If this is about the test, what is on your classpath and which import statements are you declaring? Is it "javax.persistence.Persistence" ?

To reliably run tests like this I'd suggest to have a look into Arquillian.

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
 Post subject: Re: org.apache.openjpa.persistence.ArgumentException:
PostPosted: Mon Jun 27, 2011 5:20 am 
Newbie

Joined: Thu Jun 23, 2011 11:58 pm
Posts: 4
This error getting at the time of testing.
Class path libraries are,
log4j.jar
hibernate3.jar;
hibernate-jpa-2.0-api-1.0.0.Final.jar;
providerutil.jar;
dom4j-1.6.1.jar;
commons-collections-2.1.1.jar;
jta1.1.jar;
asm.jar;
asm-attrs.jar;
commons-logging.jar;
antlr-2.7.5H3.jar;
antlr-2.7.6rc1.jar;
ant-1.6.5.jar;
cglib-2.1.3.jar

importing classes from,
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.EntityTransaction;
import javax.persistence.Persistence;
import javax.persistence.PersistenceContext;
import javax.persistence.PersistenceContextType;
import javax.persistence.Query;

And we changed the weblogic datasource from some XA driver oracle driver to oracle.jdbc.pool.OracleDataSource, issue is persistence.


Top
 Profile  
 
 Post subject: Re: org.apache.openjpa.persistence.ArgumentException:
PostPosted: Mon Jun 27, 2011 5:24 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Still you have "org.apache.openjpa" in the classpath too, I can see it in the stacktrace.
By testing, I mean out of a container deployment; are you testing this by deploying the app on websphere?

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
 Post subject: Re: org.apache.openjpa.persistence.ArgumentException:
PostPosted: Mon Jun 27, 2011 8:10 am 
Newbie

Joined: Thu Jun 23, 2011 11:58 pm
Posts: 4
Yes we deployed the application (WAR) on weblogic (10.3.3).


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 7 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.