[EJB/JBoss] - Re: org.jboss.deployment.DeploymentException: Error in jboss
by jaikiran
In all these xml files, wherever you have used "Oracle10g", replace it with "Oracle9i". For example, change your -ds.xml to:
| <?xml version="1.0" encoding="UTF-8"?>
| <datasources>
| <local-tx-datasource>
| <jndi-name>OracleDS</jndi-name>
| <connection-url>jdbc:oracle:thin:@localhost:1521:XE</connection-url>
| <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
| <user-name>test</user-name>
| <password>test</password>
| <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
| <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml -->
| <metadata>
| <type-mapping>Oracle9i</type-mapping>
| </metadata>
| </local-tx-datasource>
| </datasources>
|
|
|
The comments that i see in the standardjbosscmp-jdbc.xml, tells this:
anonymous wrote : <type-mapping>
| Oracle9i
| <!--
| | This type-mapping applies both to Oracle 9i and Oracle 10g
| | Make sure that you have the latest Oracle 10g version of ojdbc14.jar
| -->
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4154165#4154165
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4154165
17 years, 10 months
[Installation, Configuration & DEPLOYMENT] - Problem deploying 2 persistence units in 2 EJBs in an EAR
by anb@beyondfibre.tv
Hello all
We have a problem depoying a J2EE project under Jboss AS 4.2.2
There is an EAR project with two EJBs JAR with their own entities and persistence unit. The 2 persistence.xml files are in the META-INF directories of the EJBs' JAR and they bind to two different data stores defined in a *-ds.xml file.
Here is the ds file: (deployed directly in server/default/deploy/ )
<local-tx-datasource>
<jndi-name>firstDatasource</jndi-name>
<connection-url>jdbc:mysql://localhost:3306/sometable</connection-url>
<driver-class>com.mysql.jdbc.Driver</driver-class>
<user-name>user</user-name>
password
</local-tx-datasource>
<local-tx-datasource>
<jndi-name>secondDatasource</jndi-name>
<connection-url>jdbc:mysql://localhost:3306/someothertable</connection-url>
<driver-class>com.mysql.jdbc.Driver</driver-class>
<user-name>user</user-name>
password
</local-tx-datasource>
Then the persistence.xml files:
<persistence-unit name="second" transaction-type="JTA">
org.hibernate.ejb.HibernatePersistence
<jta-data-source>java:/secondDatasource</jta-data-source>
</persistence-unit>
...
<persistence-unit name="first" transaction-type="JTA">
org.hibernate.ejb.HibernatePersistence
<jta-data-source>java:/firstDatasource</jta-data-source>
</persistence-unit>
However when the project is deployed we are getting the following error :
08:44:31,692 WARN [ServiceController] Problem starting service persistence.units:ear=ourproject-ear.ear,jar=ourejb.jar,unitName=second
javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:645)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)
at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:325)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at org.jboss.ejb3.entity.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:216)
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:597)
Following this error message we investigated the initial context parameters in the conf folder, and jndi.properties seems to be fine (default values):
java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
Any help would be gladly appreciated !
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4154155#4154155
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4154155
17 years, 10 months