Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » EMF / GWT custom datastore usage
EMF / GWT custom datastore usage [message #773688] Mon, 02 January 2012 09:46 Go to next message
Pasquale Gervasi is currently offline Pasquale GervasiFriend
Messages: 12
Registered: July 2010
Junior Member
Hello EMF / GWT Gurus:

I succesfuly created a GWT editor for my model while having an independent FrontController servlet that extends HttpServlet - GWT didn't like it and spewed all kinds of erros because modules weren't inherited; but the app works fine anyways.

My problem is how to access the datastore from within the FrontController. I tried using:

ResourceSet resourceSet = new ResourceSetImpl();
Resource resource = resourceSet.createResource(URI.createURI("datastore:/SessionLog"))

which works for the initial creation of the resource SessionLog but if i try to load/get the resource:

resource.load("datastore:/SessionLog", true)


org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1DiagnosticWrappedException: java.lang.IllegalArgumentException: Host name may not be null
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDemandLoadException(ResourceSetImpl.java:348)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:307)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResource(ResourceSetImpl.java:455)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getEObject(ResourceSetImpl.java:233)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getEObject(ResourceSetImpl.java:217)
at org.eclipse.emf.ecore.resource.impl.BinaryResourceImpl$EObjectInputStream.readEPackage(BinaryResourceImpl.java:1138)
at org.eclipse.emf.ecore.resource.impl.BinaryResourceImpl$EObjectInputStream.readEClass(BinaryResourceImpl.java:1157)
at org.eclipse.emf.ecore.resource.impl.BinaryResourceImpl$EObjectInputStream.loadEObject(BinaryResourceImpl.java:1458)
at org.eclipse.emf.ecore.resource.impl.BinaryResourceImpl$EObjectInputStream.loadResource(BinaryResourceImpl.java:1211)
at org.eclipse.emf.ecore.resource.impl.BinaryResourceImpl.doLoad(BinaryResourceImpl.java:76)
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1318)
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1189)
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1042)
at com.cloud.connect.session.integration.FrontController.doPost(FrontController.java:75)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:713)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
at com.cloud.connect.session.integration.AuthenticationHandler.doFilter(AuthenticationHandler.java:42)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at com.cloud.connect.session.integration.CryptographicHandler.doFilter(CryptographicHandler.java:48)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at com.cloud.connect.session.integration.TemplateFilter.doFilter(TemplateFilter.java:38)
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 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:349)
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:212)
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.IllegalArgumentException: Host name may not be null
at org.apache.commons.httpclient.HttpHost.<init>(Unknown Source)
at org.apache.commons.httpclient.HttpHost.<init>(Unknown Source)
at org.apache.commons.httpclient.HttpMethodBase.setURI(Unknown Source)
at org.apache.commons.httpclient.HttpMethodBase.<init>(Unknown Source)
at org.apache.commons.httpclient.methods.GetMethod.<init>(Unknown Source)
at com.google.appengine.api.urlfetch.dev.LocalURLFetchService$1.buildMethod(LocalURLFetchService.java:93)
at com.google.appengine.api.urlfetch.dev.LocalURLFetchService.fetch(LocalURLFetchService.java:188)
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.appengine.tools.development.ApiProxyLocalImpl$AsyncApiCall.call(ApiProxyLocalImpl.java:308)
at com.google.appengine.tools.development.ApiProxyLocalImpl$AsyncApiCall.call(ApiProxyLocalImpl.java:265)
at java.util.concurrent.Executors$PrivilegedCallable$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.util.concurrent.Executors$PrivilegedCallable.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

Any suggestions on how to avoid this issue? Is there a better way to access the datastore from within a plain old servlet?

