Monday, May 30, 2011

Re: GWT and OpenJPA not working together

I think that's specific enough:

"Caused by: java.lang.NoClassDefFoundError: java.io.FileOutputStream
is a restricted class. Please see the Google App Engine developer's
guide for more details."

On Mon, May 30, 2011 at 4:29 AM, roman <roman.zangl@gmail.com> wrote:
> Thank you for your quick response.
> I followed your advise and changed the underlying technology of my JPA
> layer to DataNucleus.
>
> But i ran into a different problem
>
> log4j:WARN No appenders could be found for logger
> (DataNucleus.Connection).
> log4j:WARN Please initialize the log4j system properly.
> [ERROR] javax.servlet.ServletContext log: unavailable
> javax.persistence.PersistenceException: Provider error. Provider:
> org.datanucleus.store.appengine.jpa.DatastorePersistenceProvider
>        at javax.persistence.Persistence.createFactory(Persistence.java:176)
>        ...
>        at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
>        at
> org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:
> 409)
>        at org.mortbay.thread.QueuedThreadPool
> $PoolThread.run(QueuedThreadPool.java:582)
> Caused by: javax.jdo.JDOFatalInternalException: Unexpected exception
> caught.
> NestedThrowables:
> java.lang.reflect.InvocationTargetException
>        at
> javax.jdo.JDOHelper.invokeGetPersistenceManagerFactoryOnImplementation(JDOHelper.java:
> 1186)
>        at javax.jdo.JDOHelper.getPersistenceManagerFactory(JDOHelper.java:
> 803)
>        at javax.jdo.JDOHelper.getPersistenceManagerFactory(JDOHelper.java:
> 698)
>        ...
> Caused by: java.lang.NoClassDefFoundError: java.io.FileOutputStream is
> a restricted class. Please see the Google  App Engine developer's
> guide for more details.
>        at
> com.google.appengine.tools.development.agent.runtime.Runtime.reject(Runtime.java:
> 51)
>        at
> org.apache.derby.impl.services.stream.SingleStream.PBmakeFileHPW(Unknown
> Source)
>        at org.apache.derby.impl.services.stream.SingleStream.run(Unknown
> Source)
>
> Well I see that i probably have got an error in the configuration of
> the DataStorePersistenceProvider. Unfortunately, I am not sure what
> the error could be. Is there any way to get a more specific
> description of what is causing the problem?
>
> cheers, roman
>
>
> On 27 Mai, 15:28, Patrick Julien <pjul...@gmail.com> wrote:
>> If you wan't to use JPA with AppEngine, you have to use the JPA that
>> comes with AppEngine which is based on datanucleus.  See
>>
>> http://code.google.com/appengine/docs/java/datastore/jpa/overview.html
>>
>> for an overview
>>
>>
>>
>>
>>
>>
>>
>> On Fri, May 27, 2011 at 5:56 AM, roman <roman.za...@gmail.com> wrote:
>> > Hi,
>> > I'm trying to implement a UserManagement based on GoogleWebToolkit
>> > (Adding, deleting, assigning privileged; nothing special there). The
>> >GWT-module is using a serparate persistence module, which I included
>> > as a jar-file and which is based onOpenJPA.
>>
>> > The persistence layer is working fine as long is I run it standalone.
>> > But when I wire it to myGWTproject, I can't create the
>> > EntityManagerFactory any more. I get a NullPointerException in one of
>> > theOpenJPAclasses, which I think is because that Google App Engine
>> > replaced the default java.lang.ClassLoader.
>>
>> > Is it a bad idea to useOpenJPAwithGWT? Is there anything to
>> > consider when combining these libraries?
>>
>> > For better understanding find the source code attached.
>> > Any help would be greatly appreciated.
>> > thx, roman
>>
>> > The server is running athttp://localhost:8888/
>> > [WARN] Error for /usermgmtui/userInformation
>> > java.lang.ExceptionInInitializerError
>> >        at org.apache.openjpa.kernel.Bootstrap.invokeFactory(Bootstrap.java:
>> > 116)
>> >        at
>> > org.apache.openjpa.kernel.Bootstrap.getBrokerFactory(Bootstrap.java:
>> > 96)
>> >        at
>> > org.apache.openjpa.persistence.OpenJPAPersistence.getEntityManagerFactory(OpenJPAPersistence.java:
>> > 92)
>> >        at
>> > com.mycompany.commons.jpa.JpaUserManagement.<init>(JpaUserManagement.java:
>> > 64)
>> >        at
>> > com.mycompany.commons.UserManagementImpl.setDatasoure(UserManagementImpl.java:
>> > 71)
>> >        at
>> > com.mycompany.ui.server.UserInformationServiceImpl.<init>(UserInformationServiceImpl.java:
>> > 36)
>> >        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
>> > Method)
>> >        at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown
>> > Source)
>> >        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown
>> > Source)
>> >        at java.lang.reflect.Constructor.newInstance(Unknown Source)
>> >        at java.lang.Class.newInstance0(Unknown Source)
>> >        at java.lang.Class.newInstance(Unknown Source)
>> >        at org.mortbay.jetty.servlet.Holder.newInstance(Holder.java:153)
>> >        at
>> > org.mortbay.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:
>> > 428)
>> >        at
>> > org.mortbay.jetty.servlet.ServletHolder.getServlet(ServletHolder.java:
>> > 339)
>> >        at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:
>> > 487)
>> >        at org.mortbay.jetty.servlet.ServletHandler
>> > $CachedChain.doFilter(ServletHandler.java:1166)
>> >        at
>> > com.google.appengine.tools.development.HeaderVerificationFilter.doFilter(HeaderVerificationFilter.java:
>> > 35)
>> >        at org.mortbay.jetty.servlet.ServletHandler
>> > $CachedChain.doFilter(ServletHandler.java:1157)
>> >        at
>> > com.google.appengine.api.blobstore.dev.ServeBlobFilter.doFilter(ServeBlobFilter.java:
>> > 58)
>> >        at org.mortbay.jetty.servlet.ServletHandler
>> > $CachedChain.doFilter(ServletHandler.java:1157)
>> >        at
>> > com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:
>> > 43)
>> >        at org.mortbay.jetty.servlet.ServletHandler
>> > $CachedChain.doFilter(ServletHandler.java:1157)
>> >        at
>> > com.google.appengine.tools.development.StaticFileFilter.doFilter(StaticFileFilter.java:
>> > 122)
>> >        at org.mortbay.jetty.servlet.ServletHandler
>> > $CachedChain.doFilter(ServletHandler.java:1157)
>> >        at
>> > com.google.appengine.tools.development.BackendServersFilter.doFilter(BackendServersFilter.java:
>> > 94)
>> >        at org.mortbay.jetty.servlet.ServletHandler
>> > $CachedChain.doFilter(ServletHandler.java:1157)
>> >        at
>> > org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:
>> > 388)
>> >        at
>> > org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:
>> > 216)
>> >        at
>> > org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:
>> > 182)
>> >        at
>> > org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:
>> > 765)
>> >        at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:
>> > 418)
>> >        at
>> > com.google.apphosting.utils.jetty.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java:
>> > 70)
>> >        at
>> > org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:
>> > 152)
>> >        at com.google.appengine.tools.development.JettyContainerService
>> > $ApiProxyHandler.handle(JettyContainerService.java:351)
>> >        at
>> > org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:
>> > 152)
>> >        at org.mortbay.jetty.Server.handle(Server.java:326)
>> >        at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:
>> > 542)
>> >        at org.mortbay.jetty.HttpConnection
>> > $RequestHandler.content(HttpConnection.java:938)
>> >        at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:755)
>> >        at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
>> >        at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
>> >        at
>> > org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:
>> > 409)
>> >        at org.mortbay.thread.QueuedThreadPool
>> > $PoolThread.run(QueuedThreadPool.java:582)
>> > Caused by: java.lang.reflect.UndeclaredThrowableException
>> >        at $Proxy29.recordAppClassLoader(Unknown Source)
>> >        at
>> > com.google.appengine.tools.development.agent.runtime.Runtime.recordClassLoader(Runtime.java:
>> > 47)
>> >        at
>> > org.apache.openjpa.lib.util.MultiClassLoader.<init>(MultiClassLoader.java:
>> > 60)
>> >        at org.apache.openjpa.lib.util.J2DoPrivHelper
>> > $47.run(J2DoPrivHelper.java:1011)
>> >        at org.apache.openjpa.lib.util.J2DoPrivHelper
>> > $47.run(J2DoPrivHelper.java:1009)
>> >        at java.security.AccessController.doPrivileged(Native Method)
>> >        at
>> > org.apache.openjpa.lib.conf.ProductDerivations.<clinit>(ProductDerivations.java:
>> > 59)
>> >        ... 44 more
>> > Caused by: java.lang.reflect.InvocationTargetException
>> >        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> >        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>> >        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>> >        at java.lang.reflect.Method.invoke(Unknown Source)
>> >        at com.google.apphosting.utils.clearcast.ClearCast$CasterImpl
>> > $ProxyHandler.invoke(ClearCast.java:411)
>> >        ... 51 more
>> > Caused by: java.lang.NullPointerException
>> >        at
>> > org.apache.openjpa.lib.util.MultiClassLoader.hashCode(MultiClassLoader.java:
>> > 277)
>> >        at java.util.WeakHashMap.put(Unknown Source)
>> >        at
>> > com.google.appengine.tools.development.agent.impl.AgentImpl.recordAppClassLoader(AgentImpl.java:
>> > 34)
>> >        ... 56 more
>> > [WARN] Nested in java.lang.ExceptionInInitializerError:
>> > java.lang.reflect.UndeclaredThrowableException
>> >        at $Proxy29.recordAppClassLoader(Unknown Source)
>> >        at
>> > com.google.appengine.tools.development.agent.runtime.Runtime.recordClassLoader(Runtime.java:
>> > 47)
>> >        at
>> > org.apache.openjpa.lib.util.MultiClassLoader.<init>(MultiClassLoader.java:
>> > 60)
>> >        at org.apache.openjpa.lib.util.J2DoPrivHelper
>> > $47.run(J2DoPrivHelper.java:1011)
>> >        at org.apache.openjpa.lib.util.J2DoPrivHelper
>> > $47.run(J2DoPrivHelper.java:1009)
>> >        at java.security.AccessController.doPrivileged(Native Method)
>> >        at
>> > org.apache.openjpa.lib.conf.ProductDerivations.<clinit>(ProductDerivations.java:
>> > 59)
>> >        at org.apache.openjpa.kernel.Bootstrap.invokeFactory(Bootstrap.java:
>> > 116)
>> >        at
>> > org.apache.openjpa.kernel.Bootstrap.getBrokerFactory(Bootstrap.java:
>> > 96)
>> >        at
>> > org.apache.openjpa.persistence.OpenJPAPersistence.getEntityManagerFactory(OpenJPAPersistence.java:
>> > 92)
>> >        at
>> > com.mycompany.commons.jpa.JpaUserManagement.<init>(JpaUserManagement.java:
>> > 64)
>> >        at
>> > com.mycompany.commons.UserManagementImpl.setDatasoure(UserManagementImpl.java:
>> > 71)
>> >        at
>> > com.mycompany.ui.server.UserInformationServiceImpl.<init>(UserInformationServiceImpl.java:
>> > 36)
>> >        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
>> > Method)
>> >        at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown
>> > Source)
>> >        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown
>> > Source)
>> >        at java.lang.reflect.Constructor.newInstance(Unknown Source)
>> >        at java.lang.Class.newInstance0(Unknown Source)
>> >        at java.lang.Class.newInstance(Unknown Source)
>> >        at org.mortbay.jetty.servlet.Holder.newInstance(Holder.java:153)
>> >        at
>> > org.mortbay.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:
>> > 428)
>> >        at
>> > org.mortbay.jetty.servlet.ServletHolder.getServlet(ServletHolder.java:
>> > 339)
>> >        at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:
>> > 487)
>> >        at org.mortbay.jetty.servlet.ServletHandler
>> > $CachedChain.doFilter(ServletHandler.java:1166)
>> >        at
>> > com.google.appengine.tools.development.HeaderVerificationFilter.doFilter(HeaderVerificationFilter.java:
>> > 35)
>> >        at org.mortbay.jetty.servlet.ServletHandler
>> > $CachedChain.doFilter(ServletHandler.java:1157)
>> >        at
>> > com.google.appengine.api.blobstore.dev.ServeBlobFilter.doFilter(ServeBlobFilter.java:
>> > 58)
>> >        at org.mortbay.jetty.servlet.ServletHandler
>> > $CachedChain.doFilter(ServletHandler.java:1157)
>> >        at
>> > com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:
>> > 43)
>> >
>>
>> ...
>>
>> Erfahren Sie mehr »
>
> --
> You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
> To post to this group, send email to google-web-toolkit@googlegroups.com.
> To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
>
>

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment