NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

NB 6.5, EclipseLink, PersistenceException, and JAXB 2.1

 
Post new topic   Reply to topic    NetBeans Forums -> Java EE Users
View previous topic :: View next topic  
Author Message
jxt
Posted via mailing list.





PostPosted: Thu Dec 18, 2008 7:21 pm    Post subject: NB 6.5, EclipseLink, PersistenceException, and JAXB 2.1 Reply with quote

After a several month break, I've returned to a web application previously
developed in NB 6.1 (originally in NB 5.5, or maybe even earlier). When
opened in NB 6.5 I notice that the Persistence Library has changed from
TopLink to EclipseLink. That's fine since I believe that the latter is a
superset of the former.

Worse, when I deploy the app and connect to it, thus causing the persistence
methods to be hit, I now get a PersistenceException when calling
Persistence.createEntityManagerFactory (). (This is deployed on Tomcat and
uses plain old create-yourself persistence entities, no EJBs.) The exception
is as follows:

javax.persistence.PersistenceException: No Persistence provider for
EntityManager named
OLSPersistenceUnit: Provider named
oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider threw
unexpected exception at create EntityManagerFactory:
java.lang.NoClassDefFoundError
java.lang.NoClassDefFoundError: Lnet/opengis/xls/ObjectFactory;

Is that an expected exception from EclipseLink? Switching to TopLink doesn't
help. And switching the persistence.xml file to explicitly point to the
EclipseLink provider at org.eclipse.persistence.jpa.PersistenceProvider
doesn't help either.

Notice that the PersistenceException refers to a NoClassDefFoundError. Well,
that class, net.opengis.xls.ObjectFactory, really is there in my library
list and in the WAR file in the dist directory. Any idea why it cannot be
seen?

One other thing, that "missing" class is one of many in a classes folder
generated by the JAXB schema compiler, back in JAXB 2.0 days. NB 6.5 now has
JAXB 2.1 instead of 2.0. Could that difference lead to NoClassDefFoundError
problems?

Or any other ideas on what's going wrong and how to fix it?

Thanks for any help anyone can offer. If the suggestion is to recompile the
XML schema with JAXB 2.1, can someone point me to instructions on how to do
that? It's been so very long ago, using JWSDP 2.0 tools, that I no longer
remember the details and the build.xml file I used way back then isn't
working with my current version of ant. Or maybe I should just try digging
up an old JAXB 2.0 set of jars and use them instead???

Here's a complete stacktrace:

Dec 18 9:39:15.400 (12) F-Controller.init: creating JPA entity manager
factory for persistence unit OLSPersistenceUnit
Dec 18, 2008 9:39:16 AM org.apache.catalina.core.ApplicationContext log
SEVERE: StandardWrapper.Throwable
javax.persistence.PersistenceException: No Persistence provider for
EntityManager named OLSPersistenceUnit: Provider named
oracle.toplink.essentials.PersistenceProvider threw unexpected exception at
create EntityManagerFactory:
java.lang.NoClassDefFoundError
java.lang.NoClassDefFoundError: Lnet/opengis/xls/ObjectFactory;
at java.lang.Class.getDeclaredFields0(Native Method)
at java.lang.Class.privateGetDeclaredFields(Class.java:2291)
at java.lang.Class.getDeclaredFields(Class.java:1743)
at
oracle.toplink.essentials.internal.security.PrivilegedAccessHelper.getDeclaredFields
(PrivilegedAccessHelper.java:204)
at
oracle.toplink.essentials.internal.ejb.cmp3.metadata.MetadataHelper.getFields(MetadataHelper.java:444)
at
oracle.toplink.essentials.internal.ejb.cmp3.metadata.MetadataDescriptor.usesPropertyAccess(MetadataDescriptor.java:1081)
at
oracle.toplink.essentials.internal.ejb.cmp3.metadata.accessors.ClassAccessor.processAccessors(ClassAccessor.java:564)
at
oracle.toplink.essentials.internal.ejb.cmp3.metadata.accessors.ClassAccessor.process(ClassAccessor.java:498)
at
oracle.toplink.essentials.internal.ejb.cmp3.metadata.MetadataProcessor.processAnnotations(MetadataProcessor.java:240)
at
oracle.toplink.essentials.ejb.cmp3.persistence.PersistenceUnitProcessor.processORMetadata(PersistenceUnitProcessor.java:370)
at
oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl.java:607)
at
oracle.toplink.essentials.internal.ejb.cmp3.JavaSECMPInitializer.callPredeploy(JavaSECMPInitializer.java:171)
at
oracle.toplink.essentials.internal.ejb.cmp3.JavaSECMPInitializer.initPersistenceUnits(JavaSECMPInitializer.java:239)
at
oracle.toplink.essentials.internal.ejb.cmp3.JavaSECMPInitializer.initialize(JavaSECMPInitializer.java:255)
at
oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider.createEntityManagerFactory(EntityManagerFactoryProvider.java:155)
at
javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:110)
at
javax.peristence.Persistence.createEntityManagerFactory(Persistence.java:83)