Pasquale
Re: EMF / GWT custom datastore usage [message #774086 is a reply to message #773688] Tue, 03 January 2012 08:34 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33142
Registered: July 2009
Senior Member
Pasquale,

Comments below.

On 02/01/2012 10:46 AM, Pasquale Gervasi wrote:
> Hello EMF / GWT Gurus:
>
> I succesfuly created a GWT editor for my model while having an
> independent FrontController servlet that extends HttpServlet - GWT
> didn't like it and spewed all kinds of erros because modules weren't
> inherited; but the app works fine anyways.
> My problem is how to access the datastore from within the
> FrontController. I tried using:
>
> ResourceSet resourceSet = new ResourceSetImpl();
> Resource resource =
> resourceSet.createResource(URI.createURI("datastore:/SessionLog"))
>
> which works for the initial creation of the resource SessionLog but if
> i try to load/get the resource:
>
> resource.load("datastore:/SessionLog", true)
Have you registered DatastoreURIHandlerImpl as the generated editor does?
>
>
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1DiagnosticWrappedException:
> java.lang.IllegalArgumentException: Host name may not be null
> at
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDemandLoadException(ResourceSetImpl.java:348)
> at
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:307)
> at
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResource(ResourceSetImpl.java:455)
> at
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getEObject(ResourceSetImpl.java:233)
> at
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getEObject(ResourceSetImpl.java:217)
> at
> org.eclipse.emf.ecore.resource.impl.BinaryResourceImpl$EObjectInputStream.readEPackage(BinaryResourceImpl.java:1138)
> at
> org.eclipse.emf.ecore.resource.impl.BinaryResourceImpl$EObjectInputStream.readEClass(BinaryResourceImpl.java:1157)
> at
> org.eclipse.emf.ecore.resource.impl.BinaryResourceImpl$EObjectInputStream.loadEObject(BinaryResourceImpl.java:1458)
> at
> org.eclipse.emf.ecore.resource.impl.BinaryResourceImpl$EObjectInputStream.loadResource(BinaryResourceImpl.java:1211)
> at
> org.eclipse.emf.ecore.resource.impl.BinaryResourceImpl.doLoad(BinaryResourceImpl.java:76)
> at
> org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1318)
> at
> org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1189)
> at
> org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1042)
> at
> com.cloud.connect.session.integration.FrontController.doPost(FrontController.java:75)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:713)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
> at
> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
> at
> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
> at
> com.cloud.connect.session.integration.AuthenticationHandler.doFilter(AuthenticationHandler.java:42)
> at
> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
> at
> com.cloud.connect.session.integration.CryptographicHandler.doFilter(CryptographicHandler.java:48)
> at
> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
> at
> com.cloud.connect.session.integration.TemplateFilter.doFilter(TemplateFilter.java:38)
> 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
> 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:349)
> 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:212)
> 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.IllegalArgumentException: Host name may not be null
> at org.apache.commons.httpclient.HttpHost.<init>(Unknown Source)
> at org.apache.commons.httpclient.HttpHost.<init>(Unknown Source)
> at org.apache.commons.httpclient.HttpMethodBase.setURI(Unknown
> Source)
> at org.apache.commons.httpclient.HttpMethodBase.<init>(Unknown
> Source)
> at org.apache.commons.httpclient.methods.GetMethod.<init>(Unknown
> Source)
> at
> com.google.appengine.api.urlfetch.dev.LocalURLFetchService$1.buildMethod(LocalURLFetchService.java:93)
> at
> com.google.appengine.api.urlfetch.dev.LocalURLFetchService.fetch(LocalURLFetchService.java:188)
> 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.appengine.tools.development.ApiProxyLocalImpl$AsyncApiCall.call(ApiProxyLocalImpl.java:308)
> at
> com.google.appengine.tools.development.ApiProxyLocalImpl$AsyncApiCall.call(ApiProxyLocalImpl.java:265)
> at java.util.concurrent.Executors$PrivilegedCallable$1.run(Unknown
> Source)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.util.concurrent.Executors$PrivilegedCallable.call(Unknown
> Source)
> at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
> at java.util.concurrent.FutureTask.run(Unknown Source)
> at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown
> Source)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
> at java.lang.Thread.run(Unknown Source)
>
> Any suggestions on how to avoid this issue? Is there a better way to
> access the datastore from within a plain old servlet?
>
> Pasquale


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: EMF / GWT custom datastore usage [message #775006 is a reply to message #773688] Thu, 05 January 2012 05:18 Go to previous message
Pasquale Gervasi is currently offline Pasquale GervasiFriend
Messages: 12
Registered: July 2010
Junior Member
Hi Ed,

Of course NOT! Thanks, that was it.

Btw, amazing job on EMF. I wouldn't have been motivated to start this project without it. Looking forward to your next book on EMF / GWT / Android Smile.

Pasquale
Previous Topic:One way cross document reference to any EObject
Next Topic:How to get factory class name for parameter
Goto Forum:
  


Current Time: Fri Apr 26 15:57:14 GMT 2024

Powered by FUDForum. Page generated in 0.03101 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top