I am trying to setup my first PlayORM project. I have a single EAR file, which is where the playorm library and all dependencies are located. Included within the EAR, I have a single WAR project. I have created a nosql.Persistence class within the WAR, and have defined my entity class. I am using the in-memory datastore support since this is just my first test. However, when I attempt to persist a simple test entity value I see an exception. The code to persist looks like this:
Map<String, Object> properties = new HashMap<String, Object>();
properties.put(Bootstrap.AUTO_CREATE_KEY, "create");
NoSqlEntityManagerFactory factory = Bootstrap.create(
DbTypeEnum.IN_MEMORY, properties, null, null);
NoSqlEntityManager mgr = factory.createEntityManager();
EntityA entA = new EntityA();
entA.setFieldA("FieldAVal1");
entA.setFieldB("FeildBVal1");
entA.setFieldC(300);
entA.setId(UUID.randomUUID().toString());
mgr.put(entA);
mgr.flush();
The Exception that I get when calling Bootstrap.create() looks like this:
[0m21:47:22,922 INFO [com.alvazan.orm.logging.NoSqlRawLogger] (http-/0.0.0.0:8080-1) [rawlogger] starting NoSQL Service Provider and connecting
[0m[0m21:47:22,937 INFO [com.alvazan.orm.layer0.base.BaseEntityManagerFactoryImpl] (http-/0.0.0.0:8080-1) Begin scanning for jars with nosql.Persistence.class
[0m[31m21:47:22,938 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/playpoc].[com.test.web.TestServlet]] (http-/0.0.0.0:8080-1) JBWEB000236: Servlet.service() for servlet com.test.web.TestServlet threw exception: java.lang.RuntimeException: protocol of=vfs is not supported for loading classfiles, let me know and I can fix that
at com.impetus.annovention.ClasspathDiscoverer.findResources(ClasspathDiscoverer.java:86) [playorm-1.6.jar:]
at com.impetus.annovention.Discoverer.discover(Discoverer.java:143) [playorm-1.6.jar:]
at com.alvazan.orm.layer0.base.BaseEntityManagerFactoryImpl.rescan(BaseEntityManagerFactoryImpl.java:82) [playorm-1.6.jar:]
at com.alvazan.orm.layer0.base.BaseEntityManagerFactoryImpl.setup(BaseEntityManagerFactoryImpl.java:140) [playorm-1.6.jar:]
at com.alvazan.orm.impl.bindings.BootstrapImpl.createInstanceImpl(BootstrapImpl.java:67) [playorm-1.6.jar:]
at com.alvazan.orm.impl.bindings.BootstrapImpl.createInstance(BootstrapImpl.java:38) [playorm-1.6.jar:]
at com.alvazan.orm.api.base.Bootstrap.create(Bootstrap.java:66) [playorm-1.6.jar:]
at com.alvazan.orm.api.base.Bootstrap.create(Bootstrap.java:61) [playorm-1.6.jar:]
at com.test.web.TestServlet.processRequest(TestServlet.java:56) [classes:]
at com.test.web.TestServlet.doGet(TestServlet.java:40) [classes:]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:734) [jboss-servlet-api_3.0_spec-1.0.2.Final-redhat-1.jar:1.0.2.Final-redhat-1]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.2.Final-redhat-1.jar:1.0.2.Final-redhat-1]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:295) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:149) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]
at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:169) [jboss-as-web-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:145) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:97) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:102) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:336) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:653) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:920) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]
at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_07]
I am running this on JBoss EAP 6.1, using PlayORM 1.6. Can anyone explain what is going on here and why this simple test doesn't work?
PlayOrm uses a 3rd party library called annovention which some slight modifications. This library supported file:// and jar:// as most class files are in jars and files so we need to figure out how to make it work for vfs. It should not be that hard to fix, but we need to get to it. I am sorry for the inconvenience. We will try to fix this by the beginning of next week as Jboss is a pretty big app server out there.
thanks, Dean