[Next line is the only place that *my* code appears. It's where I call
Persistence.createEntityManagerFactory()]

at
gov.sensornet.olstracker.controller.Controller.init(Controller.java:236)

[Here resumes the rest of the stacktrace, into Tomcat stuff]

at javax.servlet.GenericServlet.init(GenericServlet.java:212)
at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1172)
at
org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:808)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:129)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
at org.apache.coyote.http11.Http11Protocol
$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint
$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)

Caused by: java.lang.ClassNotFoundException: net.opengis.xls.ObjectFactory
at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387)
at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:
320)
... 31 more


Then it repeats itself a few times.
--
View this message in context: http://www.nabble.com/NB-6.5%2C-EclipseLink%2C-PersistenceException%2C-and-JAXB-2.1-tp21079233p21079233.html
Sent from the Netbeans - J2EE mailing list archive at Nabble.com.
Back to top
Rochelle Raccah
Posted via mailing list.





PostPosted: Fri Dec 19, 2008 1:10 am    Post subject: NB 6.5, EclipseLink, PersistenceException, and JAXB 2.1 Reply with quote

Hello,

Sorry you're running into trouble. I've asked a few people on the
persistence team on your behalf and here's what we came up with:

1) Your stack trace indicates you are (still) using TopLink, not
EclipseLink, but it is best to explicitly specify that in the provider
anyway.

2) Check the classpath of your project and make sure jar which contains
the class net/opengis/xls/ObjectFactory is there. The error you are
getting seems to say that your classpath is not quite complete.


Hope that helps.
Rochelle


jxt wrote:
Quote:
After a several month break, I've returned to a web application previously
developed in NB 6.1 (originally in NB 5.5, or maybe even earlier). When
opened in NB 6.5 I notice that the Persistence Library has changed from
TopLink to EclipseLink. That's fine since I believe that the latter is a
superset of the former.

Worse, when I deploy the app and connect to it, thus causing the persistence
methods to be hit, I now get a PersistenceException when calling
Persistence.createEntityManagerFactory (). (This is deployed on Tomcat and
uses plain old create-yourself persistence entities, no EJBs.) The exception
is as follows:

javax.persistence.PersistenceException: No Persistence provider for
EntityManager named
OLSPersistenceUnit: Provider named
oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider threw
unexpected exception at create EntityManagerFactory:
java.lang.NoClassDefFoundError
java.lang.NoClassDefFoundError: Lnet/opengis/xls/ObjectFactory;

Is that an expected exception from EclipseLink? Switching to TopLink doesn't
help. And switching the persistence.xml file to explicitly point to the
EclipseLink provider at org.eclipse.persistence.jpa.PersistenceProvider
doesn't help either.

Notice that the PersistenceException refers to a NoClassDefFoundError. Well,
that class, net.opengis.xls.ObjectFactory, really is there in my library
list and in the WAR file in the dist directory. Any idea why it cannot be
seen?

One other thing, that "missing" class is one of many in a classes folder
generated by the JAXB schema compiler, back in JAXB 2.0 days. NB 6.5 now has
JAXB 2.1 instead of 2.0. Could that difference lead to NoClassDefFoundError
problems?

Or any other ideas on what's going wrong and how to fix it?

Thanks for any help anyone can offer. If the suggestion is to recompile the
XML schema with JAXB 2.1, can someone point me to instructions on how to do
that? It's been so very long ago, using JWSDP 2.0 tools, that I no longer
remember the details and the build.xml file I used way back then isn't
working with my current version of ant. Or maybe I should just try digging
up an old JAXB 2.0 set of jars and use them instead???

Here's a complete stacktrace:

