Back Forum Reply New

OpenJPA and load time weaving

I'm finally doing some concrete experimenting with OpenJPA and Spring. This is probably the last thing to solve before I have a succesful Wicket+Spring+OpenJPA example :-)

The problem is about load time weaving. I do not want to pre-enhance my classes and I also don't want to run with the OpenJPA JDK agent. Both are not very practical for the way I develop.

So that leaves the LoadTimeWeaver interface. I have configured my LocalContainerEntityManagerFactory to use the SimpleLoadTimeWeaver now but I am still getting this error:Code:
lt;4|false|0.9.0-incubating-SNAPSHOTgt; org.apache.openjpa.persistence.ArgumentException: Attempt to cast instance quot;com.sateh.wicket.quickstart.entities.Message@716387quot; to PersistenceCapable failed.  Ensure that it has been enhanced.
I'm not sure what to do here. I am running my application from IDEA, starting a simple main() to start Jetty, which loads Spring, etc.
S.

ponent.BookmarkablePageRequestTarget.newPage(BookmarkablePageRequestTarget.java:271)
at wicket.request.target.component.BookmarkablePageRequestTarget.getPage(BookmarkablePageRequestTarget.java:290)
at wicket.request.target.component.BookmarkablePageRequestTarget.processEvents(BookmarkablePageRequestTarget.java:208)
at wicket.request.compound.DefaultEventProcessorStrategy.processEvents(DefaultEventProcessorStrategy.java:70)
at wicket.request.compound.AbstractCompoundRequestCycleProcessor.processEvents(AbstractCompoundRequestCycleProcessor.java:58)
at wicket.RequestCycle.doProcessEventsAndRespond(RequestCycle.java:895)
at wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:930)
at wicket.RequestCycle.step(RequestCycle.java:1011)
at wicket.RequestCycle.steps(RequestCycle.java:1082)
at wicket.RequestCycle.request(RequestCycle.java:454)
at wicket.protocol.from.WicketFilter.doGet(WicketFilter.java:234)
at wicket.protocol.from.WicketServlet.doGet(WicketServlet.java:126)
at javax.servlet.from.fromServlet.service(fromServlet.java:689)
at javax.servlet.from.fromServlet.service(fromServlet.java:802)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:447)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:356)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:226)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:621)
at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:149)
at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:123)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:141)
at org.mortbay.jetty.Server.handle(Server.java:269)
at org.mortbay.jetty.fromConnection.handleRequest(fromConnection.java:430)
at org.mortbay.jetty.fromConnection$RequestHandler.headerComplete(fromConnection.java:678)
at org.mortbay.jetty.fromParser.parseNext(fromParser.java:492)
at org.mortbay.jetty.fromParser.parseAvailable(fromParser.java:199)
at org.mortbay.jetty.fromConnection.handle(fromConnection.java:339)
at org.mortbay.jetty.nio.fromChannelEndPoint.run(fromChannelEndPoint.java:270)
at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:475)I've tried using OpenJPA with Spring using the classes from sandbox and petclinic on Tomcat however I get some XML parsing/transforming exceptions.
See this issue for more information: jira/browse/OPENJPA-41.


Originally Posted by Costin LeauI've tried using OpenJPA with Spring using the classes from sandbox and petclinic on Tomcat however I get some XML parsing/transforming exceptions.
See this issue for more information: jira/browse/OPENJPA-41.

Yeah I found that report in my search last weekend :-)

For me OpenJPA works great if I use the -javaagent option. I did have some issues but they went away after upgrading to a newer snapshot of OpenJPA. (I made my own since the snapshots on the OpenJPA site were more than a month old jira/browse/OPENJPA-58 ).

I have not seen the problem that you refer to in OPENJPA-41 .. maybe they fixed that?

The weaving will probably be fixed in the long run .. for me it is more experimenting and looking forward to get rid of Hibernate.
S.
¥
Back Forum Reply New