ObjectDB ObjectDB

JBoss 7 startup fails

#1

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"
edit
delete
#2

If you built the project by yourself step by step - maybe you misplaced a directory or a file.

The error message indicates that the guest package in not found by the ObjectDB Enhancer.

Try running the Maven version of this project.

ObjectDB Support
edit
delete
#3

Thanks,

 I downloaded guestbook-web.zip (the maven project) and imported it into eclipse but I now get the following error in pom.xml. The sesction involved is:

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>exec-maven-plugin</artifactId>
    <version>1.2</version>
    <executions>
        <execution> ERROR IS SIGNALLED HERE
            <id>enhance</id>
            <phase>process-classes</phase>
            <goals>
                <goal>java</goal>
            </goals>
            <configuration>
            <mainClass>com.objectdb.Enhancer</mainClass>
            <arguments>
                <argument>guest.Guest</argument>
            </arguments>
            </configuration>
        </execution>
    </executions>
</plugin>

The error message is:

Plugin execution not covered by lifecycle configuration: org.codehaus.mojo:exec-maven-plugin:1.2:java (execution: enhance, phase: process-classes) pom.xml /Guestbook line 59 Maven Project Build Lifecycle Mapping Problem

 

I also have imported other maven projects from jboss but I don't get such errors.

Thanks,

 

Argentino

 

 

edit
delete
#4

Please provide step by step instructions for reproducing these two problems, starting with IDE downloading and installation, plugins installation, etc.

ObjectDB Support
edit
delete
#5

Thanks for you help. Here the requested info:

The eclipse was istalled by downloading a zip file and uncompressing it in /usr/local/eclipseIndigo (in a Linux machine, Ubunti 11.x).

As plugins I installed the JBoss tools 3.3 following the instructions at http://www.jboss.org/tools/download/installation/update_3_3

I attach some files to give more details.

Hope this helps you to understand the problem.

Cheers,

Argentino

 

edit
delete
#6

Thank you for this report. Some adjustments were required in order to make ObjectDB and JBoss AS 7 work together, and build 2.3.0_02 of ObjectDB should work with JBoss 7.

You should use, however, only the Java EE tutorial  - the other web examples can be used on Tomcat, Jetty and GlassFish, but not on JBoss.

A ready to use Maven project is attached. Just import it (File > Import... > Maven > Existing Maven Project) and run it on JBoss 7 (Run As > Run on Server > JBoss 7.0 ...)

ObjectDB Support
edit
delete
#7

Again thanks for your attention.

Still not there though.

Here is the report. I thought I was missing the objectdb-2.3.0_02.jar library but it it correctly deployed in WEB-INF/lib directory.

11:53:24,563 INFO  [org.jboss.modules] JBoss Modules version 1.0.1.GA

11:53:26,740 INFO  [org.jboss.msc] JBoss MSC version 1.0.0.GA
11:53:27,143 INFO  [org.jboss.as] JBoss AS 7.0.1.Final "Zap" starting
11:53:33,450 WARN  [org.jboss.as] No security realm defined for native management service, all access will be unrestricted.
11:53:34,006 INFO  [org.jboss.as] creating http management service using network interface (management) port (9990)
11:53:34,029 WARN  [org.jboss.as] No security realm defined for http management service, all access will be unrestricted.
11:53:34,135 INFO  [org.jboss.as.logging] Removing bootstrap log handlers
11:53:34,316 INFO  [org.jboss.as.connector.subsystems.datasources] (Controller Boot Thread) Deploying JDBC-compliant driver class org.h2.Driver (version 1.2)
11:53:34,435 INFO  [org.jboss.as.clustering.infinispan.subsystem] (Controller Boot Thread) Activating Infinispan subsystem.
11:53:35,388 INFO  [org.jboss.as.naming] (Controller Boot Thread) Activating Naming Subsystem
11:53:35,443 INFO  [org.jboss.as.naming] (MSC service thread 1-3) Starting Naming Service
11:53:35,475 INFO  [org.jboss.as.osgi] (Controller Boot Thread) Activating OSGi Subsystem
11:53:35,667 INFO  [org.jboss.as.security] (Controller Boot Thread) Activating Security Subsystem
11:53:35,728 INFO  [org.jboss.remoting] (MSC service thread 1-3) JBoss Remoting version 3.2.0.Beta2
11:53:35,923 INFO  [org.xnio] (MSC service thread 1-3) XNIO Version 3.0.0.Beta3
11:53:36,071 INFO  [org.xnio.nio] (MSC service thread 1-3) XNIO NIO Implementation Version 3.0.0.Beta3
11:53:38,027 INFO  [org.apache.catalina.core.AprLifecycleListener] (MSC service thread 1-1) 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

11:53:38,135 INFO  [org.jboss.as.jmx.JMXConnectorService] (MSC service thread 1-3) Starting remote JMX connector
11:53:38,197 INFO  [org.jboss.as.ee] (Controller Boot Thread) Activating EE subsystem
11:53:38,210 INFO  [org.jboss.as.remoting] (MSC service thread 1-2) Listening on /127.0.0.1:9999
11:53:39,162 INFO  [org.apache.coyote.http11.Http11Protocol] (MSC service thread 1-2) Starting Coyote HTTP/1.1 on http--127.0.0.1-8080

11:53:40,045 INFO  [org.jboss.as.connector] (MSC service thread 1-2) Starting JCA Subsystem (JBoss IronJacamar 1.0.3.Final)
11:53:40,609 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-3) Bound data source [java:jboss/datasources/ExampleDS]
11:53:42,673 INFO  [org.jboss.as.deployment] (MSC service thread 1-2) Started FileSystemDeploymentService for directory /usr/local/jboss7/standalone/deployments
11:53:42,826 INFO  [org.jboss.as] (Controller Boot Thread) JBoss AS 7.0.1.Final "Zap" started in 20197ms - Started 93 of 148 services (55 services are passive or on-demand)

11:53:42,857 INFO  [org.jboss.as.deployment] (DeploymentScanner-threads - 1) Found Guestbook_Jee.war in deployment directory. To trigger deployment create a file called Guestbook_Jee.war.dodeploy
11:53:43,075 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-1) Starting deployment of "Guestbook_Jee.war"
11:53:45,200 INFO  [org.jboss.jpa] (MSC service thread 1-2) read persistence.xml for GuestbookPU
11:53:45,267 INFO  [org.jboss.as.jpa] (MSC service thread 1-3) added javax.persistence.api, javaee.api, org.jboss.as.jpa, org.javassist dependencies to Guestbook_Jee.war
11:53:45,270 INFO  [org.jboss.as.jpa] (MSC service thread 1-3) added (default provider) org.hibernate dependency to application deployment (since 1 PU(s) didn't specify jboss.as.jpa.providerModule)
11:53:45,271 INFO  [org.jboss.as.jpa] (MSC service thread 1-3) added org.hibernate dependency to application deployment
11:53:45,546 INFO  [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-2) JNDI bindings for session bean named GuestDao in deployment unit deployment "Guestbook_Jee.war" are as follows:

java:global/Guestbook_Jee/GuestDao!guest.GuestDao
java:app/Guestbook_Jee/GuestDao!guest.GuestDao
java:module/GuestDao!guest.GuestDao
java:global/Guestbook_Jee/GuestDao
java:app/Guestbook_Jee/GuestDao
java:module/GuestDao

11:53:46,032 INFO  [org.jboss.as.jpa] (MSC service thread 1-3) Deployment has its own Persistence Provider class com.objectdb.jpa.Provider
11:53:46,840 INFO  [org.jboss.as.server.controller] (DeploymentScanner-threads - 2) Deployment of "Guestbook_Jee.war" was rolled back with failure message {"Services with missing/unavailable dependencies" => ["jboss.persistenceunit.\"Guestbook_Jee.war#GuestbookPU\" missing [ jboss.data-source.java:/ ]"]}
11:53:46,936 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-4) Stopped deployment Guestbook_Jee.war in 129ms
11:53:46,945 ERROR [org.jboss.as.deployment] (DeploymentScanner-threads - 1) {"Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-2" => {"Services with missing/unavailable dependencies" => ["jboss.persistenceunit.\"Guestbook_Jee.war#GuestbookPU\" missing [ jboss.data-source.java:/ ]"]}}}

Ciao,

Argentino

edit
delete
#8

Could you please try JBoss 7.0.2.Final - the attached Maven project works well on it.

Another idea - try to define a dummy jta data source. As explained in this forum thread:

  • A JTA data source is ignored by ObjectDB but is required by JBoss. See the attached persistence.xml file. If the IDE requires specifying SQL driver, etc - specify default settings (anything that is acceptable) and later, if necessary, edit the persistence.xml file manually, following the attached sample file.

For example:

<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>

I wonder if this might be the result of using different JBoss versions.

ObjectDB Support
edit
delete
#9

Again, many thanks for your efforts.

In the end it worked inserting the following datasource in pesistence.xml

<jta-data-source>java:jboss/datasources/ExampleDS</jta-data-source>

 

Thanks for the grat help.

Ciao

Argentino

edit
delete
#10

Hi,

I m having the same problem using the same jboss as 7 and eclipse and I tried everything argentino did but the problem continues.

The files are attached.


Thanks in advance.

 

 

edit
delete
#11

This is a JBoss problem rather than an ObjectDB problem (JBoss fails on NullPointerException according to your stack trace). It affects using JBoss 7.0.0 with EclipseLink as well:

https://community.jboss.org/message/615081

https://community.jboss.org/thread/169944

You are using JBoss 7.0.0. Try JBoss 7.0.2 that may fix it.

ObjectDB Support
edit
delete
#12

It works. Thanks for the reply

edit
delete

Reply

To post on this website please sign in.