Re: [jira] Resolved: (OPENJPA-208) NoResultException and NonUniqueResultException are not thrown when expected
Went ahead and restored the previous behavior where the QueryImpl itself checks for non-uniqueness and throws the expected exception. That breaks the single result optimization that was added for OPENJPA-168 when getSingleResult() is called. There was a reason we moved the validation to the kernel. The previous code was correct. You need to use the hard way of creating new exception types. Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it.
[jira] Commented: (OPENJPA-201) Mapping Tool ignores the @JoinColumn annotation in a @ManyToOne mapping if the table argument is used
[ https://issues.apache.org/jira/browse/OPENJPA-201?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12487565 ] Abe White commented on OPENJPA-201: --- The primary table for what entity? The primary table for the entity shown in your example is clearly CxWine, but the JoinColumn references a table cxWINERY. That table doesn't appear anywhere else in the example code. So if it's not the entity's table and it's not a secondary table, then it's not a valid mapping. If you mean it's the primary table of the related entity, then that is not supported by vanilla JPA. The JPA spec does not support one-sided relations based on an inverse foreign key. You'd have to make the relation a two-sided relation and use mappedBy on the side that doesn't own the foreign key. OpenJPA does actually support one-sided inverse-key relations, however. We can go over its support in OpenJPA, but first I'd like confirmation that that's the intent. It doesn't seem likely that each Winery record contains a foreign key to a single Wine record, so maybe I'm on the wrong track. Mapping Tool ignores the @JoinColumn annotation in a @ManyToOne mapping if the table argument is used - Key: OPENJPA-201 URL: https://issues.apache.org/jira/browse/OPENJPA-201 Project: OpenJPA Issue Type: Bug Environment: 0.9.7-incubating-SNAPSHOT Reporter: George Hongell Priority: Minor @Entity @Table(name=CxWine) public class Wine { @Id private Integer wineid; ... @ManyToOne() @JoinColumn(name=NEW_WINERY_WINERYID, referencedColumnName=WINERYID, table=cxWinery) //ignored @JoinColumn(name=NEW_WINERY_WINERYID, referencedColumnName=WINERYID, table=cxWinery) //ignored @JoinColumn(name=NEW_WINERY_WINERYID, referencedColumnName=WINERYID, table=cxWinery) //ignored @JoinColumn(name=NEW_WINERY_WINERYID, table=cxWINERY) //ok @JoinColumn(name=NEW_WINERY_WINERYID, referencedColumnName=wineryid) //ok @JoinColumn(name=NEW_WINERY_WINERYID) private Winery winery; ... } generates 2744 cxwineTour TRACE [main] openjpa.jdbc.SQL - t 1094861122, conn 98698722 executing stmnt 1325027066 CREATE TABLE CxWine (wineid INTEGER NOT NULL, cost SMALLINT, description VARCHAR(254), minimumHoldYears INTEGER, rating SMALLINT, stockCount INTEGER, type VARCHAR(20), version INTEGER, alcoholPercent DOUBLE, ava VARCHAR(40), bottler VARCHAR(40), brandName VARCHAR(40), labelWineClass VARCHAR(20), labelWineColor VARCHAR(20), estateBottled SMALLINT, hasSulfites SMALLINT, labelid INTEGER, mlContents INTEGER, qualityDesignation VARCHAR(40), vineyardName VARCHAR(40), vintage TIMESTAMP, wineName VARCHAR(40), winery_wineryid INTEGER, PRIMARY KEY (wineid)) -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Created: (OPENJPA-211) CLONE -java.lang.VerifyError on websphere 6.1 with Spring 2.0.3 and OpenJpa 0.96
CLONE -java.lang.VerifyError on websphere 6.1 with Spring 2.0.3 and OpenJpa 0.96 Key: OPENJPA-211 URL: https://issues.apache.org/jira/browse/OPENJPA-211 Project: OpenJPA Issue Type: Bug Environment: Using OpenJPA (openjpa-all-0.9.6-incubating.jar) in Rational Developer 7 ( Websphere 6.1 test environment ) connected to Oracle 9.2 database. OS: WinXP SP2 Reporter: david zhang Priority: Minor Fix For: 0.9.8 Hi .. Not sure if this is a bug or just the way websphere reacts to openjpa. I have a small test program using OpenJPA against an Oracle database. I am running this program in the Websphere 6.1 test environment included with Rational Developer 7. This is all working just fine. But when I make changes to some ressource in the application, the chagnes are automatically published to the test environment and the app is restarted. After this I get the Exception below, whenever I try to access an EntityManager. If I restart the entire server, the app is running fine again. So I guess this is related to restarting the application. Caused by: java.lang.VerifyError: class loading constraint violated (class: org/apache/openjpa/kernel/BrokerImpl method: newQueryImpl(Ljava/lang/String;Lorg/apache/openjpa/kernel/StoreQuery;)Lorg/apache/openjpa/kernel/QueryImpl;) at pc: 0 at java.lang.J9VMInternals.verifyImpl(Native Method) at java.lang.J9VMInternals.verify(J9VMInternals.java:59) at java.lang.J9VMInternals.initialize(J9VMInternals.java:120) at java.lang.Class.forNameImpl(Native Method) at java.lang.Class.forName(Class.java:131) at org.apache.openjpa.conf.OpenJPAConfigurationImpl.class$(OpenJPAConfigurationImpl.java:65) at org.apache.openjpa.conf.OpenJPAConfigurationImpl.init(OpenJPAConfigurationImpl.java:182) at org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl.init(JDBCConfigurationImpl.java:110) at org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl.init(JDBCConfigurationImpl.java:100) at org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl.init(JDBCConfigurationImpl.java:91) at org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory.newInstance(JDBCBrokerFactory.java:55) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:615) at org.apache.openjpa.kernel.Bootstrap.invokeFactory(Bootstrap.java:117) at org.apache.openjpa.kernel.Bootstrap.newBrokerFactory(Bootstrap.java:57) at org.apache.openjpa.persistence.PersistenceProviderImpl.createEntityManagerFactory(PersistenceProviderImpl.java:70) at org.apache.openjpa.persistence.PersistenceProviderImpl.createEntityManagerFactory(PersistenceProviderImpl.java:78) at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:83) at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:60) at util.EntityManagerFactoryHelper.getEntityManagerFactory(EntityManagerFactoryHelper.java:22) -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Reopened: (OPENJPA-208) NoResultException and NonUniqueResultException are not thrown when expected
[ https://issues.apache.org/jira/browse/OPENJPA-208?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Marc Prud'hommeaux reopened OPENJPA-208: From Abe on mailing list: That breaks the single result optimization that was added for OPENJPA-168 when getSingleResult() is called. There was a reason we moved the validation to the kernel. The previous code was correct. You need to use the hard way of creating new exception types. NoResultException and NonUniqueResultException are not thrown when expected --- Key: OPENJPA-208 URL: https://issues.apache.org/jira/browse/OPENJPA-208 Project: OpenJPA Issue Type: Bug Components: jpa Affects Versions: 0.9.6 Reporter: Marc Prud'hommeaux Assigned To: Marc Prud'hommeaux Fix For: 0.9.7 When calling Query.getSingleResult() on a query that either has no result or multiple results, either a NoResultException and NonUniqueResultException (respectively) should be thrown in accordance with section 3.6.1 of the JPA spec. Instead, we appear to throw a org.apache.openjpa.persistence.InvalidStateException: org.apache.openjpa.persistence.InvalidStateException: The query on candidate type class com.sun.ts.tests.ejb30.persistence.query.apitests.Department with filter select d.name from Department d where d.id 1 was configured to have a unique result, but more than one instance matched the query. at org.apache.openjpa.kernel.QueryImpl.singleResult(QueryImpl.java:1282) at org.apache.openjpa.kernel.QueryImpl.toResult(QueryImpl.java:1207) at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:982) at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:791) at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:761) at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:757) at org.apache.openjpa.kernel.DelegatingQuery.execute(DelegatingQuery.java:514) at org.apache.openjpa.persistence.QueryImpl.execute(QueryImpl.java:225) at org.apache.openjpa.persistence.QueryImpl.getSingleResult(QueryImpl.java:287) -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
RE: Mapping tool in eclipse
Happily, the next release won't have the pesky word 'all' in the jar, which will hopefully help stave off the perception that that jar contains everything needed to use OpenJPA. -Patrick -- Patrick Linskey BEA Systems, Inc. ___ Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it. -Original Message- From: Marc Prud'hommeaux [mailto:[EMAIL PROTECTED] On Behalf Of Marc Prud'hommeaux Sent: Sunday, April 08, 2007 8:14 PM To: open-jpa-dev@incubator.apache.org Subject: Re: Mapping tool in eclipse Phill- It sounds like you have the tool set up to use the openjpa-all-0.9.6- incubating.jar, but you haven't added any of the other required dependencies to the environment's classpath. You should put everything (except the derby jar) in the lib/ directory of the OpenJPA distribution in the environments classpath. On Apr 8, 2007, at 7:55 PM, Phill Moran wrote: Has anyone installed the mapping tool in the external eclipse tools? I am getting an error and little info or ways to debug. I am trying to set it up so that it would validate the current file. I would be happy with all files in workspace or package. Really just to get it to run so I can get to the problem I am really after which is a OpenJPA not managed exception Location is set to java Parameters is set to this (hard coded file for now to get it running) org.apache.openjpa.jdbc.meta.MappingTool -jar openjpa-all-0.9.6- incubating.jar validate -a C:\development\emall\target\classes\ca\test\categories\Category.class I have also defined a classpath set to the incubating jar And I get this for my trouble: Exception in thread main java.lang.NoClassDefFoundError: org/apache/commons/lang/exception/NestableRuntimeException at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:620) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java: 124) at java.net.URLClassLoader.defineClass(URLClassLoader.java:260) at java.net.URLClassLoader.access$000(URLClassLoader.java:56) at java.net.URLClassLoader$1.run(URLClassLoader.java:195) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276) at java.lang.ClassLoader.loadClass(ClassLoader.java:251) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) at org.apache.openjpa.jdbc.meta.MappingTool.main(MappingTool.java: 903) Any thoughts? Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it.
Compiling (build all) in eclipse
Troubles continue Any suggestions for this problem in eclipse??? org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'personFactory' defined in file [C:\BidSpec\emall\development\emall\target\classes\applicationContext.xml]: Initialization of bean failed; nested exception is java.lang.NoSuchMethodError: ca.BidSpec.emall.persistence.Persistable.pcGetManagedFieldCount()I Caused by: java.lang.NoSuchMethodError: ca.BidSpec.emall.persistence.Persistable.pcGetManagedFieldCount()I at ca.BidSpec.emall.stores.Store.clinit(Store.java) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:169) at $Proxy26.clinit(Unknown Source) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorI mpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorA ccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:588) at org.springframework.aop.framework.JdkDynamicAopProxy.getProxy(JdkDynamicAopProxy .java:115) at org.springframework.aop.framework.ProxyFactory.getProxy(ProxyFactory.java:110) at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.createProxy (AbstractAutoProxyCreator.java:401) at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.postProcess AfterInitialization(AbstractAutoProxyCreator.java:279) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.app lyBeanPostProcessorsAfterInitialization(AbstractAutowireCapableBeanFactory.java: 318) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.ini tializeBean(AbstractAutowireCapableBeanFactory.java:1119) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.cre ateBean(AbstractAutowireCapableBeanFactory.java:431) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(Abstra ctBeanFactory.java:254) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingle ton(DefaultSingletonBeanRegistry.java:144) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBe anFactory.java:251) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBe anFactory.java:163) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.aut owireByName(AbstractAutowireCapableBeanFactory.java:862) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.pop ulateBean(AbstractAutowireCapableBeanFactory.java:810) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.aut owireBeanProperties(AbstractAutowireCapableBeanFactory.java:273) at org.springframework.test.AbstractDependencyInjectionSpringContextTests.injectDep endencies(AbstractDependencyInjectionSpringContextTests.java:179) at org.springframework.test.AbstractDependencyInjectionSpringContextTests.prepareTe stInstance(AbstractDependencyInjectionSpringContextTests.java:158) at org.springframework.test.AbstractSingleSpringContextTests.setUp(AbstractSingleSp ringContextTests.java:88) at junit.framework.TestCase.runBare(TestCase.java:132) at org.springframework.test.ConditionalTestCase.runBare(ConditionalTestCase.java:69 ) at org.springframework.test.annotation.AbstractAnnotationAwareTransactionalTests.ac cess$001(AbstractAnnotationAwareTransactionalTests.java:47) at org.springframework.test.annotation.AbstractAnnotationAwareTransactionalTests$1. run(AbstractAnnotationAwareTransactionalTests.java:115) at org.springframework.test.annotation.AbstractAnnotationAwareTransactionalTests.ru nTest(AbstractAnnotationAwareTransactionalTests.java:180) at org.springframework.test.annotation.AbstractAnnotationAwareTransactionalTests.ru nTestTimed(AbstractAnnotationAwareTransactionalTests.java:153) at org.springframework.test.annotation.AbstractAnnotationAwareTransactionalTests.ru nBare(AbstractAnnotationAwareTransactionalTests.java:111) at org.springframework.test.jpa.AbstractJpaTests.runBare(AbstractJpaTests.java:159) at org.springframework.test.jpa.AbstractJpaTests.runBare(AbstractJpaTests.java:239) at junit.framework.TestResult$1.protect(TestResult.java:110) at junit.framework.TestResult.runProtected(TestResult.java:128) at junit.framework.TestResult.run(TestResult.java:113) at junit.framework.TestCase.run(TestCase.java:124) at junit.framework.TestSuite.runTest(TestSuite.java:232) at junit.framework.TestSuite.run(TestSuite.java:227) at
Unit testing
Hi, I'm a bit concerned about the lack of unit tests being put into OpenJPA as new features are added. I understand that often, creating unit tests are anticlimactic compared to implementing the feature itself, but at least basic happy-path testing of new features is pretty essential if we want to avoid these types of problems. Code inspection is good but, Abe's good eyes aside, not as reliable as having a unit test that will start failing when a feature is broken. I try to write my test cases first, in a somewhat-modified TDD approach. I do this because a) I need some sort of harness to demonstrate the failure in order to isolate and resolve it, and b) I know that personally, I'm much more likely to write a test while the problem is still interesting than after it's resolved. In other words, I never (well, rarely) have a command-line harness that I throw together to demonstrate a problem. I try to always use a test case instead. This strategy means that the only test-related overhead is the effort involved to figure out how to programmatically test for failure. Also, I understand that some things are hard to test. Testing SQL or JDBC interactions is often percieved to be one of these things. In the Kodo codebase, we ended up creating various means to get around this; the SQLListenerTestCase is one such example. It turns out that by extending SQLListenerTestCase, it becomes trivial to check how much SQL was written and what the SQL looks like. Does anyone else have any thoughts about how to ensure that we develop test cases as needed? -Patrick -- Patrick Linskey BEA Systems, Inc. ___ Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it. -Original Message- From: Abe White Sent: Monday, April 09, 2007 8:12 AM To: open-jpa-dev@incubator.apache.org Subject: Re: [jira] Resolved: (OPENJPA-208) NoResultException and NonUniqueResultException are not thrown when expected Went ahead and restored the previous behavior where the QueryImpl itself checks for non-uniqueness and throws the expected exception. That breaks the single result optimization that was added for OPENJPA-168 when getSingleResult() is called. There was a reason we moved the validation to the kernel. The previous code was correct. You need to use the hard way of creating new exception types. Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it. Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it.
RE: Compiling (build all) in eclipse
Hmm. It sounds like maybe the Persistable class hasn't been enhanced. It's a surprising error, but it looks like OpenJPA hasn't really gotten into the loop at this point, which would explain why you're not seeing anything more informative. Could this explain the situation? -Patrick -- Patrick Linskey BEA Systems, Inc. ___ Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it. -Original Message- From: Phill Moran [mailto:[EMAIL PROTECTED] Sent: Monday, April 09, 2007 9:50 AM To: open-jpa-dev@incubator.apache.org Subject: Compiling (build all) in eclipse Troubles continue Any suggestions for this problem in eclipse??? org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'personFactory' defined in file [C:\BidSpec\emall\development\emall\target\classes\application Context.xml]: Initialization of bean failed; nested exception is java.lang.NoSuchMethodError: ca.BidSpec.emall.persistence.Persistable.pcGetManagedFieldCount()I Caused by: java.lang.NoSuchMethodError: ca.BidSpec.emall.persistence.Persistable.pcGetManagedFieldCount()I at ca.BidSpec.emall.stores.Store.clinit(Store.java) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:169) at $Proxy26.clinit(Unknown Source) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeCo nstructorAccessorI mpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Dele gatingConstructorA ccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:588) at org.springframework.aop.framework.JdkDynamicAopProxy.getProxy( JdkDynamicAopProxy .java:115) at org.springframework.aop.framework.ProxyFactory.getProxy(ProxyF actory.java:110) at org.springframework.aop.framework.autoproxy.AbstractAutoProxyC reator.createProxy (AbstractAutoProxyCreator.java:401) at org.springframework.aop.framework.autoproxy.AbstractAutoProxyC reator.postProcess AfterInitialization(AbstractAutoProxyCreator.java:279) at org.springframework.beans.factory.support.AbstractAutowireCapa bleBeanFactory.app lyBeanPostProcessorsAfterInitialization(AbstractAutowireCapabl eBeanFactory.java: 318) at org.springframework.beans.factory.support.AbstractAutowireCapa bleBeanFactory.ini tializeBean(AbstractAutowireCapableBeanFactory.java:1119) at org.springframework.beans.factory.support.AbstractAutowireCapa bleBeanFactory.cre ateBean(AbstractAutowireCapableBeanFactory.java:431) at org.springframework.beans.factory.support.AbstractBeanFactory$ 1.getObject(Abstra ctBeanFactory.java:254) at org.springframework.beans.factory.support.DefaultSingletonBean Registry.getSingle ton(DefaultSingletonBeanRegistry.java:144) at org.springframework.beans.factory.support.AbstractBeanFactory. getBean(AbstractBe anFactory.java:251) at org.springframework.beans.factory.support.AbstractBeanFactory. getBean(AbstractBe anFactory.java:163) at org.springframework.beans.factory.support.AbstractAutowireCapa bleBeanFactory.aut owireByName(AbstractAutowireCapableBeanFactory.java:862) at org.springframework.beans.factory.support.AbstractAutowireCapa bleBeanFactory.pop ulateBean(AbstractAutowireCapableBeanFactory.java:810) at org.springframework.beans.factory.support.AbstractAutowireCapa bleBeanFactory.aut owireBeanProperties(AbstractAutowireCapableBeanFactory.java:273) at org.springframework.test.AbstractDependencyInjectionSpringCont extTests.injectDep endencies(AbstractDependencyInjectionSpringContextTests.java:179) at org.springframework.test.AbstractDependencyInjectionSpringCont extTests.prepareTe stInstance(AbstractDependencyInjectionSpringContextTests.java:158) at org.springframework.test.AbstractSingleSpringContextTests.setU p(AbstractSingleSp ringContextTests.java:88) at junit.framework.TestCase.runBare(TestCase.java:132) at org.springframework.test.ConditionalTestCase.runBare(Condition alTestCase.java:69 ) at org.springframework.test.annotation.AbstractAnnotationAwareTra nsactionalTests.ac cess$001(AbstractAnnotationAwareTransactionalTests.java:47) at org.springframework.test.annotation.AbstractAnnotationAwareTra
RE: Unit testing
It should be part of the commit acceptance process. I agree that it should be part of the process, but I hope that with sufficient discipline and attention, we can avoid having to enforce this via automated rules. I definitely make changes that don't merit unit tests, such as changes to localized strings, null checks, build file changes, etc. -Patrick -- Patrick Linskey BEA Systems, Inc. ___ Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it. -Original Message- From: Phill Moran [mailto:[EMAIL PROTECTED] Sent: Monday, April 09, 2007 10:02 AM To: open-jpa-dev@incubator.apache.org Subject: RE: Unit testing +1 It should be part of the commit acceptance process. Otherwise OpenJPA will loose out to other ORM tools that will be perceived as less buggy. What is used for coverage monitoring, clover? We should also use checkstyle to give some insight into the code as well Phill -Original Message- From: Patrick Linskey [mailto:[EMAIL PROTECTED] Sent: April 9, 2007 12:51 PM To: open-jpa-dev@incubator.apache.org Subject: Unit testing Hi, I'm a bit concerned about the lack of unit tests being put into OpenJPA as new features are added. I understand that often, creating unit tests are anticlimactic compared to implementing the feature itself, but at least basic happy-path testing of new features is pretty essential if we want to avoid these types of problems. Code inspection is good but, Abe's good eyes aside, not as reliable as having a unit test that will start failing when a feature is broken. I try to write my test cases first, in a somewhat-modified TDD approach. I do this because a) I need some sort of harness to demonstrate the failure in order to isolate and resolve it, and b) I know that personally, I'm much more likely to write a test while the problem is still interesting than after it's resolved. In other words, I never (well, rarely) have a command-line harness that I throw together to demonstrate a problem. I try to always use a test case instead. This strategy means that the only test-related overhead is the effort involved to figure out how to programmatically test for failure. Also, I understand that some things are hard to test. Testing SQL or JDBC interactions is often percieved to be one of these things. In the Kodo codebase, we ended up creating various means to get around this; the SQLListenerTestCase is one such example. It turns out that by extending SQLListenerTestCase, it becomes trivial to check how much SQL was written and what the SQL looks like. Does anyone else have any thoughts about how to ensure that we develop test cases as needed? -Patrick -- Patrick Linskey BEA Systems, Inc. __ _ Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it. -Original Message- From: Abe White Sent: Monday, April 09, 2007 8:12 AM To: open-jpa-dev@incubator.apache.org Subject: Re: [jira] Resolved: (OPENJPA-208) NoResultException and NonUniqueResultException are not thrown when expected Went ahead and restored the previous behavior where the QueryImpl itself checks for non-uniqueness and throws the expected exception. That breaks the single result optimization that was added for OPENJPA-168 when getSingleResult() is called. There was a reason we moved the validation to the kernel. The previous code was correct. You need to use the hard way of creating new exception types. Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it. Notice:
RE: Compiling (build all) in eclipse
Eclipse clean workspace Import Maven generate project (eclipse:eclispe) Build all -- Error The same POM builds fine externally through mvn package Other interesting points: I was getting a NPE from maven build so I turn off the maven builder but that had no effect. Have also tried clean then build all, and physically deleted all resources All openJPAXXX jar are in the lib (repository) I am certain this is a configuration problem. Just not sure what Phill -Original Message- From: Patrick Linskey [mailto:[EMAIL PROTECTED] Sent: April 9, 2007 12:59 PM To: open-jpa-dev@incubator.apache.org Subject: RE: Compiling (build all) in eclipse Hmm. It sounds like maybe the Persistable class hasn't been enhanced. It's a surprising error, but it looks like OpenJPA hasn't really gotten into the loop at this point, which would explain why you're not seeing anything more informative. Could this explain the situation? -Patrick -- Patrick Linskey BEA Systems, Inc. ___ Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it. -Original Message- From: Phill Moran [mailto:[EMAIL PROTECTED] Sent: Monday, April 09, 2007 9:50 AM To: open-jpa-dev@incubator.apache.org Subject: Compiling (build all) in eclipse Troubles continue Any suggestions for this problem in eclipse??? org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'personFactory' defined in file [C:\BidSpec\emall\development\emall\target\classes\application Context.xml]: Initialization of bean failed; nested exception is java.lang.NoSuchMethodError: ca.BidSpec.emall.persistence.Persistable.pcGetManagedFieldCount()I Caused by: java.lang.NoSuchMethodError: ca.BidSpec.emall.persistence.Persistable.pcGetManagedFieldCount()I at ca.BidSpec.emall.stores.Store.clinit(Store.java) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:169) at $Proxy26.clinit(Unknown Source) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeCo nstructorAccessorI mpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Dele gatingConstructorA ccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:588) at org.springframework.aop.framework.JdkDynamicAopProxy.getProxy( JdkDynamicAopProxy .java:115) at org.springframework.aop.framework.ProxyFactory.getProxy(ProxyF actory.java:110) at org.springframework.aop.framework.autoproxy.AbstractAutoProxyC reator.createProxy (AbstractAutoProxyCreator.java:401) at org.springframework.aop.framework.autoproxy.AbstractAutoProxyC reator.postProcess AfterInitialization(AbstractAutoProxyCreator.java:279) at org.springframework.beans.factory.support.AbstractAutowireCapa bleBeanFactory.app lyBeanPostProcessorsAfterInitialization(AbstractAutowireCapabl eBeanFactory.java: 318) at org.springframework.beans.factory.support.AbstractAutowireCapa bleBeanFactory.ini tializeBean(AbstractAutowireCapableBeanFactory.java:1119) at org.springframework.beans.factory.support.AbstractAutowireCapa bleBeanFactory.cre ateBean(AbstractAutowireCapableBeanFactory.java:431) at org.springframework.beans.factory.support.AbstractBeanFactory$ 1.getObject(Abstra ctBeanFactory.java:254) at org.springframework.beans.factory.support.DefaultSingletonBean Registry.getSingle ton(DefaultSingletonBeanRegistry.java:144) at org.springframework.beans.factory.support.AbstractBeanFactory. getBean(AbstractBe anFactory.java:251) at org.springframework.beans.factory.support.AbstractBeanFactory. getBean(AbstractBe anFactory.java:163) at org.springframework.beans.factory.support.AbstractAutowireCapa bleBeanFactory.aut owireByName(AbstractAutowireCapableBeanFactory.java:862) at org.springframework.beans.factory.support.AbstractAutowireCapa bleBeanFactory.pop ulateBean(AbstractAutowireCapableBeanFactory.java:810) at org.springframework.beans.factory.support.AbstractAutowireCapa bleBeanFactory.aut owireBeanProperties(AbstractAutowireCapableBeanFactory.java:273) at org.springframework.test.AbstractDependencyInjectionSpringCont extTests.injectDep endencies(AbstractDependencyInjectionSpringContextTests.java:179) at
[jira] Resolved: (OPENJPA-208) NoResultException and NonUniqueResultException are not thrown when expected
[ https://issues.apache.org/jira/browse/OPENJPA-208?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Marc Prud'hommeaux resolved OPENJPA-208. Resolution: Fixed Fix Version/s: (was: 0.9.7) 0.9.8 Added NoResultException and NonUniqueResultException to kernel to allow the identification of the case where a unique result was selected by either none or too many were found NoResultException and NonUniqueResultException are not thrown when expected --- Key: OPENJPA-208 URL: https://issues.apache.org/jira/browse/OPENJPA-208 Project: OpenJPA Issue Type: Bug Components: jpa Affects Versions: 0.9.6 Reporter: Marc Prud'hommeaux Assigned To: Marc Prud'hommeaux Fix For: 0.9.8 When calling Query.getSingleResult() on a query that either has no result or multiple results, either a NoResultException and NonUniqueResultException (respectively) should be thrown in accordance with section 3.6.1 of the JPA spec. Instead, we appear to throw a org.apache.openjpa.persistence.InvalidStateException: org.apache.openjpa.persistence.InvalidStateException: The query on candidate type class com.sun.ts.tests.ejb30.persistence.query.apitests.Department with filter select d.name from Department d where d.id 1 was configured to have a unique result, but more than one instance matched the query. at org.apache.openjpa.kernel.QueryImpl.singleResult(QueryImpl.java:1282) at org.apache.openjpa.kernel.QueryImpl.toResult(QueryImpl.java:1207) at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:982) at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:791) at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:761) at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:757) at org.apache.openjpa.kernel.DelegatingQuery.execute(DelegatingQuery.java:514) at org.apache.openjpa.persistence.QueryImpl.execute(QueryImpl.java:225) at org.apache.openjpa.persistence.QueryImpl.getSingleResult(QueryImpl.java:287) -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
Re: Testing an OpenJPA module
Matthieu- Note that there shouldn't be any problem with running against a directory versus a jar (I do it all the time), so there is probably some environment issue. Can you post your persistence.xml? If you write a little main() method that just does: System.out.println(getClass().getResource(/ META-INF/persistence.xml), what does it show? On Apr 9, 2007, at 11:54 AM, Matthieu Riou wrote: Hi, I'm having some difficulties testing a module that uses persistent classes. In that case the classes aren't loaded from a jar but are directly in the classpath and so does the persistence.xml. However I always get No Persistence provider for EntityManager named ode-store. I've tried several things: - placing persistence.xml in a META-INF subdirectory of a directory directly in my classpath - placing persistence.xml in a directory directly in my classpath - renaming my persistence.xml to openjpa.xml and placing its directory directly in my classpath - setting the openjpa.properties system property to the location of the openjpa.xml None of these worked, same error message. I guess I'm missing something but can't spot what, any idea? Thanks! Matthieu
Re: Testing an OpenJPA module
The System.out gives me the correct path to the URL: file:/home/dusty/Dev/Projects/ode/bpel-store/target/classes/META-INF/persistence.xml The corresponding file contains: persistence xmlns=http://java.sun.com/xml/ns/persistence; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; version=1.0 persistence-unit name=ode-store providerorg.apache.openjpa.persistence.PersistenceProviderImpl /provider classorg.apache.ode.store.jpa.ProcessConfDaoImpl/class classorg.apache.ode.store.jpa.ProcessConfPropertyDaoImpl/class classorg.apache.ode.store.jpa.DeploymentUnitDaoImpl/class classorg.apache.ode.store.jpa.VersionTrackerDAOImpl/class /persistence-unit /persistence Thanks, Matthieu On 4/9/07, Marc Prud'hommeaux [EMAIL PROTECTED] wrote: Matthieu- Note that there shouldn't be any problem with running against a directory versus a jar (I do it all the time), so there is probably some environment issue. Can you post your persistence.xml? If you write a little main() method that just does: System.out.println(getClass().getResource(/ META-INF/persistence.xml), what does it show? On Apr 9, 2007, at 11:54 AM, Matthieu Riou wrote: Hi, I'm having some difficulties testing a module that uses persistent classes. In that case the classes aren't loaded from a jar but are directly in the classpath and so does the persistence.xml. However I always get No Persistence provider for EntityManager named ode-store. I've tried several things: - placing persistence.xml in a META-INF subdirectory of a directory directly in my classpath - placing persistence.xml in a directory directly in my classpath - renaming my persistence.xml to openjpa.xml and placing its directory directly in my classpath - setting the openjpa.properties system property to the location of the openjpa.xml None of these worked, same error message. I guess I'm missing something but can't spot what, any idea? Thanks! Matthieu
Re: Testing an OpenJPA module
Matthieu- Hmm ... the persistence.xml file is fine (I just tried it locally). I think the error No Persistence provider for EntityManager named ode- store is coming from javax.persistence.Persistence not being able to load org.apache.openjpa.persistence.PersistenceProviderImpl. Are you sure the OpenJPA jar (and all its required dependencies) are in your CLASSPATH? Can you send us the setting of your classpath? If you write a main() method that just tries new org.apache.openjpa.persistence.PersistenceProviderImpl(), what happens? On Apr 9, 2007, at 12:25 PM, Matthieu Riou wrote: The System.out gives me the correct path to the URL: file:/home/dusty/Dev/Projects/ode/bpel-store/target/classes/META- INF/persistence.xml The corresponding file contains: persistence xmlns=http://java.sun.com/xml/ns/persistence; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; version=1.0 persistence-unit name=ode-store providerorg.apache.openjpa.persistence.PersistenceProviderImpl /provider classorg.apache.ode.store.jpa.ProcessConfDaoImpl/class classorg.apache.ode.store.jpa.ProcessConfPropertyDaoImpl/ class classorg.apache.ode.store.jpa.DeploymentUnitDaoImpl/class classorg.apache.ode.store.jpa.VersionTrackerDAOImpl/class /persistence-unit /persistence Thanks, Matthieu On 4/9/07, Marc Prud'hommeaux [EMAIL PROTECTED] wrote: Matthieu- Note that there shouldn't be any problem with running against a directory versus a jar (I do it all the time), so there is probably some environment issue. Can you post your persistence.xml? If you write a little main() method that just does: System.out.println(getClass().getResource(/ META-INF/persistence.xml), what does it show? On Apr 9, 2007, at 11:54 AM, Matthieu Riou wrote: Hi, I'm having some difficulties testing a module that uses persistent classes. In that case the classes aren't loaded from a jar but are directly in the classpath and so does the persistence.xml. However I always get No Persistence provider for EntityManager named ode-store. I've tried several things: - placing persistence.xml in a META-INF subdirectory of a directory directly in my classpath - placing persistence.xml in a directory directly in my classpath - renaming my persistence.xml to openjpa.xml and placing its directory directly in my classpath - setting the openjpa.properties system property to the location of the openjpa.xml None of these worked, same error message. I guess I'm missing something but can't spot what, any idea? Thanks! Matthieu
RE: PCEnhance
How are you invoking the enhancer? Setting the default log level to TRACE will probably give you quite a bit of data. -Patrick -- Patrick Linskey BEA Systems, Inc. ___ Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it. -Original Message- From: Phill Moran [mailto:[EMAIL PROTECTED] Sent: Monday, April 09, 2007 2:50 PM To: open-jpa-dev@incubator.apache.org Subject: PCEnhance Anyway to get a trace out of a pcEnhance call? Phill Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it.
Re: Testing an OpenJPA module
I thought I had OpenJPA correctly placed but actually it wasn't copied at the right place. Thanks for the hint! Matthieu On 4/9/07, Marc Prud'hommeaux [EMAIL PROTECTED] wrote: Matthieu- Hmm ... the persistence.xml file is fine (I just tried it locally). I think the error No Persistence provider for EntityManager named ode- store is coming from javax.persistence.Persistence not being able to load org.apache.openjpa.persistence.PersistenceProviderImpl. Are you sure the OpenJPA jar (and all its required dependencies) are in your CLASSPATH? Can you send us the setting of your classpath? If you write a main() method that just tries new org.apache.openjpa.persistence.PersistenceProviderImpl(), what happens? On Apr 9, 2007, at 12:25 PM, Matthieu Riou wrote: The System.out gives me the correct path to the URL: file:/home/dusty/Dev/Projects/ode/bpel-store/target/classes/META- INF/persistence.xml The corresponding file contains: persistence xmlns=http://java.sun.com/xml/ns/persistence; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; version=1.0 persistence-unit name=ode-store providerorg.apache.openjpa.persistence.PersistenceProviderImpl /provider classorg.apache.ode.store.jpa.ProcessConfDaoImpl/class classorg.apache.ode.store.jpa.ProcessConfPropertyDaoImpl/ class classorg.apache.ode.store.jpa.DeploymentUnitDaoImpl/class classorg.apache.ode.store.jpa.VersionTrackerDAOImpl/class /persistence-unit /persistence Thanks, Matthieu On 4/9/07, Marc Prud'hommeaux [EMAIL PROTECTED] wrote: Matthieu- Note that there shouldn't be any problem with running against a directory versus a jar (I do it all the time), so there is probably some environment issue. Can you post your persistence.xml? If you write a little main() method that just does: System.out.println(getClass().getResource(/ META-INF/persistence.xml), what does it show? On Apr 9, 2007, at 11:54 AM, Matthieu Riou wrote: Hi, I'm having some difficulties testing a module that uses persistent classes. In that case the classes aren't loaded from a jar but are directly in the classpath and so does the persistence.xml. However I always get No Persistence provider for EntityManager named ode-store. I've tried several things: - placing persistence.xml in a META-INF subdirectory of a directory directly in my classpath - placing persistence.xml in a directory directly in my classpath - renaming my persistence.xml to openjpa.xml and placing its directory directly in my classpath - setting the openjpa.properties system property to the location of the openjpa.xml None of these worked, same error message. I guess I'm missing something but can't spot what, any idea? Thanks! Matthieu
[jira] Commented: (OPENJPA-211) CLONE -java.lang.VerifyError on websphere 6.1 with Spring 2.0.3 and OpenJpa 0.96/0.97
[ https://issues.apache.org/jira/browse/OPENJPA-211?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12487646 ] david zhang commented on OPENJPA-211: - In org.apache.openjpa.kernel.Bootstrap.java, line 117: return (BrokerFactory) meth.invoke(null, new Object[]{ conf }); very curious how it works. The null will return every call back as exception. the first parameter should be a non-null instance, which make sense. Correct me if I'm wrong. CLONE -java.lang.VerifyError on websphere 6.1 with Spring 2.0.3 and OpenJpa 0.96/0.97 - Key: OPENJPA-211 URL: https://issues.apache.org/jira/browse/OPENJPA-211 Project: OpenJPA Issue Type: Bug Components: kernel Affects Versions: 0.9.6 Environment: Using OpenJPA (openjpa-all-0.9.6-incubating.jar) in Rational Developer 7 ( Websphere 6.1 test environment ) connected to DB2 V9.1. OS: WinXP SP2 Reporter: david zhang Priority: Blocker Fix For: 0.9.8 Attachments: applicationContext.xml, mytestdata.jar, persistence.xml Hi, if I use the OpenJPA shipped with Spring 2.0.3, I got the following error when start application: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.VerifyError: class loading constraint violated (class: org/apache/openjpa/kernel/BrokerImpl method: newQueryImpl(Ljava/lang/String;Lorg/apache/openjpa/kernel/StoreQuery;)Lorg/apache/openjpa/kernel/QueryImpl;) at pc: 0 Caused by: java.lang.VerifyError: class loading constraint violated (class: org/apache/openjpa/kernel/BrokerImpl method: newQueryImpl(Ljava/lang/String;Lorg/apache/openjpa/kernel/StoreQuery;)Lorg/apache/openjpa/kernel/QueryImpl;) at pc: 0 at java.lang.J9VMInternals.verifyImpl(Native Method) at java.lang.J9VMInternals.verify(J9VMInternals.java:59) at java.lang.J9VMInternals.initialize(J9VMInternals.java:120) at java.lang.Class.forNameImpl(Native Method) at java.lang.Class.forName(Class.java:131) at org.apache.openjpa.conf.OpenJPAConfigurationImpl.class$(OpenJPAConfigurationImpl.java:65) at org.apache.openjpa.conf.OpenJPAConfigurationImpl.init(OpenJPAConfigurationImpl.java:182) at org.apache.openjpa.conf.OpenJPAConfigurationImpl.init(OpenJPAConfigurationImpl.java:154) at org.apache.openjpa.conf.OpenJPAConfigurationImpl.init(OpenJPAConfigurationImpl.java:145) at org.apache.openjpa.persistence.PersistenceProviderImpl$ClassTransformerImpl.init(PersistenceProviderImpl.java:114) at org.apache.openjpa.persistence.PersistenceProviderImpl$ClassTransformerImpl.init(PersistenceProviderImpl.java:106) at org.apache.openjpa.persistence.PersistenceProviderImpl.createContainerEntityManagerFactory(PersistenceProviderImpl.java:92) at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:214) at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:251) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1143) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1110) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:431) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:254) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:144) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:251) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:163) at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:244) at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:233) at org.springframework.beans.factory.BeanFactoryUtils.beansOfTypeIncludingAncestors(BeanFactoryUtils.java:205) at org.springframework.beans.factory.BeanFactoryUtils.beanOfTypeIncludingAncestors(BeanFactoryUtils.java:292) at
[jira] Commented: (OPENJPA-211) CLONE -java.lang.VerifyError on websphere 6.1 with Spring 2.0.3 and OpenJpa 0.96/0.97
[ https://issues.apache.org/jira/browse/OPENJPA-211?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12487650 ] Patrick Linskey commented on OPENJPA-211: - Provided that meth is a static method, this method should run with no problem. The code here is bootstrapping code to create new BrokerFactories; one (woefully-underdocumented) part of the BrokerFactory contract is that implementations must have static newInstance() and getInstance() methods. CLONE -java.lang.VerifyError on websphere 6.1 with Spring 2.0.3 and OpenJpa 0.96/0.97 - Key: OPENJPA-211 URL: https://issues.apache.org/jira/browse/OPENJPA-211 Project: OpenJPA Issue Type: Bug Components: kernel Affects Versions: 0.9.6 Environment: Using OpenJPA (openjpa-all-0.9.6-incubating.jar) in Rational Developer 7 ( Websphere 6.1 test environment ) connected to DB2 V9.1. OS: WinXP SP2 Reporter: david zhang Priority: Blocker Fix For: 0.9.8 Attachments: applicationContext.xml, mytestdata.jar, persistence.xml Hi, if I use the OpenJPA shipped with Spring 2.0.3, I got the following error when start application: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.VerifyError: class loading constraint violated (class: org/apache/openjpa/kernel/BrokerImpl method: newQueryImpl(Ljava/lang/String;Lorg/apache/openjpa/kernel/StoreQuery;)Lorg/apache/openjpa/kernel/QueryImpl;) at pc: 0 Caused by: java.lang.VerifyError: class loading constraint violated (class: org/apache/openjpa/kernel/BrokerImpl method: newQueryImpl(Ljava/lang/String;Lorg/apache/openjpa/kernel/StoreQuery;)Lorg/apache/openjpa/kernel/QueryImpl;) at pc: 0 at java.lang.J9VMInternals.verifyImpl(Native Method) at java.lang.J9VMInternals.verify(J9VMInternals.java:59) at java.lang.J9VMInternals.initialize(J9VMInternals.java:120) at java.lang.Class.forNameImpl(Native Method) at java.lang.Class.forName(Class.java:131) at org.apache.openjpa.conf.OpenJPAConfigurationImpl.class$(OpenJPAConfigurationImpl.java:65) at org.apache.openjpa.conf.OpenJPAConfigurationImpl.init(OpenJPAConfigurationImpl.java:182) at org.apache.openjpa.conf.OpenJPAConfigurationImpl.init(OpenJPAConfigurationImpl.java:154) at org.apache.openjpa.conf.OpenJPAConfigurationImpl.init(OpenJPAConfigurationImpl.java:145) at org.apache.openjpa.persistence.PersistenceProviderImpl$ClassTransformerImpl.init(PersistenceProviderImpl.java:114) at org.apache.openjpa.persistence.PersistenceProviderImpl$ClassTransformerImpl.init(PersistenceProviderImpl.java:106) at org.apache.openjpa.persistence.PersistenceProviderImpl.createContainerEntityManagerFactory(PersistenceProviderImpl.java:92) at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:214) at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:251) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1143) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1110) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:431) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:254) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:144) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:251) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:163) at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:244) at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:233) at org.springframework.beans.factory.BeanFactoryUtils.beansOfTypeIncludingAncestors(BeanFactoryUtils.java:205) at org.springframework.beans.factory.BeanFactoryUtils.beanOfTypeIncludingAncestors(BeanFactoryUtils.java:292) at
[jira] Commented: (OPENJPA-211) CLONE -java.lang.VerifyError on websphere 6.1 with Spring 2.0.3 and OpenJpa 0.96/0.97
[ https://issues.apache.org/jira/browse/OPENJPA-211?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12487651 ] david zhang commented on OPENJPA-211: - Sorry, forget my previous comment. Yes, the first parameter can be null if it is a static method. But I still get the same exception. CLONE -java.lang.VerifyError on websphere 6.1 with Spring 2.0.3 and OpenJpa 0.96/0.97 - Key: OPENJPA-211 URL: https://issues.apache.org/jira/browse/OPENJPA-211 Project: OpenJPA Issue Type: Bug Components: kernel Affects Versions: 0.9.6 Environment: Using OpenJPA (openjpa-all-0.9.6-incubating.jar) in Rational Developer 7 ( Websphere 6.1 test environment ) connected to DB2 V9.1. OS: WinXP SP2 Reporter: david zhang Priority: Blocker Fix For: 0.9.8 Attachments: applicationContext.xml, mytestdata.jar, persistence.xml Hi, if I use the OpenJPA shipped with Spring 2.0.3, I got the following error when start application: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.VerifyError: class loading constraint violated (class: org/apache/openjpa/kernel/BrokerImpl method: newQueryImpl(Ljava/lang/String;Lorg/apache/openjpa/kernel/StoreQuery;)Lorg/apache/openjpa/kernel/QueryImpl;) at pc: 0 Caused by: java.lang.VerifyError: class loading constraint violated (class: org/apache/openjpa/kernel/BrokerImpl method: newQueryImpl(Ljava/lang/String;Lorg/apache/openjpa/kernel/StoreQuery;)Lorg/apache/openjpa/kernel/QueryImpl;) at pc: 0 at java.lang.J9VMInternals.verifyImpl(Native Method) at java.lang.J9VMInternals.verify(J9VMInternals.java:59) at java.lang.J9VMInternals.initialize(J9VMInternals.java:120) at java.lang.Class.forNameImpl(Native Method) at java.lang.Class.forName(Class.java:131) at org.apache.openjpa.conf.OpenJPAConfigurationImpl.class$(OpenJPAConfigurationImpl.java:65) at org.apache.openjpa.conf.OpenJPAConfigurationImpl.init(OpenJPAConfigurationImpl.java:182) at org.apache.openjpa.conf.OpenJPAConfigurationImpl.init(OpenJPAConfigurationImpl.java:154) at org.apache.openjpa.conf.OpenJPAConfigurationImpl.init(OpenJPAConfigurationImpl.java:145) at org.apache.openjpa.persistence.PersistenceProviderImpl$ClassTransformerImpl.init(PersistenceProviderImpl.java:114) at org.apache.openjpa.persistence.PersistenceProviderImpl$ClassTransformerImpl.init(PersistenceProviderImpl.java:106) at org.apache.openjpa.persistence.PersistenceProviderImpl.createContainerEntityManagerFactory(PersistenceProviderImpl.java:92) at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:214) at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:251) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1143) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1110) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:431) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:254) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:144) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:251) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:163) at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:244) at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:233) at org.springframework.beans.factory.BeanFactoryUtils.beansOfTypeIncludingAncestors(BeanFactoryUtils.java:205) at org.springframework.beans.factory.BeanFactoryUtils.beanOfTypeIncludingAncestors(BeanFactoryUtils.java:292) at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.findDefaultEntityManagerFactory(PersistenceAnnotationBeanPostProcessor.java:411) at
[jira] Commented: (OPENJPA-211) CLONE -java.lang.VerifyError on websphere 6.1 with Spring 2.0.3 and OpenJpa 0.96/0.97
[ https://issues.apache.org/jira/browse/OPENJPA-211?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12487664 ] david zhang commented on OPENJPA-211: - I've posted my config files. I'm using JTA, why I get a JDBCBrokerFactory? Is there some config I can change to other working BrokerFactory? CLONE -java.lang.VerifyError on websphere 6.1 with Spring 2.0.3 and OpenJpa 0.96/0.97 - Key: OPENJPA-211 URL: https://issues.apache.org/jira/browse/OPENJPA-211 Project: OpenJPA Issue Type: Bug Components: kernel Affects Versions: 0.9.6 Environment: Using OpenJPA (openjpa-all-0.9.6-incubating.jar) in Rational Developer 7 ( Websphere 6.1 test environment ) connected to DB2 V9.1. OS: WinXP SP2 Reporter: david zhang Priority: Blocker Fix For: 0.9.8 Attachments: applicationContext.xml, mytestdata.jar, persistence.xml Hi, if I use the OpenJPA shipped with Spring 2.0.3, I got the following error when start application: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.VerifyError: class loading constraint violated (class: org/apache/openjpa/kernel/BrokerImpl method: newQueryImpl(Ljava/lang/String;Lorg/apache/openjpa/kernel/StoreQuery;)Lorg/apache/openjpa/kernel/QueryImpl;) at pc: 0 Caused by: java.lang.VerifyError: class loading constraint violated (class: org/apache/openjpa/kernel/BrokerImpl method: newQueryImpl(Ljava/lang/String;Lorg/apache/openjpa/kernel/StoreQuery;)Lorg/apache/openjpa/kernel/QueryImpl;) at pc: 0 at java.lang.J9VMInternals.verifyImpl(Native Method) at java.lang.J9VMInternals.verify(J9VMInternals.java:59) at java.lang.J9VMInternals.initialize(J9VMInternals.java:120) at java.lang.Class.forNameImpl(Native Method) at java.lang.Class.forName(Class.java:131) at org.apache.openjpa.conf.OpenJPAConfigurationImpl.class$(OpenJPAConfigurationImpl.java:65) at org.apache.openjpa.conf.OpenJPAConfigurationImpl.init(OpenJPAConfigurationImpl.java:182) at org.apache.openjpa.conf.OpenJPAConfigurationImpl.init(OpenJPAConfigurationImpl.java:154) at org.apache.openjpa.conf.OpenJPAConfigurationImpl.init(OpenJPAConfigurationImpl.java:145) at org.apache.openjpa.persistence.PersistenceProviderImpl$ClassTransformerImpl.init(PersistenceProviderImpl.java:114) at org.apache.openjpa.persistence.PersistenceProviderImpl$ClassTransformerImpl.init(PersistenceProviderImpl.java:106) at org.apache.openjpa.persistence.PersistenceProviderImpl.createContainerEntityManagerFactory(PersistenceProviderImpl.java:92) at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:214) at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:251) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1143) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1110) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:431) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:254) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:144) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:251) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:163) at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:244) at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:233) at org.springframework.beans.factory.BeanFactoryUtils.beansOfTypeIncludingAncestors(BeanFactoryUtils.java:205) at org.springframework.beans.factory.BeanFactoryUtils.beanOfTypeIncludingAncestors(BeanFactoryUtils.java:292) at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.findDefaultEntityManagerFactory(PersistenceAnnotationBeanPostProcessor.java:411) at
[jira] Commented: (OPENJPA-211) CLONE -java.lang.VerifyError on websphere 6.1 with Spring 2.0.3 and OpenJpa 0.96/0.97
[ https://issues.apache.org/jira/browse/OPENJPA-211?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12487677 ] david zhang commented on OPENJPA-211: - Resolved referring http://issues.apache.org/jira/browse/OPENJPA-40. CLONE -java.lang.VerifyError on websphere 6.1 with Spring 2.0.3 and OpenJpa 0.96/0.97 - Key: OPENJPA-211 URL: https://issues.apache.org/jira/browse/OPENJPA-211 Project: OpenJPA Issue Type: Bug Components: kernel Affects Versions: 0.9.6 Environment: Using OpenJPA (openjpa-all-0.9.6-incubating.jar) in Rational Developer 7 ( Websphere 6.1 test environment ) connected to DB2 V9.1. OS: WinXP SP2 Reporter: david zhang Priority: Blocker Fix For: 0.9.8 Attachments: applicationContext.xml, mytestdata.jar, persistence.xml Hi, if I use the OpenJPA shipped with Spring 2.0.3, I got the following error when start application: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.VerifyError: class loading constraint violated (class: org/apache/openjpa/kernel/BrokerImpl method: newQueryImpl(Ljava/lang/String;Lorg/apache/openjpa/kernel/StoreQuery;)Lorg/apache/openjpa/kernel/QueryImpl;) at pc: 0 Caused by: java.lang.VerifyError: class loading constraint violated (class: org/apache/openjpa/kernel/BrokerImpl method: newQueryImpl(Ljava/lang/String;Lorg/apache/openjpa/kernel/StoreQuery;)Lorg/apache/openjpa/kernel/QueryImpl;) at pc: 0 at java.lang.J9VMInternals.verifyImpl(Native Method) at java.lang.J9VMInternals.verify(J9VMInternals.java:59) at java.lang.J9VMInternals.initialize(J9VMInternals.java:120) at java.lang.Class.forNameImpl(Native Method) at java.lang.Class.forName(Class.java:131) at org.apache.openjpa.conf.OpenJPAConfigurationImpl.class$(OpenJPAConfigurationImpl.java:65) at org.apache.openjpa.conf.OpenJPAConfigurationImpl.init(OpenJPAConfigurationImpl.java:182) at org.apache.openjpa.conf.OpenJPAConfigurationImpl.init(OpenJPAConfigurationImpl.java:154) at org.apache.openjpa.conf.OpenJPAConfigurationImpl.init(OpenJPAConfigurationImpl.java:145) at org.apache.openjpa.persistence.PersistenceProviderImpl$ClassTransformerImpl.init(PersistenceProviderImpl.java:114) at org.apache.openjpa.persistence.PersistenceProviderImpl$ClassTransformerImpl.init(PersistenceProviderImpl.java:106) at org.apache.openjpa.persistence.PersistenceProviderImpl.createContainerEntityManagerFactory(PersistenceProviderImpl.java:92) at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:214) at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:251) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1143) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1110) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:431) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:254) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:144) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:251) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:163) at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:244) at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:233) at org.springframework.beans.factory.BeanFactoryUtils.beansOfTypeIncludingAncestors(BeanFactoryUtils.java:205) at org.springframework.beans.factory.BeanFactoryUtils.beanOfTypeIncludingAncestors(BeanFactoryUtils.java:292) at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.findDefaultEntityManagerFactory(PersistenceAnnotationBeanPostProcessor.java:411) at