Hi, I was having a go with entity beans 3.x jboss 7, objectdb and the guestbook web application but cannot come out of the swamp.
I use eclipse indigo as IDE
The "src" folder contains the pachake guest and within the classes: Guest.java, GuestListener.java and GuestServlet.java
The WebContent/META-INF dir contains:
context.xml
<?xml version="1.0" encoding="UTF-8"?> <Context antiJARLocking="true" path="/Guestbook"/>
persistence.xml
<persistence version="2.0" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"> <persistence-unit name="GuestbookPU" transaction-type="JTA"> <provider>com.objectdb.jpa.Provider</provider> <jta-data-source>java:/DefaultDS</jta-data-source> <properties> <property name="javax.persistence.jdbc.url" value="$objectdb/db/guests.odb"/> <property name="javax.persistence.jdbc.user" value="admin"/> <property name="javax.persistence.jdbc.password" value="admin"/> </properties> </persistence-unit> </persistence>
The WebContent/WEB-INF/lib dir contains:
objectdb-jee.jar
The WebContent/WEB-INF/web.xml contains:
<?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5"> <display-name>Guestbook</display-name> <welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list> <listener> <listener-class>guest.GuestListener</listener-class> </listener> <servlet> <description></description> <display-name>GuestServlet</display-name> <servlet-name>GuestServlet</servlet-name> <servlet-class>guest.GuestServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>GuestServlet</servlet-name> <url-pattern>/GuestServlet</url-pattern> </servlet-mapping> </web-app>
The WebContent dir contains:
guest.jsp, index.jsp
Did any one have a go at Jboss 7 and succeed? If so any advice i l helpful
Here is the stack trace
13:49:11,894 INFO [org.jboss.modules] JBoss Modules version 1.0.1.GA 13:49:14,316 INFO [org.jboss.msc] JBoss MSC version 1.0.0.GA 13:49:14,719 INFO [org.jboss.as] JBoss AS 7.0.1.Final "Zap" starting 13:49:21,432 WARN [org.jboss.as] No security realm defined for native management service, all access will be unrestricted. 13:49:21,562 INFO [org.jboss.as] creating http management service using network interface (management) port (9990) 13:49:22,254 WARN [org.jboss.as] No security realm defined for http management service, all access will be unrestricted. 13:49:22,414 INFO [org.jboss.as.logging] Removing bootstrap log handlers 13:49:22,697 INFO [org.jboss.as.connector.subsystems.datasources] (Controller Boot Thread) Deploying JDBC-compliant driver class org.h2.Driver (version 1.2) 13:49:22,868 INFO [org.jboss.as.clustering.infinispan.subsystem] (Controller Boot Thread) Activating Infinispan subsystem. 13:49:23,900 INFO [org.jboss.as.naming] (Controller Boot Thread) Activating Naming Subsystem 13:49:23,954 INFO [org.jboss.as.naming] (MSC service thread 1-2) Starting Naming Service 13:49:23,989 INFO [org.jboss.as.osgi] (Controller Boot Thread) Activating OSGi Subsystem 13:49:24,188 INFO [org.jboss.as.security] (Controller Boot Thread) Activating Security Subsystem 13:49:24,299 INFO [org.jboss.remoting] (MSC service thread 1-1) JBoss Remoting version 3.2.0.Beta2 13:49:24,513 INFO [org.xnio] (MSC service thread 1-1) XNIO Version 3.0.0.Beta3 13:49:24,685 INFO [org.xnio.nio] (MSC service thread 1-1) XNIO NIO Implementation Version 3.0.0.Beta3 13:49:26,596 INFO [org.apache.catalina.core.AprLifecycleListener] (MSC service thread 1-3) The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/local/jdk1.6.0_26/jre/lib/i386/server:/usr/local/jdk1.6.0_26/jre/lib/i386:/usr/local/jdk1.6.0_26/jre/../lib/i386:/usr/lib/jvm/java-6-openjdk/jre/lib/i386/client:/usr/lib/jvm/java-6-openjdk/jre/lib/i386::/usr/java/packages/lib/i386:/lib:/usr/lib 13:49:26,638 INFO [org.jboss.as.jmx.JMXConnectorService] (MSC service thread 1-1) Starting remote JMX connector 13:49:26,703 INFO [org.jboss.as.ee] (Controller Boot Thread) Activating EE subsystem 13:49:26,858 INFO [org.jboss.as.remoting] (MSC service thread 1-2) Listening on /127.0.0.1:9999 13:49:27,899 INFO [org.apache.coyote.http11.Http11Protocol] (MSC service thread 1-2) Starting Coyote HTTP/1.1 on http--127.0.0.1-8080 13:49:28,442 INFO [org.jboss.as.connector] (MSC service thread 1-4) Starting JCA Subsystem (JBoss IronJacamar 1.0.3.Final) 13:49:28,835 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-4) Bound data source [java:jboss/datasources/ExampleDS] 13:49:34,851 INFO [org.jboss.as.deployment] (MSC service thread 1-2) Started FileSystemDeploymentService for directory /usr/local/jboss7/standalone/deployments 13:49:34,888 INFO [org.jboss.as.deployment] (DeploymentScanner-threads - 1) Found Guestbook_ObjectDB_web.war in deployment directory. To trigger deployment create a file called Guestbook_ObjectDB_web.war.dodeploy 13:49:34,984 INFO [org.jboss.as] (Controller Boot Thread) JBoss AS 7.0.1.Final "Zap" started in 25327ms - Started 93 of 148 services (55 services are passive or on-demand) 13:49:35,086 INFO [org.jboss.as.server.deployment] (MSC service thread 1-3) Starting deployment of "Guestbook_ObjectDB_web.war" 13:49:36,719 INFO [org.jboss.as.jpa] (MSC service thread 1-1) added javax.persistence.api dependency to Guestbook_ObjectDB_web.war 13:49:37,259 INFO [org.jboss.as.jpa] (MSC service thread 1-4) Deployment has its own Persistence Provider class com.objectdb.jpa.Provider 13:49:37,703 ERROR [stderr] (MSC service thread 1-3) 13:49:37,704 ERROR [stderr] (MSC service thread 1-3) [ObjectDB 2.2.9_12] Package guest is not found by the enhancer (error 108) 13:49:37,705 ERROR [stderr] (MSC service thread 1-3) com.objectdb.o.UserException: Package guest is not found by the enhancer 13:49:37,706 ERROR [stderr] (MSC service thread 1-3) at com.objectdb.o.MSG.d(MSG.java:61) 13:49:37,707 ERROR [stderr] (MSC service thread 1-3) at com.objectdb.o.JEL.z(JEL.java:414) 13:49:37,707 ERROR [stderr] (MSC service thread 1-3) at com.objectdb.o.JEN.k(JEN.java:90) 13:49:37,708 ERROR [stderr] (MSC service thread 1-3) at com.objectdb.Enhancer.enhance(Enhancer.java:66) 13:49:37,709 ERROR [stderr] (MSC service thread 1-3) at com.objectdb.Enhancer.enhance(Enhancer.java:87) 13:49:37,710 ERROR [stderr] (MSC service thread 1-3) at guest.GuestListener.contextInitialized(GuestListener.java:10) 13:49:37,710 ERROR [stderr] (MSC service thread 1-3) at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3368) 13:49:37,711 ERROR [stderr] (MSC service thread 1-3) at org.apache.catalina.core.StandardContext.start(StandardContext.java:3821) 13:49:37,712 ERROR [stderr] (MSC service thread 1-3) at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:70) 13:49:37,712 ERROR [stderr] (MSC service thread 1-3) at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1765) 13:49:37,713 ERROR [stderr] (MSC service thread 1-3) at org.jboss.msc.service.ServiceControllerImpl$ClearTCCLTask.run(ServiceControllerImpl.java:2291) 13:49:37,714 ERROR [stderr] (MSC service thread 1-3) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) 13:49:37,714 ERROR [stderr] (MSC service thread 1-3) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) 13:49:37,715 ERROR [stderr] (MSC service thread 1-3) at java.lang.Thread.run(Thread.java:662) 13:49:48,914 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/Guestbook_ObjectDB_web]] (MSC service thread 1-3) Exception sending context initialized event to listener instance of class guest.GuestListener: javax.persistence.PersistenceException: No Persistence provider for EntityManager named $objectdb/db/guest.odb at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:69) [hibernate-jpa-2.0-api-1.0.1.Final.jar:1.0.1.Final] at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:47) [hibernate-jpa-2.0-api-1.0.1.Final.jar:1.0.1.Final] at guest.GuestListener.contextInitialized(GuestListener.java:11) [classes:] at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3368) [jbossweb-7.0.1.Final.jar:7.0.1.Final] at org.apache.catalina.core.StandardContext.start(StandardContext.java:3821) [jbossweb-7.0.1.Final.jar:7.0.1.Final] at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:70) [jboss-as-web-7.0.1.Final.jar:7.0.1.Final] at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1765) at org.jboss.msc.service.ServiceControllerImpl$ClearTCCLTask.run(ServiceControllerImpl.java:2291) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_26] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_26] at java.lang.Thread.run(Thread.java:662) [:1.6.0_26] 13:49:49,154 ERROR [org.apache.catalina.core.StandardContext] (MSC service thread 1-3) Error listenerStart 13:49:49,155 ERROR [org.apache.catalina.core.StandardContext] (MSC service thread 1-3) Context [/Guestbook_ObjectDB_web] startup failed due to previous errors 13:49:49,215 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/Guestbook_ObjectDB_web]] (MSC service thread 1-3) Exception sending context destroyed event to listener instance of class guest.GuestListener: java.lang.NullPointerException at guest.GuestListener.contextDestroyed(GuestListener.java:20) [classes:] at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:3465) [jbossweb-7.0.1.Final.jar:7.0.1.Final] at org.apache.catalina.core.StandardContext.stop(StandardContext.java:3970) [jbossweb-7.0.1.Final.jar:7.0.1.Final] at org.apache.catalina.core.StandardContext.start(StandardContext.java:3888) [jbossweb-7.0.1.Final.jar:7.0.1.Final] at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:70) [jboss-as-web-7.0.1.Final.jar:7.0.1.Final] at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1765) at org.jboss.msc.service.ServiceControllerImpl$ClearTCCLTask.run(ServiceControllerImpl.java:2291) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_26] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_26] at java.lang.Thread.run(Thread.java:662) [:1.6.0_26] 13:49:49,233 INFO [org.jboss.web] (MSC service thread 1-3) registering web context: /Guestbook_ObjectDB_web 13:49:49,485 INFO [org.jboss.as.server.controller] (DeploymentScanner-threads - 2) Deployed "Guestbook_ObjectDB_web.war"