[JBoss Tools (users)] - Problem with JBoss AS 5.0.0CR1
by baz
I do have a problem with JBoss AS5.
datasource is accessed via JNDI before it is even bound
My environment
Win XP SP2
Java 1.5.0 10
Seam 2.0.3.CR1 (This should include compatibility patches for AS5.0)
richfaces-ui-3.2.1.GA
JBT 2.1.1
The story:
Created a Seam project with JBT 2.1.1 (mysql database)
and deployed it successfully to JB AS 4.2.2GA
Created a server for 5.0.0.CR1
Deployed the above mentioned project to it.
The problem is a kind of ordering:
| 07:15:58,703 INFO [Contexts] starting up: prunusEntityManagerFactory
| 07:15:58,859 INFO [Version] Hibernate Annotations 3.4.0.CR1
| 07:15:58,890 INFO [Environment] Hibernate 3.3.0.CR1
| 07:15:58,906 INFO [Environment] hibernate.properties not found
| 07:15:58,921 INFO [Environment] Bytecode provider name : javassist
| 07:15:58,937 INFO [Environment] using JDK 1.4 java.sql.Timestamp handling
| 07:15:59,125 INFO [Version] Hibernate Commons Annotations 3.1.0.CR1
| 07:15:59,125 INFO [Version] Hibernate EntityManager 3.4.0.CR1
| 07:15:59,515 INFO [NamingHelper] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interf
| aces}
| 07:15:59,515 ERROR [DatasourceConnectionProvider] Could not find datasource: java:/prunusDatasource
| javax.naming.NameNotFoundException: prunusDatasource not bound
|
| 07:16:00,421 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=prunusDatasource' to JNDI name 'java:prunusDatasource'
|
As you see, the datasource is accessed via JNDI before it is even bound:-(
Can someone reproduce this behaviour?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4162430#4162430
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4162430
17 years, 9 months
[Installation, Configuration & DEPLOYMENT] - Re: Configuring dependencies in Services
by Marcelo.S_
Oddly enough, when I try to deploy my App.war (was trying without the "looking up" before) it loads before hibernate-service.jar and does not work since it cannot find the service:
10:10:22,468 INFO [Catalina] Server startup in 87 ms
| 10:10:22,625 INFO [TomcatDeployer] deploy, ctxPath=/, warUrl=.../deploy/jboss-w
| eb.deployer/ROOT.war/
| 10:10:23,625 INFO [TomcatDeployer] deploy, ctxPath=/invoker, warUrl=.../deploy/
| http-invoker.sar/invoker.war/
| 10:10:23,828 INFO [TomcatDeployer] deploy, ctxPath=/jbossws, warUrl=.../deploy/
| jbossws.sar/jbossws-context.war/
| 10:10:24,515 INFO [TomcatDeployer] deploy, ctxPath=/jbossmq-httpil, warUrl=.../
| deploy/jms/jbossmq-httpil.sar/jbossmq-httpil.war/
| 10:10:27,609 INFO [TomcatDeployer] deploy, ctxPath=/web-console, warUrl=.../dep
| loy/management/console-mgr.sar/web-console.war/
|
| ...
|
| 10:10:36,375 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jb
| oss.jca:service=DataSourceBinding,name=hibernate-ds' to JNDI name 'java:hibernate-ds'
|
| ...
|
| 10:13:15,000 INFO [TomcatDeployer] deploy, ctxPath=/App, warUrl=.../deploy/App.war/
| 10:13:18,750 ERROR [HibernateUtil] Erro inicializando SessionFactory
| javax.naming.NameNotFoundException: hibernate not bound
| at org.jnp.server.NamingServer.getBinding(NamingServer.java:529)
| at org.jnp.server.NamingServer.getBinding(NamingServer.java:537)
| at org.jnp.server.NamingServer.getObject(NamingServer.java:543)
| at org.jnp.server.NamingServer.lookup(NamingServer.java:267)
| at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:667)
| at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:627)
| at javax.naming.InitialContext.lookup(InitialContext.java:392)
| at dao.hibernate.HibernateUtil.<clinit>(HibernateUtil.jav
| a:31)
|
| ... // Lots of exceptions since App cannot load data
| // Don't know why, but in this case hibernate-service.jar will not load
|
|
|
In my HibernateUtils.java I have:
| static {
| try {
| Context ctx = new InitialContext();
| sessionFactory = (SessionFactory) ctx.lookup("java:/hibernate/HibernateFactory");
|
| } catch (Throwable ex) {
| log.error("Erro inicializando SessionFactory", ex);
| throw new ExceptionInInitializerError(ex);
| }
| }
|
That means, I cannot have hibernate-service.sar since it will fail to load because of the datasource; and cannot have hibernate-service.jar because the application will load first. Guess I'm back to the place I started!
So, any hints of how to make this dependencies in the jboss-service.xml work?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4162563#4162563
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4162563
17 years, 9 months