facebook

[Closed] Hibernate/JBoss deployment error

💡
Our Forums Have Moved

For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub

  1. MyEclipse Archived
  2.  > 
  3. Application Servers and Deployment
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #241914 Reply

    yiannp77
    Member

    Hello to you all. I have the following problem and i could use some help if you have any clue.

    I m using MyEclipse Version: 4.0.1 Build id: 20050930-4.0.1-GA with eclipse 3.1 and JBoss 4.0.3Sp1 as an application server and WinXp as the operating system. I had a little web application which was working with CMP ejbs 2.0 so i was thinking it would be nice to use hibernate instead of entity ejbs. So i added to that project hibernate cababilities and i configured my hibernate.cfg.xml to use JNDI datasource the same the entity beans were using and also bind the SessionFactory with JNDI this is how the xml look likes

    <?xml version=’1.0′ encoding=’UTF-8′?>
    <!DOCTYPE hibernate-configuration PUBLIC
    “-//Hibernate/Hibernate Configuration DTD 3.0//EN”
    http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd”&gt;

    <!– Generated by MyEclipse Hibernate Tools. –>
    <hibernate-configuration>

    <session-factory>
    <property name=”connection.datasource”>
    java:/mdbDS
    </property>
    <property name=”jndi.url”></property>
    <property name=”jndi.class”></property>
    <property name=”dialect”>
    org.hibernate.dialect.SQLServerDialect
    </property>
    <property name=”connection.username”>sa</property>
    <property name=”session_factory_name”>com/mdb/HLib/SessionFactory</property>
    <property name=”transaction.factory_class”>org.hibernate.transaction.JTATransactionFactory</property>
    <property name=”transaction.manager_lookup_class”>org.transaction.JBossTransactionManagerLookup</property>
    <property name=”show_sql”>true</property>
    <mapping resource=”com/mdb/interfaces/ActorData.hbm.xml” />
    <mapping resource=”com/mdb/interfaces/CategoryData.hbm.xml” />
    <mapping resource=”com/mdb/interfaces/DirectorData.hbm.xml” />
    <mapping resource=”com/mdb/interfaces/MovieData.hbm.xml” />

    </session-factory>

    </hibernate-configuration>

    Tell me if there any mistake on it. Anyway i try to deploy this thing to jboss but the deply failed with the following message

    16:07:58,582 INFO [EARDeployer] Init J2EE application: file:/C:/jboss-4.0.3/ser
    ver/default/deploy/mdb.ear/
    16:08:00,661 INFO [EjbModule] Deploying MdbManager
    16:08:00,832 INFO [BaseLocalProxyFactory] Bound EJB LocalHome ‘MdbManager’ to j
    ndi ‘MdbManagerLocal’
    16:08:00,848 INFO [ProxyFactory] Bound EJB Home ‘MdbManager’ to jndi ‘ejb/MdbMa
    nager’
    16:08:00,864 INFO [EJBDeployer] Deployed: file:/C:/jboss-4.0.3/server/default/d
    eploy/mdb.ear/mdbEJB.jar/
    16:08:00,911 INFO [TomcatDeployer] deploy, ctxPath=/mdbWeb, warUrl=…/deploy/m
    db.ear/mdbWeb.war/
    16:08:00,957 ERROR [Digester] Begin event threw exception
    org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging
    .LogConfigurationException: org.apache.commons.logging.LogConfigurationException
    : Class org.apache.commons.logging.impl.Log4JLogger does not implement Log
    at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactory
    Impl.java:532)
    at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactory
    Impl.java:272)
    at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactory
    Impl.java:246)
    at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:398)
    at org.apache.catalina.session.ManagerBase.<init>(ManagerBase.java:63)
    at org.apache.catalina.session.StandardManager.<init>(StandardManager.ja
    va:64)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstruct
    orAccessorImpl.java:39)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingC
    onstructorAccessorImpl.java:27)

    I m not writting the whole message b/c its huge

    #241979

    Riyad Kalla
    Member

    So it looks like a problem instantiating a commons-logging logger. I believe this is probably the case that adding HIbernate capabilities adding a different version of commons-logging than the one that JBoss provides. You can try removing commons-logging from your WEB-INF/lib directory of your project and redeploy it and see if that works.

    #241988

    yiannp77
    Member

    Well i have tried that and not result 😕 i also tried pretty much everything and then after i was really tired i went to the source which is the manual of JBoss for this release (4.0.3). Well this document says that hibernate is a core part of the server. If you see the lib folder of the JBoss AS 4.0.3 you would find all the jars for hibernate 3.1. Also says that hibernate is ready to go since there is inside the server a service mbean that only need a *-service.xml inside the ear to offer hibernate to every application inside jboss binded with jndi. Well i followed all the steps described there and still i had errors. Then i thinked that if hibernate is core to the application server then its wrong to have hibernate capabilities to my project. So i removed from the ejb package all the jars and everything else of hibernate and i only left the mappings files, an hibernate-service.xml inside the ear that has the jndi datasource of the database and the jndi name of the SessionManager and an other xml file called jboss-app.xml which has this hibernate-service.xml inside a module tag. After this indeed the Hibernate 3.1 was deployed to my application server but now i have the following error stack trace

    03:10:16,109 INFO [ConnectionFactoryBindingService] Bound ConnectionManager ‘jb
    oss.jca:service=DataSourceBinding,name=mdbDS’ to JNDI name ‘java:mdbDS’
    03:10:16,203 INFO [TomcatDeployer] deploy, ctxPath=/jmx-console, warUrl=…/dep
    loy/jmx-console.war/
    03:10:16,375 INFO [EARDeployer] Init J2EE application: file:/C:/jboss-4.0.3/ser
    ver/default/deploy/mdb.ear/
    03:10:16,828 INFO [EjbModule] Deploying MdbManager
    03:10:17,031 INFO [Environment] Hibernate 3.1
    03:10:17,046 INFO [Environment] hibernate.properties not found
    03:10:17,046 INFO [Environment] using CGLIB reflection optimizer
    03:10:17,046 INFO [Environment] using JDK 1.4 java.sql.Timestamp handling
    03:10:17,156 INFO [Configuration] Reading mappings from file: C:\jboss-4.0.3\se
    rver\default\deploy\mdb.ear\mdbEJB.jar\com\mdb\interfaces\ActorData.hbm.xml
    03:10:17,171 WARN [ServiceController] Problem starting service jboss.adminguide
    :name=HibernateFactory
    org.hibernate.MappingException: Could not read mapping document from file: C:\jb
    oss-4.0.3\server\default\deploy\mdb.ear\mdbEJB.jar\com\mdb\interfaces\ActorData.
    hbm.xml
    at org.hibernate.cfg.Configuration.addFile(Configuration.java:263)
    at org.hibernate.cfg.Configuration.addDirectory(Configuration.java:574)
    at org.hibernate.cfg.Configuration.addDirectory(Configuration.java:571)
    at org.hibernate.cfg.Configuration.addDirectory(Configuration.java:571)
    at org.hibernate.cfg.Configuration.addDirectory(Configuration.java:571)
    at org.hibernate.cfg.Configuration.addDirectory(Configuration.java:571)
    at org.jboss.hibernate.jmx.Hibernate.handleMappings(Hibernate.java:292)
    at org.jboss.hibernate.jmx.Hibernate.buildSessionFactory(Hibernate.java:
    189)
    at org.jboss.hibernate.jmx.Hibernate.startService(Hibernate.java:131)
    at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanS
    upport.java:274)
    at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMB
    eanSupport.java:230)
    at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
    sorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatch
    er.java:141)
    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
    at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
    at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.
    java:245)
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
    at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceControl
    ler.java:943)
    at $Proxy0.start(Unknown Source)
    at org.jboss.system.ServiceController.start(ServiceController.java:428)
    at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
    sorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatch
    er.java:141)
    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
    at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
    at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.
    java:245)
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
    at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
    at $Proxy4.start(Unknown Source)
    at org.jboss.deployment.SARDeployer.start(SARDeployer.java:285)
    at org.jboss.deployment.MainDeployer.start(MainDeployer.java:989)
    at org.jboss.deployment.MainDeployer.start(MainDeployer.java:979)
    at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:790)
    at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:753)
    at sun.reflect.GeneratedMethodAccessor8.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
    sorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatch
    er.java:141)
    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
    at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractIntercept
    or.java:118)
    at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
    at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelM
    BeanOperationInterceptor.java:127)
    at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
    at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.
    java:245)
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
    at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
    at $Proxy6.deploy(Unknown Source)
    at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymen
    tScanner.java:319)
    at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentS
    canner.java:507)
    at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
    doScan(AbstractDeploymentScanner.java:192)
    at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(A
    bstractDeploymentScanner.java:265)
    at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanS
    upport.java:274)
    at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMB
    eanSupport.java:230)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
    java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
    sorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatch
    er.java:141)
    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
    at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
    at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.
    java:245)
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
    at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceControl
    ler.java:943)
    at $Proxy0.start(Unknown Source)
    at org.jboss.system.ServiceController.start(ServiceController.java:428)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
    java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
    sorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatch
    er.java:141)
    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
    at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
    at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.
    java:245)
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
    at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
    at $Proxy4.start(Unknown Source)
    at org.jboss.deployment.SARDeployer.start(SARDeployer.java:285)
    at org.jboss.deployment.MainDeployer.start(MainDeployer.java:989)
    at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:790)
    at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:753)
    at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:737)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
    java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
    sorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatch
    er.java:141)
    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
    at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractIntercept
    or.java:118)
    at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
    at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelM
    BeanOperationInterceptor.java:127)
    at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
    at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.
    java:245)
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
    at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
    at $Proxy5.deploy(Unknown Source)
    at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:453)
    at org.jboss.system.server.ServerImpl.start(ServerImpl.java:330)
    at org.jboss.Main.boot(Main.java:187)
    at org.jboss.Main$1.run(Main.java:438)
    at java.lang.Thread.run(Thread.java:595)
    Caused by: org.hibernate.MappingException: Could not parse mapping document in i
    nput stream
    at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:422
    )
    at org.hibernate.cfg.Configuration.addFile(Configuration.java:260)
    … 102 more
    Caused by: org.dom4j.DocumentException: C:\jboss-4.0.3\bin\hibernate-mapping-3.0
    .dtd Nested exception: C:\jboss-4.0.3\bin\hibernate-mapping-3.0.dtd
    at org.dom4j.io.SAXReader.read(SAXReader.java:484)
    at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:413
    )
    … 103 more
    03:10:17,265 INFO [BaseLocalProxyFactory] Bound EJB LocalHome ‘MdbManager’ to j
    ndi ‘MdbManagerLocal’
    03:10:17,296 INFO [ProxyFactory] Bound EJB Home ‘MdbManager’ to jndi ‘ejb/MdbMa
    nager’
    03:10:17,296 INFO [EJBDeployer] Deployed: file:/C:/jboss-4.0.3/server/default/d
    eploy/mdb.ear/mdbEJB.jar/
    03:10:17,359 INFO [TomcatDeployer] deploy, ctxPath=/mdbWeb, warUrl=…/deploy/m
    db.ear/mdbWeb.war/
    03:10:17,734 INFO [PropertyMessageResources] Initializing, config=’org.apache.s
    truts.util.LocalStrings’, returnNull=true
    03:10:17,734 INFO [PropertyMessageResources] Initializing, config=’org.apache.s
    truts.action.ActionResources’, returnNull=true
    03:10:18,000 INFO [PropertyMessageResources] Initializing, config=’com.mdb.stru
    ts.ApplicationResources’, returnNull=true
    03:10:18,031 INFO [EARDeployer] Started J2EE application: file:/C:/jboss-4.0.3/
    server/default/deploy/mdb.ear/
    03:10:18,046 ERROR [URLDeploymentScanner] Incomplete Deployment listing:

    — MBeans waiting for other MBeans —
    ObjectName: jboss.adminguide:name=HibernateFactory
    State: FAILED
    Reason: org.hibernate.MappingException: Could not read mapping document from f
    ile: C:\jboss-4.0.3\server\default\deploy\mdb.ear\mdbEJB.jar\com\mdb\interfaces\
    ActorData.hbm.xml

    — MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM —
    ObjectName: jboss.adminguide:name=HibernateFactory
    State: FAILED
    Reason: org.hibernate.MappingException: Could not read mapping document from f
    ile: C:\jboss-4.0.3\server\default\deploy\mdb.ear\mdbEJB.jar\com\mdb\interfaces\
    ActorData.hbm.xml

    03:10:18,125 INFO [Http11Protocol] Starting Coyote HTTP/1.1 on http-0.0.0.0-808
    0
    03:10:18,375 INFO [ChannelSocket] JK: ajp13 listening on /0.0.0.0:8009
    03:10:18,390 INFO [JkMain] Jk running ID=0 time=0/125 config=null
    03:10:18,421 INFO [Server] JBoss (MX MicroKernel) [4.0.3SP1 (build: CVSTag=JBos
    s_4_0_3_SP1 date=200510231751)] Started in 19s:968ms

    Something is wrong with the mapping file. Well for debuging reason i have only 1 mapping file and its really simple

    <?xml version=”1.0″?>
    <!DOCTYPE hibernate-mapping PUBLIC “-//Hibernate/Hibernate Mapping DTD 3.0//EN” “hibernate-mapping-3.0.dtd”>

    <hibernate-mapping>

    <class name=”com.mdb.interfaces.ActorData” table=”ACTOR” >
    <id name=”id” column=”id” type=”long” >
    <generator class=”increment” />
    </id>
    <property name=”aname” column=”aname” type=”string” />
    <property name=”asurname” column=”asurname” type=”string” />
    </class>

    </hibernate-mapping>

    This mapping file was generated by xdoclet and even if i put an other mapping file of an other class its the same. If i remove every mapping xml then there is no error and the hibernate deploy regularly

    I dont have a clue about this 🙁

    #242015

    yiannp77
    Member

    Well i solve it. I deploy the ear as a package and not exploaded and now everything is normal. Jboss hibernate jmx mbean cant read an exploaded ear.

    #242017

    Riyad Kalla
    Member

    Glad to hear it is working now, thank you for following up.

Viewing 5 posts - 1 through 5 (of 5 total)
Reply To: [Closed] Hibernate/JBoss deployment error

You must be logged in to post in the forum log in