2 Replies Latest reply on Apr 17, 2008 12:11 PM by Mattias Borgkvist

    Jboss JPA Config

    Mattias Borgkvist Newbie

      Hi,

      Do anyone have time to sort this out once and for all? I know this has been discussed several times, but different websites and forums have different answers. I'm getting the following error when deploying a small ejb3 project:

      --- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
      ObjectName: persistence.units:unitName=tinyphotoalbum
       State: NOTYETINSTALLED
       Depends On Me:
       jboss.j2ee:jar=ImageServices.jar,name=ImageDetailManagementBean,service=EJB3
      


      The jarfile/META-INF/persistance.xml looks like:
      <?xml version="1.0" encoding="UTF-8" ?>
      <persistence xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
       version="1.0" xmlns="http://java.sun.com/xml/ns/persistence">
      
       <persistence-unit name="tinyphotoalbum">
       <jta-data-source>java:/MySqlDS</jta-data-source>
       <class>se.hexabit.tinyphotoalbum.beans.ImageDetails</class>
       <properties>
       <property name="hibernate.archive.autodetection" value="class, hbm"/>
       <property name="hibernate.show_sql" value="true"/>
       <property name="hibernate.connection.driver_class" value="com.mysql.jdbc.Driver"/>
       <property name="hibernate.connection.password" value="tinyphotoalbum"/>
       <property name="hibernate.connection.url" value="jdbc:mysql://192.168.0.138:3306/TinyPhotoAlbum"/>
       <property name="hibernate.connection.username" value="tinyphotoalbum"/>
       <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>
       </properties>
       </persistence-unit>
      </persistence>
      


      And the JBOSS_HOME\server\default\deploy\mysql-ds.xml:
      <?xml version="1.0" encoding="UTF-8"?>
      <datasources>
       <local-tx-datasource>
       <jndi-name>MySqlDS</jndi-name>
       <connection-url>jdbc:mysql://192.168.0.138:3306/TinyPhotoAlbum</connection-url>
       <driver-class>com.mysql.jdbc.Driver</driver-class>
       <user-name>tinyphotoalbum</user-name>
       <password>tinyphotoalbum</password>
       <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter</exception-sorter-class-name>
       <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml -->
       <metadata>
       <type-mapping>mySQL</type-mapping>
       </metadata>
       </local-tx-datasource>
      </datasources>
      


      Finnally i placed the driver in the lib-dir as:
      JBOSS_HOME\server\default\lib\mysql-connector-java-5.1.6-bin.jar

      Is there any more configuration that needs to be done?

      BR,
      Mattias

        • 1. Re: Jboss JPA Config
          Peter Johnson Master

          The "error" you posted is a summary report of deployments that failed. The actual reason for why the deployment failed is in a stack trace earlier in the console output. Please post that stack trace.

          By the way, you do not need the "hibernate.connection.*" parameters in persistence.xml. You only need those if Hibernate will directly open the database, but you are going through the MySqlDS data source that you set up, and that data source already contains that information.

          • 2. Re: Jboss JPA Config
            Mattias Borgkvist Newbie

            Hi, Sorry for the late response. Here is the stacktrace:

            17:55:33,125 INFO [JmxKernelAbstraction] installing MBean: jboss.j2ee:jar=ImageServices.jar,name=ImageDetailManagementBean,service=EJB3 with dependencies:
            17:55:33,125 INFO [JmxKernelAbstraction] persistence.units:unitName=tinyphotoalbum
            17:55:33,125 INFO [EJB3Deployer] Deployed: file:/C:/Program/jboss-4.2.2.GA/server/default/deploy/ImageServices.jar
            17:55:33,234 INFO [DefaultEndpointRegistry] register: jboss.ws:context=ImageServices,endpoint=ImageDetailManagementBean
            17:55:35,125 INFO [WSDLFilePublisher] WSDL published to: file:/C:/Program/jboss-4.2.2.GA/server/default/data/wsdl/ImageServices.jar/ImageDetailManagementBeanService30693.wsdl
            17:55:35,234 INFO [TomcatDeployer] deploy, ctxPath=/ImageServices, warUrl=.../tmp/deploy/ImageServices.jar30692.war/
            17:55:35,328 ERROR [MainDeployer] Could not start deployment: file:/C:/Program/jboss-4.2.2.GA/server/default/deploy/ImageServices.jar
            javax.xml.ws.WebServiceException: Cannot find service endpoint target: jboss.j2ee:name=ImageDetailManagementBean,service=EJB3,jar=ImageServices.jar
             at org.jboss.wsf.container.jboss42.InvocationHandlerEJB3.init(InvocationHandlerEJB3.java:83)
             at org.jboss.wsf.framework.deployment.DefaultLifecycleHandler.create(DefaultLifecycleHandler.java:51)
             at org.jboss.wsf.framework.deployment.EndpointLifecycleDeploymentAspect.create(EndpointLifecycleDeploymentAspect.java:42)
             at org.jboss.wsf.framework.deployment.DeploymentAspectManagerImpl.deploy(DeploymentAspectManagerImpl.java:115)
             at org.jboss.wsf.container.jboss42.ArchiveDeployerHook.deploy(ArchiveDeployerHook.java:97)
             at org.jboss.wsf.container.jboss42.DeployerInterceptor.start(DeployerInterceptor.java:90)
             at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.start(SubDeployerInterceptorSupport.java:188)
             at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:95)
             at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
             at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
             at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
             at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
             at $Proxy34.start(Unknown Source)
             at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
             at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
             at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
             at sun.reflect.GeneratedMethodAccessor20.invoke(Unknown Source)
             at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
             at java.lang.reflect.Method.invoke(Method.java:585)
             at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
             at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
             at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
             at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
             at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
             at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
             at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
             at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
             at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
             at $Proxy9.deploy(Unknown Source)
             at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
             at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)
             at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
             at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:336)
             at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
             at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
             at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
             at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
             at java.lang.reflect.Method.invoke(Method.java:585)
             at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
             at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
             at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
             at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
             at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
             at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
             at $Proxy0.start(Unknown Source)
             at org.jboss.system.ServiceController.start(ServiceController.java:417)
             at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
             at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
             at java.lang.reflect.Method.invoke(Method.java:585)
             at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
             at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
             at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
             at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
             at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
             at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
             at $Proxy4.start(Unknown Source)
             at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)
             at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
             at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
             at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
             at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:766)
             at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
             at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
             at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
             at java.lang.reflect.Method.invoke(Method.java:585)
             at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
             at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
             at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
             at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
             at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
             at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
             at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
             at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
             at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
             at $Proxy5.deploy(Unknown Source)
             at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482)
             at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)
             at org.jboss.Main.boot(Main.java:200)
             at org.jboss.Main$1.run(Main.java:508)
             at java.lang.Thread.run(Thread.java:595)
            


            BR,
            Mattias