Community
Participate
Working Groups
Try to use static weave with project cache to run jpa/advanced test model, static weave failed with following info: run-weaver-server-test: Warning: Reference run.classpath has not been set at runtime, but was found during build file parsing, attempting to resolve. Future versions of Ant may support referencing ids defined in non-executed targets. [weave] [EL Severe]: weaver: 2012-09-26 14:19:21.064--javax.persistence.PersistenceException: Exception [EclipseLink-28018] (Eclipse Persistence Services - 2.5.0.v20120922-3d4600c): org.eclipse.persistence.exceptions.EntityManagerSetupException [weave] Exception Description: Predeployment of PersistenceUnit [default] failed. [weave] Internal Exception: javax.persistence.PersistenceException: Exception [EclipseLink-28007] (Eclipse Persistence Services - 2.5.0.v20120922-3d4600c): org.eclipse.persistence.exceptions.EntityManagerSetupException [weave] Exception Description: Failed to instantiate ServerPlatform of type [org.eclipse.persistence.platform.server.glassfish.GlassfishPlatform] specified in [eclipselink.target-server] property. [weave] Internal Exception: java.lang.NoSuchMethodException: org.eclipse.persistence.platform.server.glassfish.GlassfishPlatform.<init>(org.eclipse.persistence.sessions.DatabaseSession) BUILD FAILED C:\eclipselink\org.eclipse.persistence\eclipselink.runtime\jpa\eclipselink.jpa.test\antbuild.xml:3151: The following error occurred while executing this line: C:\eclipselink\org.eclipse.persistence\eclipselink.runtime\jpa\eclipselink.jpa.test\antbuild.xml:2911: The following error occurred while executing this line: C:\eclipselink\org.eclipse.persistence\eclipselink.runtime\jpa\eclipselink.jpa.test\antbuild.xml:2461: The following error occurred while executing this line: C:\eclipselink\org.eclipse.persistence\eclipselink.runtime\jpa\eclipselink.jpa.test\antbuild.xml:2566: The following error occurred while executing this line: C:\eclipselink\org.eclipse.persistence\eclipselink.runtime\jpa\eclipselink.jpa.test\antbuild.xml:2173: Exception [EclipseLink-40007] (Eclipse Persistence Services - 2.5.0.v20120922-3d4600c): org.eclipse.persistence.exceptions.StaticWeaveException Exception Description: An exception was thrown while weaving: ./build/unwoven-eclipselink-advanced-model_ejb.jar Internal Exception: javax.persistence.PersistenceException: Exception [EclipseLink-28018] (Eclipse Persistence Services - 2.5.0.v20120922-3d4600c): org.eclipse.persistence.exceptions.EntityManagerSetupException Exception Description: Predeployment of PersistenceUnit [default] failed. Internal Exception: javax.persistence.PersistenceException: Exception [EclipseLink-28007] (Eclipse Persistence Services - 2.5.0.v20120922-3d4600c): org.eclipse.persistence.exceptions.EntityManagerSetupException Exception Description: Failed to instantiate ServerPlatform of type [org.eclipse.persistence.platform.server.glassfish.GlassfishPlatform] specified in [eclipselink.target-server] property. Internal Exception: java.lang.NoSuchMethodException: org.eclipse.persistence.platform.server.glassfish.GlassfishPlatform.<init>(org.eclipse.persistence.sessions.DatabaseSession)
Here are the steps to recreate: 1. ant server-install / ant server-start / server-setup 2. add "run.metadata.cache.test.suite=true" in test.properties 3. ant server-test-advanced (invoke this model only to simplify the reproduce) 4. ant server-stop 5. remove "run.metadata.cache.test.suite=true" from test.properties 6. add "use.project.cache=true" to test.properties 6.5 add "server.weaving=static" to test.properties 7. go to jpa\eclipselink.jpa.test, edit antbuild.xml to comment out all the lines for "add-project-cache-properties" target 9. add following two lines in persistence.xml under jpa\eclipselink.jpa.test\resource\eclipselink-advanced-model\server <property name="eclipselink.project-cache" value="java-serialization"/> <property name="eclipselink.project-cache.java-serialization.file-location" value="C:\eclipselink\repo\eclipselink.runtime\jpa\eclipselink.jpa.test\pcfile\eclipselink-advanced-model\MetadataCachingTestProject.file"/> note: you might need to change the trunk location "C:\eclipselink\repo\eclipselink.runtime" as yours 10. ant server-test-advanced
The problem occurs during static weaving, before the server is even involved. I believe the problem is that the classpath the weaver is run with does not have enough classes to load the serialized project. Running the static weaver with project caching on will require more classes on the classpath since the serialized project will potentially have things like the login setup. The classpath will have to resemble what was in the environment where the cache was generated.
Caching a project based on a server deployment and then static weaving the same persistence unit based on the cache is a strange thing to do. The way you should do this is to static weave and then deploy to the server. If you want to workaround this issue, you just have to make everying available on your server classpath available when you static weave. Closing as WONTFIX
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink