PDA

View Full Version : release note instructions regarding OpenJPA requirement



kenhwallis
21 Oct 2011, 12:36 PM
I'm trying to install the GXT 3.0 DP5 examples webapp in JBoss so that I can familiarize myself with its features before SenchaCon. However, deployment fails because OpenJPA is not configured. I've searched all the content of the PR. There are no mentions. How is Open JPA supposed to be configured for this webapp?

Colin Alworth
21 Oct 2011, 1:36 PM
OpenJPA is required only for the examples war – nothing in GXT itself requires it, nor any of the other jars available in the download. It is used to make it easier to quickly build examples that talk to the server in an abstract way.

If you are trying to run the war, it should work as is – the war contains all the jars it needs to work, as well as a working persistence.xml file, and enhanced class files. We have tested the war by dropping it into both jetty and tomcat, and it has worked without any problems.

If you are trying to run from source with the server samples, make sure persistence.xml is available for OpenJPA, and make sure you are running the openjpa enhancement required on the com.sencha.gxt.examples.resources.server.data package.

In its current form, there really is not enough to build and debug the full explorer project from what is in the zip, but there is enough to see how the examples are achieved. The server code is pretty straight-forward - pull objects out of some persistence mechanism, and send it to the client as xml, json, or via RPC or RequestFactory.

If you can post some specifics about how you are trying to set it up, and perhaps some logs of what is going wrong, that might help to pin down the issue you are having.

kenhwallis
21 Oct 2011, 1:42 PM
I simply dropped the war from within the bundle into my deploy folder. The following errors were logged. I presume they are related since neither occurs without the new GXT deploy.

ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] (main) Error installing to Start: name=persistence.unit:unitName=#openjpa state=Create
java.lang.RuntimeException: Specification violation [EJB3 JPA 6.2.1.2] - You have not defined a jta-data-source for a JTA enabled persistence context named: openjpa
at org.jboss.jpa.deployment.PersistenceUnitInfoImpl.<init>(PersistenceUnitInfoImpl.java:115)
at org.jboss.jpa.deployment.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:275)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:59)
at org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:150)
at org.jboss.joinpoint.plugins.BasicMethodJoinPoint.dispatch(BasicMethodJoinPoint.java:66)
at org.jboss.kernel.plugins.dependency.KernelControllerContextAction$JoinpointDispatchWrapper.execute(KernelControllerContextAction.java:243)
at org.jboss.kernel.plugins.dependency.ExecutionWrapper.execute(ExecutionWrapper.java:47)
at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchExecutionWrapper(KernelControllerContextAction.java:111)
at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchJoinPoint(KernelControllerContextAction.java:72)
at org.jboss.kernel.plugins.dependency.LifecycleAction.installActionInternal(LifecycleAction.java:221)
at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:54)
at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:42)
at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1652)
at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:938)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:988)
at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:778)
at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:543)
at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:125)
at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:52)
at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62)
at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:55)
at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:179)
at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1454)
at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1172)
at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1193)
at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1113)
at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1652)
at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:938)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:988)
at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:826)
at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:556)
at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:789)
at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:699)
at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapter.java:117)
at org.jboss.system.server.profileservice.repository.ProfileDeployAction.install(ProfileDeployAction.java:70)
at org.jboss.system.server.profileservice.repository.AbstractProfileAction.install(AbstractProfileAction.java:53)
at org.jboss.system.server.profileservice.repository.AbstractProfileService.install(AbstractProfileService.java:403)
at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1652)
at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:938)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:988)
at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:778)
at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:543)
at org.jboss.system.server.profileservice.repository.AbstractProfileService.registerProfile(AbstractProfileService.java:308)
at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:256)
at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:461)
at org.jboss.Main.boot(Main.java:221)
at org.jboss.Main$1.run(Main.java:556)
at java.lang.Thread.run(Thread.java:619)


ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/gxt-examples]] (main) Exception sending context initialized event to listener instance of class com.sencha.gxt.examples.resources.server.DataLoader
java.lang.ExceptionInInitializerError
at com.sencha.gxt.examples.resources.server.MusicDataLoader.initMusic(MusicDataLoader.java:13)
at com.sencha.gxt.examples.resources.server.DataLoader.contextInitialized(DataLoader.java:15)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3910)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4389)
at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:321)
at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeploy(TomcatDeployment.java:145)
at org.jboss.web.deployers.AbstractWarDeployment.start(AbstractWarDeployment.java:461)
at org.jboss.web.deployers.WebModule.startModule(WebModule.java:118)
at org.jboss.web.deployers.WebModule.start(WebModule.java:97)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
at org.jboss.system.microcontainer.ServiceProxy.invoke(ServiceProxy.java:206)
at $Proxy38.start(Unknown Source)
at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:42)
at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:37)
at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
at org.jboss.system.microcontainer.ServiceControllerContext.install(ServiceControllerContext.java:297)
at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1652)
at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:938)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:988)
at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:826)
at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:556)
at org.jboss.system.ServiceController.doChange(ServiceController.java:688)
at org.jboss.system.ServiceController.start(ServiceController.java:460)
at org.jboss.system.deployers.ServiceDeployer.start(ServiceDeployer.java:163)
at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:99)
at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:46)
at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62)
at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:55)
at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:179)
at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1454)
at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1172)
at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1193)
at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1113)
at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1652)
at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:938)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:988)
at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:826)
at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:556)
at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:789)
at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:699)
at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapter.java:117)
at org.jboss.system.server.profileservice.repository.ProfileDeployAction.install(ProfileDeployAction.java:70)
at org.jboss.system.server.profileservice.repository.AbstractProfileAction.install(AbstractProfileAction.java:53)
at org.jboss.system.server.profileservice.repository.AbstractProfileService.install(AbstractProfileService.java:403)
at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1652)
at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:938)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:988)
at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:778)
at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:543)
at org.jboss.system.server.profileservice.repository.AbstractProfileService.registerProfile(AbstractProfileService.java:308)
at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:256)
at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:461)
at org.jboss.Main.boot(Main.java:221)
at org.jboss.Main$1.run(Main.java:556)
at java.lang.Thread.run(Thread.java:619)
Caused by: javax.persistence.PersistenceException: Failed to load provider from META-INF/services
at javax.persistence.spi.PersistenceProviderResolverHolder$DefaultPersistenceProviderResolver.getPersistenceProviders(PersistenceProviderResolverHolder.java:121)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:91)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:72)
at com.sencha.gxt.examples.resources.server.EMF.<clinit>(EMF.java:8)
... 71 more
Caused by: java.lang.ClassCastException: org.hibernate.ejb.HibernatePersistence cannot be cast to javax.persistence.spi.PersistenceProvider
at javax.persistence.spi.PersistenceProviderResolverHolder$DefaultPersistenceProviderResolver.getPersistenceProviders(PersistenceProviderResolverHolder.java:110)
... 74 more

Colin Alworth
21 Oct 2011, 1:58 PM
Yep, that error is definitly coming from the gxt-examples war. We didn't test with jboss, as it is just a set of examples for how to write client code, and is not intended as a one-size-fits-all example for how to build for all servlet containers.

My quick guess is that JBoss has its own OpenJPA requirements, which I am unfamiliar with. If you are unable to test with jetty or tomcat, you could try adding a jta-data-source tag in the persistence.xml found in the WEB-INF/classes/META-INF in the unzipped war.

You'll note that we're not using a jndi data source for our example, just a hard-coded jdbc: url in the persistence.xml file. I'm therefor unsure as to how the jta-data-source element would be configured - reading from http://docs.jboss.org/ejb3/app-server/reference/build/reference/en/html/entityconfig.html and http://docs.jboss.org/jbossas/docs/Server_Configuration_Guide/4/html/ch01s02s01.html (first two search results on google for "jta-data-source persistence.xml jboss") suggest that indeed this must be set to a value appropriate for your jboss setup.

From the first link, I note this:

[jta-data-source] is ignored when *not* used within an application server. When running outside of an application server, you must specify JDBC connections with Hibernate specific properties (see below).
I read that as saying that if you are not running as an app server (though I don't know how to run jboss as only a servlet container), the jdbc urls we've already specified in that file will be sufficient. To get this to play nice with jboss, you may need to follow the other steps lists.

Sorry, unfortunately we're trying to focus on building quick, simple examples of how to build powerful UIs, so our field testing of the war in other servlet containers has been lacking. You can find a currently running version of that war at http://www.sencha.com/examples-dev/, or the nightly build at http://staging.sencha.com:8080/examples-dev/.

kenhwallis
21 Oct 2011, 2:07 PM
Links you provided return the following error:

Webpage error details
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; GTB6.5; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; InfoPath.2; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E)
Timestamp: Fri, 21 Oct 2011 22:06:35 UTC

Message: 'button' is null or not an object
Line: 138
Char: 951
Code: 0
URI: http://www.sencha.com/forum/clientscript/ckeditor/ckeditor.js?t=A7HG4HT&v=415

Colin Alworth
21 Oct 2011, 2:10 PM
All four links are working correctly for me, tested in ff and chrome - can you specify which link? The url at the end of your posted message seems to suggest that the error came from the forum itself. Perhaps try copy/pasting the urls if clicking on them does not work?

kenhwallis
21 Oct 2011, 2:43 PM
Clicked directly on both of the Sencha examples links at bottom of your previous response. They open new IE browser windows but do not populate UI content. On first set of attempts, the posted error message occurred in the Forum and displayed in status bar.

I've now downloaded an installed Tomcat 6.0.33 and expanded the examples war into it. That deployment as well only displays a blank webpage.

kenhwallis
21 Oct 2011, 2:49 PM
Both Sencha's example-dev link & my local Tomcat work when viewed from Chrome.

Colin Alworth
21 Oct 2011, 3:11 PM
We've been trying to confirm your issue internally - http://www.sencha.com/examples-dev/ works in XP/IE6, XP/IE7, XP/IE8, Win7/IE8 running on our test machines. Based on the useragent string you pasted, it appears you are running XP/IE8.

Since you'll be at SenchaCon, perhaps we can track this issue down in person – if there is a reasonable OS/browser configuration that we're not compatible with, we'd like to know about it.

Thanks for working with me to try to track this down, and looking forward to meeting you in person this next week!

The one other suggestion offered internally was to be certain that your browser is a) not in compatibility mode (though this does work in my testing), and b) that you do not have a stale cache in IE.

kenhwallis
2 Nov 2011, 6:54 AM
I believe the issue relates to the RAM availability versus requirements for IE. My laptop only has 2GB. Since Chrome is able to display the pages, I'm assuming IE requires a larger footprint. I'm looking into upgrades.

Sencha might consider offering the gallery of examples in another form where only the selected instance opens rather than the thumbnails of all. It might help others who have similar resource restrictions & limitations.

Colin Alworth
2 Nov 2011, 7:26 AM
Possible, but seems unlikely - my IE8/XP vm only has one or two gigs, certainly no higher than that.

Did you try disabling the plugins/toolbars to see if that would allow it to load?

There are a number of tools out there that can report what IE has downloaded, such as IBM Page Detailer (https://www.ibm.com/developerworks/community/groups/service/html/communityview?communityUuid=61d74777-1701-4014-bfc0-96067ed50156) or just using Wireshark/Ethereal and watching the http traffic. Those are just the two I have used, there are certainly more. These tools might give you a hint as to what isn't being downloaded, and perhaps why (proxy error due to how your connection is set up, 404 due to some toolbar trying to 'help' in requesting a file).

Beyond that, we get into the big guns, something like actually debugging IE to figure out why it isn't doing what we ask. For that step, I would suggest compiling with style=PRETTY so you can see what the code is actually doing. Visual Studio can help there - add breakpoints in the source using the 'debugger' keyword. Another tool would be DynaTrace Ajax Edition - while this is more geared toward profiling IE, it will tell you what files have loaded, when, and what js/rendering they cause to occur.

Sorry we didn't get a chance to resolve this at the conference - if it ends up being a toolbar issue (first on my suspect list), let us know so we can see if there is some way to stop it from happening, either within our code, or without our build process.