Dec 18 9:39:15.400 (12) F-Controller.init: creating JPA entity manager
factory for persistence unit OLSPersistenceUnit
Dec 18, 2008 9:39:16 AM org.apache.catalina.core.ApplicationContext log
SEVERE: StandardWrapper.Throwable
javax.persistence.PersistenceException: No Persistence provider for
EntityManager named OLSPersistenceUnit: Provider named
oracle.toplink.essentials.PersistenceProvider threw unexpected exception at
create EntityManagerFactory:
java.lang.NoClassDefFoundError
java.lang.NoClassDefFoundError: Lnet/opengis/xls/ObjectFactory;
at java.lang.Class.getDeclaredFields0(Native Method)
at java.lang.Class.privateGetDeclaredFields(Class.java:2291)
at java.lang.Class.getDeclaredFields(Class.java:1743)
at
oracle.toplink.essentials.internal.security.PrivilegedAccessHelper.getDeclaredFields
(PrivilegedAccessHelper.java:204)
at
oracle.toplink.essentials.internal.ejb.cmp3.metadata.MetadataHelper.getFields(MetadataHelper.java:444)
at
oracle.toplink.essentials.internal.ejb.cmp3.metadata.MetadataDescriptor.usesPropertyAccess(MetadataDescriptor.java:1081)
at
oracle.toplink.essentials.internal.ejb.cmp3.metadata.accessors.ClassAccessor.processAccessors(ClassAccessor.java:564)
at
oracle.toplink.essentials.internal.ejb.cmp3.metadata.accessors.ClassAccessor.process(ClassAccessor.java:498)
at
oracle.toplink.essentials.internal.ejb.cmp3.metadata.MetadataProcessor.processAnnotations(MetadataProcessor.java:240)
at
oracle.toplink.essentials.ejb.cmp3.persistence.PersistenceUnitProcessor.processORMetadata(PersistenceUnitProcessor.java:370)
at
oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl.java:607)
at
oracle.toplink.essentials.internal.ejb.cmp3.JavaSECMPInitializer.callPredeploy(JavaSECMPInitializer.java:171)
at
oracle.toplink.essentials.internal.ejb.cmp3.JavaSECMPInitializer.initPersistenceUnits(JavaSECMPInitializer.java:239)
at
oracle.toplink.essentials.internal.ejb.cmp3.JavaSECMPInitializer.initialize(JavaSECMPInitializer.java:255)
at
oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider.createEntityManagerFactory(EntityManagerFactoryProvider.java:155)
at
javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:110)
at
javax.peristence.Persistence.createEntityManagerFactory(Persistence.java:83)

[Next line is the only place that *my* code appears. It's where I call
Persistence.createEntityManagerFactory()]

at
gov.sensornet.olstracker.controller.Controller.init(Controller.java:236)

[Here resumes the rest of the stacktrace, into Tomcat stuff]

at javax.servlet.GenericServlet.init(GenericServlet.java:212)
at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1172)
at
org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:808)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:129)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
at org.apache.coyote.http11.Http11Protocol
$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint
$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)

Caused by: java.lang.ClassNotFoundException: net.opengis.xls.ObjectFactory
at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387)
at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:
320)
... 31 more


Then it repeats itself a few times.
Back to top
jxt
Posted via mailing list.





PostPosted: Fri Dec 19, 2008 2:37 pm    Post subject: NB 6.5, EclipseLink, PersistenceException, and JAXB 2.1 Reply with quote

Rochelle Raccah wrote:
Quote:

Sorry you're running into trouble. I've asked a few people on the
persistence team on your behalf and here's what we came up with:

1) Your stack trace indicates you are (still) using TopLink, not
EclipseLink, but it is best to explicitly specify that in the provider
anyway.

2) Check the classpath of your project and make sure jar which contains
the class net/opengis/xls/ObjectFactory is there. The error you are
getting seems to say that your classpath is not quite complete.


First, thanks for asking around for me. It wasn't really clear the best
place to post this message.

Regarding the classpath, I've checked and double checked. The library *is*
in my libraries list and is also in the WAR file in dist. I can drill down
into both and find that the net.opengis.xls.ObjectFactory is really there,
along with many other classes, all "compiled" from an XML schema using the
xjc compiler in JAXB 2.0 (not 2.1). I've played around with replacing the
JAXB 2.1 libraries in NB6.5 with my old JAXB 2.0 libraries to no avail.

Now, the TopLink vs EclipseLink issue. I've removed all the EclipseLink
libraries, which seemed to get put there automatically when I opened this
project with NB 6.5, and made sure that only the TopLink libraries were in
my project. I've also double checked persistence.xml to make sure that I'm
using TopLink instead of EclipseLink.

Same problem. NoClassDefFoundError. Then I tried using ONLY EclipseLink
everywhere and JAXB 2.1. No luck.

In desperation, I quit NB 6.5 and went back to 6.1. Had to revert back to
the JAXB 2.0 libraries and TopLink, but FINALLY IT WORKED!!!! No change in
source code anywhere, just getting the libraries right.

Next step, quit NB 6.1 and open the *same* project in 6.5. IT DOESN'T WORK!
Same NoClassDefFoundError as before. In 6.5 I'm now using ONLY the TopLink
and JAXB 2.0 libraries. So something is wrong somehow in 6.5. The stacktrace
starts out the same:

SEVERE: StandardWrapper.Throwable
javax.persistence.PersistenceException: No Persistence provider for
EntityManager named OLSPersistenceUnitMySQL: Provider named
oracle.toplink.essentials.PersistenceProvider threw unexpected exception at
create EntityManagerFactory:
java.lang.NoClassDefFoundError
java.lang.NoClassDefFoundError: Lnet/opengis/xls/ObjectFactory;
at java.lang.Class.getDeclaredFields0(Native Method)

and runs down to the same link in my code where I call
Persistence.createEntityManagerFactory().

Any more ideas? It looks like I simply cannot build and run this project in
6.5, but I don't want going back to 6.1 to be the answer. Thanks.
--
View this message in context: http://www.nabble.com/NB-6.5%2C-EclipseLink%2C-PersistenceException%2C-and-JAXB-2.1-tp21079233p21092345.html
Sent from the Netbeans - J2EE mailing list archive at Nabble.com.
Back to top
Wade Chandler
Posted via mailing list.





PostPosted: Fri Dec 19, 2008 3:30 pm    Post subject: NB 6.5, EclipseLink, PersistenceException, and JAXB 2.1 Reply with quote

----- Original Message ----

Quote:
From: jxt <address-removed>
To: address-removed
Sent: Friday, December 19, 2008 9:37:12 AM
Subject: Re: [nbj2ee] NB 6.5, EclipseLink, PersistenceException, and JAXB 2.1



Rochelle Raccah wrote:
Quote:

Sorry you're running into trouble. I've asked a few people on the
persistence team on your behalf and here's what we came up with:

1) Your stack trace indicates you are (still) using TopLink, not
EclipseLink, but it is best to explicitly specify that in the provider
anyway.

2) Check the classpath of your project and make sure jar which contains
the class net/opengis/xls/ObjectFactory is there. The error you are
getting seems to say that your classpath is not quite complete.


First, thanks for asking around for me. It wasn't really clear the best
place to post this message.

Regarding the classpath, I've checked and double checked. The library *is*
in my libraries list and is also in the WAR file in dist. I can drill down
into both and find that the net.opengis.xls.ObjectFactory is really there,
along with many other classes, all "compiled" from an XML schema using the
xjc compiler in JAXB 2.0 (not 2.1). I've played around with replacing the
JAXB 2.1 libraries in NB6.5 with my old JAXB 2.0 libraries to no avail.

Now, the TopLink vs EclipseLink issue. I've removed all the EclipseLink
libraries, which seemed to get put there automatically when I opened this
project with NB 6.5, and made sure that only the TopLink libraries were in
my project. I've also double checked persistence.xml to make sure that I'm
using TopLink instead of EclipseLink.

Same problem. NoClassDefFoundError. Then I tried using ONLY EclipseLink
everywhere and JAXB 2.1. No luck.

In desperation, I quit NB 6.5 and went back to 6.1. Had to revert back to
the JAXB 2.0 libraries and TopLink, but FINALLY IT WORKED!!!! No change in
source code anywhere, just getting the libraries right.

Next step, quit NB 6.1 and open the *same* project in 6.5. IT DOESN'T WORK!
Same NoClassDefFoundError as before. In 6.5 I'm now using ONLY the TopLink
and JAXB 2.0 libraries. So something is wrong somehow in 6.5. The stacktrace
starts out the same:

SEVERE: StandardWrapper.Throwable
javax.persistence.PersistenceException: No Persistence provider for
EntityManager named OLSPersistenceUnitMySQL: Provider named
oracle.toplink.essentials.PersistenceProvider threw unexpected exception at
create EntityManagerFactory:
java.lang.NoClassDefFoundError
java.lang.NoClassDefFoundError: Lnet/opengis/xls/ObjectFactory;
at java.lang.Class.getDeclaredFields0(Native Method)

and runs down to the same link in my code where I call
Persistence.createEntityManagerFactory().

Any more ideas? It looks like I simply cannot build and run this project in
6.5, but I don't want going back to 6.1 to be the answer. Thanks.

We may not be able to find the cause from the top down. Maybe an easier way to find out what is wrong to build the WAR in both. Create two directories in some directory some where named old and new or 6.1 and 6.5. Expand the 6.1in the 6.1/old and the 6.5 in the 6.5/new. Then get or google and get kdiff3. With it you can perform a diff on the directory. What you'll be looking for is any missing files or folders etc in the WARs. Too, you can directly compare all the WEB-INF/*.xml,*.properites, etc and also any META-INF/*.xml,*.properties. Failing to find an anwser there you can try to expand in place under those directories any of your specific JARs which get created at build time. Something has to be different at runtime, thus WAR files, when talking 6.5 versus 6.1 if you are using the same libraries.

Another thing to try possibly, is that 6.5 and 6.1 have the ability to copy libraries to the project folder. In 6.1, if you haven't already, turn this on. Then, all the libraries from 6.1 will be available in 6.5. Now, that won't upgrade them to the 6.5 versions when you open it in 6.5, but at least you'll have the same libraries etc. Anyways, for that maybe create a copy of your project. But first, I would try diffing my build artifacts.

Wade



==================
Wade Chandler, CCE
Software Engineer and Developer, Certified Forensic Computer Examiner, NetBeans Dream Team Member, and NetBeans Board Member
http://www.certified-computer-examiner.com
http://wiki.netbeans.org/wiki/view/NetBeansDreamTeam
http://www.netbeans.org
Back to top
jxt
Posted via mailing list.





PostPosted: Fri Dec 19, 2008 9:18 pm    Post subject: NB 6.5, EclipseLink, PersistenceException, and JAXB 2.1 Reply with quote

Wade Chandler wrote:
Quote:

We may not be able to find the cause from the top down. Maybe an easier
way to find out what is wrong to build the WAR in both. Create two
directories in some directory some where named old and new or 6.1 and 6.5.
Expand the 6.1in the 6.1/old and the 6.5 in the 6.5/new. Then get or
google and get kdiff3. With it you can perform a diff on the directory.


Ahhh... finally shedding some light on this. The expanded WARs are *almost*
the same except for a neweer version of the MySQL connector and a slight
difference in the main entry point class file (the PLUS... a different
location for the net.opengis.xls.* class files. In the 6.1 version, those
files appear in the WEB-INF/classes/net/opengis/xls directory, but in the
6.5 build, they appear in the WEB-INF/lib/net/opengis/xls directory.

What now?

--
View this message in context: http://www.nabble.com/NB-6.5%2C-EclipseLink%2C-PersistenceException%2C-and-JAXB-2.1-tp21079233p21098496.html
Sent from the Netbeans - J2EE mailing list archive at Nabble.com.
Back to top
Rochelle Raccah
Posted via mailing list.





PostPosted: Fri Dec 19, 2008 10:30 pm    Post subject: NB 6.5, EclipseLink, PersistenceException, and JAXB 2.1 Reply with quote

If you have the same project resulting in 2 different war structures b/w
NB 6.1 and 6.5, I would suggest filing a nb bug with the details.

Rochelle

jxt wrote:
Quote:

Wade Chandler wrote:
Quote:
We may not be able to find the cause from the top down. Maybe an easier
way to find out what is wrong to build the WAR in both. Create two
directories in some directory some where named old and new or 6.1 and 6.5.
Expand the 6.1in the 6.1/old and the 6.5 in the 6.5/new. Then get or
google and get kdiff3. With it you can perform a diff on the directory.


Ahhh... finally shedding some light on this. The expanded WARs are *almost*
the same except for a neweer version of the MySQL connector and a slight
difference in the main entry point class file (the PLUS... a different
location for the net.opengis.xls.* class files. In the 6.1 version, those
files appear in the WEB-INF/classes/net/opengis/xls directory, but in the
6.5 build, they appear in the WEB-INF/lib/net/opengis/xls directory.

What now?
Back to top
Wade Chandler
Posted via mailing list.





PostPosted: Sat Dec 20, 2008 12:37 am    Post subject: NB 6.5, EclipseLink, PersistenceException, and JAXB 2.1 Reply with quote

----- Original Message ----

Quote:
From: jxt <address-removed>
To: address-removed
Sent: Friday, December 19, 2008 4:18:08 PM
Subject: Re: [nbj2ee] NB 6.5, EclipseLink, PersistenceException, and JAXB 2.1



Wade Chandler wrote:
Quote:

We may not be able to find the cause from the top down. Maybe an easier
way to find out what is wrong to build the WAR in both. Create two
directories in some directory some where named old and new or 6.1 and 6.5.
Expand the 6.1in the 6.1/old and the 6.5 in the 6.5/new. Then get or
google and get kdiff3. With it you can perform a diff on the directory.


Ahhh... finally shedding some light on this. The expanded WARs are *almost*
the same except for a neweer version of the MySQL connector and a slight
difference in the main entry point class file (the PLUS... a different
location for the net.opengis.xls.* class files. In the 6.1 version, those
files appear in the WEB-INF/classes/net/opengis/xls directory, but in the
6.5 build, they appear in the WEB-INF/lib/net/opengis/xls directory.

What now?


Well, is it just a project you are opening, or did you copy the files? Sounds like you must have copied them I assume, unless you have a library setup in your project pointing to a separate folder with net as a sub-folder instead of a JAR file and the project support in 6.5 is just moving that directory to the lib folder instead of compressing the contents into a JAR to match your library name. Now, if that is the case it is a bug on the part of the NB support, and if this is something ou copied by hand at some point maybe you copied the files into te wrong directory. I sort of took it that you had precompiled these files before, and were not generating them on the fly with every build, and this is where I'm assuming it might be a copy issue.

WEB-INF/classes is the standard location for regular class files to go to be on the classpath. It is the only directory of that kind really. Then WEB-INF/lib is to contain only .JAR files (though at some point the standard may change...that is the way it works or is worded now). Those are automatically added to the classpath just like WEB-INF/classes is. For instance, if those opengis classes were generated and just copied around, and are not being regenerated at build time etc, they need to be output to WEB-INF/classes if they are not to reside in a seperate JAR file. Most of the time with files generated from an XML schema or the like I tend to make each one a separate sub-project output into its own .jar file, so for me they would be in a JAR:

opengis.jar
-net
--opengis
---*

, but for your current setup it needs to be:
WEB-INF
-classes
--net
---opengis
----*

as that is the only way those classes will actually be visible to the web application classloader and other classes within it such as the toplink classes. Seems like in your project in 6.5 you should move the net folder from WEB-INF/lib into WEB-INF/classes underneith your web folder in the projects view if you are not regenerating those classes upon build. In the project view in NB 6.5 do those files show up under

Your Project
-web
--WEB-INF
---lib
----net
-----*? If so then that seems to be the issue, and they just need to be moved. Then once you build that will most likely solve the problem unless some other classes are out of place. Let me know how that goes if there is more I can do to help.

Wade



==================
Wade Chandler, CCE
Software Engineer and Developer, Certified Forensic Computer Examiner, NetBeans Dream Team Member, and NetBeans Board Member
http://www.certified-computer-examiner.com
http://wiki.netbeans.org/wiki/view/NetBeansDreamTeam
http://www.netbeans.org
Back to top
jxt
Posted via mailing list.





PostPosted: Sat Dec 20, 2008 3:50 am    Post subject: NB 6.5, EclipseLink, PersistenceException, and JAXB 2.1 Reply with quote

Wade Chandler wrote:
Quote:

Well, is it just a project you are opening, or did you copy the files?
Sounds like you must have copied them I assume, unless you have a library
setup in your project pointing to a separate folder with net as a
sub-folder instead of a JAR file


Yep, that's it, a folder of class files. For both 6.1 and 6.5, I have
created a library that points to a classes folder of a bunch of class files.
Those class files were generated some years ago by running javac on the
source files generated by running xjc on an XML schema.



Quote:
and the project support in 6.5 is just moving that directory to the lib
folder instead of compressing the contents into a JAR to match your
library name.


Well, yes, 6.5 is copying the net/opengis/xls tree into the WEB-INF/lib
folder in the WAR file. But 6.1 isn't making a jar either. The difference is
that 6.1 copies the tree into the WEB-INF/classes directory. Why the
difference? I have no idea. It is the exact same project file opened with
either 6.5 or 6.1, not a copy.



Quote:
I sort of took it that you had precompiled these files before, and were
not generating them on the fly with every build, and this is where I'm
assuming it might be a copy issue.


Right, they're precompiled, but I never put them into a jar. I just used the
"Add jar/folder" option when making a library in NetBeans and pointed it at
the classes folder that contains the net/opengis/xls class files. Both 6.1
and 6.5 point to that same directory (since it's the *same* project).



Quote:
WEB-INF/classes is the standard location for regular class files to go to
be on the classpath. It is the only directory of that kind really. Then
WEB-INF/lib is to contain only .JAR files (though at some point the
standard may change...that is the way it works or is worded now).


Well, for me anyway, WEB-INF generated by 6.5 contains a bunch of jars PLUS
a lib directory containing the net/opengis/xls tree, while the 6.1
WEB-INF/lib contains only the jar files (with the net tree up in
WEB-INF/classes where it belongs).



Quote:
Seems like in your project in 6.5 you should move the net folder from
WEB-INF/lib into WEB-INF/classes underneith your web folder in the
projects view


Yes, that would be great. But what I need is to get 6.5 to move the net
folder to the correct WEB-INF/classes folder when it builds the WAR file.
Problem is... I don't know how to do that.



Quote:
In the project view in NB 6.5 do those files show up under

Your Project
-web
--WEB-INF
---lib
----net
-----*?


Well, I don't really have access to the WEB-INF folder in the projects tab.
All that's in WEB-INF is web.xml and sun-web.xml.

Maybe I'll try jarring up that net/opengis/xls tree and using that as a
library instead of the class files directly. I'll post back here when I get
a chance to try that.

Thanks.

--
View this message in context: http://www.nabble.com/NB-6.5%2C-EclipseLink%2C-PersistenceException%2C-and-JAXB-2.1-tp21079233p21101691.html
Sent from the Netbeans - J2EE mailing list archive at Nabble.com.
Back to top
jxt
Posted via mailing list.





PostPosted: Sat Dec 20, 2008 3:58 am    Post subject: NB 6.5, EclipseLink, PersistenceException, and JAXB 2.1 Reply with quote

jxt wrote:
Quote:

Maybe I'll try jarring up that net/opengis/xls tree and using that as a
library instead of the class files directly. I'll post back here when I
get a chance to try that.


YESSSSSSSSSSS!!! That worked! I'm happy now.

So, is it the consensus that this is a NB6.5 bug? I.e., that 6.5 moving the
classes directory full of class files into the WEB-INF/lib folder is wrong.
If so, I'll file a bug report. I think, with you guys' help, I even
understand what's going on well enough to file a cogent bug report. And in
the meantime, I'm rolling again. Thanks once more.
--
View this message in context: http://www.nabble.com/NB-6.5%2C-EclipseLink%2C-PersistenceException%2C-and-JAXB-2.1-tp21079233p21101731.html
Sent from the Netbeans - J2EE mailing list archive at Nabble.com.
Back to top
Wade Chandler
Posted via mailing list.





PostPosted: Sat Dec 20, 2008 3:33 pm    Post subject: NB 6.5, EclipseLink, PersistenceException, and JAXB 2.1 Reply with quote

----- Original Message ----

Quote:
From: jxt <address-removed>
To: address-removed
Sent: Friday, December 19, 2008 10:58:01 PM
Subject: Re: [nbj2ee] NB 6.5, EclipseLink, PersistenceException, and JAXB 2.1



jxt wrote:
Quote:

Maybe I'll try jarring up that net/opengis/xls tree and using that as a
library instead of the class files directly. I'll post back here when I
get a chance to try that.


YESSSSSSSSSSS!!! That worked! I'm happy now.

So, is it the consensus that this is a NB6.5 bug? I.e., that 6.5 moving the
classes directory full of class files into the WEB-INF/lib folder is wrong.
If so, I'll file a bug report. I think, with you guys' help, I even
understand what's going on well enough to file a cogent bug report. And in
the meantime, I'm rolling again. Thanks once more.

It is definitely a bug in 6.5 that it moved a folder into the WEB-INF/lib folder. It should have done 1 of two things:

1) Copied those classes from the library classpath into WEB-INF/classes

or

2) Took the classpath from from the library, made a JAR, and put the JAR into WEB-INF/lib.
Back to top
Wade Chandler
Posted via mailing list.





PostPosted: Sat Dec 20, 2008 3:40 pm    Post subject: NB 6.5, EclipseLink, PersistenceException, and JAXB 2.1 Reply with quote

----- Original Message ----

Quote:
From: jxt <address-removed>
To: address-removed
Sent: Friday, December 19, 2008 10:50:02 PM
Subject: Re: [nbj2ee] NB 6.5, EclipseLink, PersistenceException, and JAXB 2.1



Wade Chandler wrote:
Quote:

Well, is it just a project you are opening, or did you copy the files?
Sounds like you must have copied them I assume, unless you have a library
setup in your project pointing to a separate folder with net as a
sub-folder instead of a JAR file


Yep, that's it, a folder of class files. For both 6.1 and 6.5, I have
created a library that points to a classes folder of a bunch of class files.
Those class files were generated some years ago by running javac on the
source files generated by running xjc on an XML schema.



Quote:
and the project support in 6.5 is just moving that directory to the lib
folder instead of compressing the contents into a JAR to match your
library name.


Well, yes, 6.5 is copying the net/opengis/xls tree into the WEB-INF/lib
folder in the WAR file. But 6.1 isn't making a jar either. The difference is
that 6.1 copies the tree into the WEB-INF/classes directory. Why the
difference? I have no idea. It is the exact same project file opened with
either 6.5 or 6.1, not a copy.



Quote:
I sort of took it that you had precompiled these files before, and were
not generating them on the fly with every build, and this is where I'm
assuming it might be a copy issue.


Right, they're precompiled, but I never put them into a jar. I just used the
"Add jar/folder" option when making a library in NetBeans and pointed it at
the classes folder that contains the net/opengis/xls class files. Both 6.1
and 6.5 point to that same directory (since it's the *same* project).



Quote:
WEB-INF/classes is the standard location for regular class files to go to
be on the classpath. It is the only directory of that kind really. Then
WEB-INF/lib is to contain only .JAR files (though at some point the
standard may change...that is the way it works or is worded now).


Well, for me anyway, WEB-INF generated by 6.5 contains a bunch of jars PLUS
a lib directory containing the net/opengis/xls tree, while the 6.1
WEB-INF/lib contains only the jar files (with the net tree up in
WEB-INF/classes where it belongs).



Definitely a 6.5 bug.

Quote:

Quote:
Seems like in your project in 6.5 you should move the net folder from
WEB-INF/lib into WEB-INF/classes underneith your web folder in the
projects view


Yes, that would be great. But what I need is to get 6.5 to move the net
folder to the correct WEB-INF/classes folder when it builds the WAR file.
Problem is... I don't know how to do that.



Quote:
In the project view in NB 6.5 do those files show up under

Your Project
-web
--WEB-INF
---lib
----net
-----*?


Well, I don't really have access to the WEB-INF folder in the projects tab.
All that's in WEB-INF is web.xml and sun-web.xml.


Right, what you have to do in cases like this is to right click on the WEB-INF folder and just create a sub-folder called classes. Then you can copy/move your files there. So, they won't be a library which is separate in that case, and the way NB works, anything you manually put in a folder under WEB-INF/classes or in jars in WEB-INF/lib (if you make that folder too) it will put on the classpath for you in the IDE. I use classes a lot for web application specific resources that I'll want to be able to change at runtime from the application such as configuration files etc. Now, all that said, from your email after this one, you have already JARed up the classes, put them in a JAR, and added that as a library, and that is the other way to get such a thing going, so you're good now :-D

Please be sure and file a bug at
http://www.netbeans.org/community/issues

and you can add me to the CC. My NB user name is wadechandler, so you can just put that in the CC. Let me know when you get the issue setup and I'll be sure and vote for it also.

Wade
Back to top
jxt
Posted via mailing list.





PostPosted: Sat Dec 20, 2008 6:48 pm    Post subject: NB 6.5, EclipseLink, PersistenceException, and JAXB 2.1 Reply with quote

Wade Chandler wrote:
Quote:

Please be sure and file a bug at
http://www.netbeans.org/community/issues

and you can add me to the CC. My NB user name is wadechandler, so you can
just put that in the CC. Let me know when you get the issue setup and I'll
be sure and vote for it also.


Well, I went ahead and filed a bug report last night, before reading this
message, so I didn't do the CC thing. The issue is
http://www.netbeans.org/issues/show_bug.cgi?id=155876

Thanks for all your help.

--
View this message in context: http://www.nabble.com/NB-6.5%2C-EclipseLink%2C-PersistenceException%2C-and-JAXB-2.1-tp21079233p21107831.html
Sent from the Netbeans - J2EE mailing list archive at Nabble.com.
Back to top
Wade Chandler
Posted via mailing list.





PostPosted: Sat Dec 20, 2008 7:37 pm    Post subject: NB 6.5, EclipseLink, PersistenceException, and JAXB 2.1 Reply with quote

No problem. I went ahead and moved the issue to a P2 because the workaround isn't practical as the the user (you in this case) has to go through a lot of grief to figure out the issue and solution, and as it is an IDE bug it helps drive the user away from more quickly finding the culprit. i.e. it drives you away from examining the final build artifact to reach the conclusion of how to fix the issue.

Wade

==================
Wade Chandler, CCE
Software Engineer and Developer, Certified Forensic Computer Examiner, NetBeans Dream Team Member, and NetBeans Board Member
http://www.certified-computer-examiner.com
http://wiki.netbeans.org/wiki/view/NetBeansDreamTeam
http://www.netbeans.org



----- Original Message ----
Quote:
From: jxt <address-removed>
To: address-removed
Sent: Saturday, December 20, 2008 1:48:34 PM
Subject: Re: [nbj2ee] NB 6.5, EclipseLink, PersistenceException, and JAXB 2.1



Wade Chandler wrote:
Quote:

Please be sure and file a bug at
http://www.netbeans.org/community/issues

and you can add me to the CC. My NB user name is wadechandler, so you can
just put that in the CC. Let me know when you get the issue setup and I'll
be sure and vote for it also.


Well, I went ahead and filed a bug report last night, before reading this
message, so I didn't do the CC thing. The issue is
http://www.netbeans.org/issues/show_bug.cgi?id=155876

Thanks for all your help.

--
View this message in context:
http://www.nabble.com/NB-6.5%2C-EclipseLink%2C-PersistenceException%2C-and-JAXB-2.1-tp21079233p21107831.html
Sent from the Netbeans - J2EE mailing list archive at Nabble.com.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> Java EE Users All times are GMT
Page 1 of 1

 
Jump to:  
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
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo