Forums Register Login

Problem with entity bean

+Pie Number of slices to send: Send
Hi All ,


I am facing a problem in trying to put a call from a Stateless bean to an entity bean to persist an object . The beans are packed in an ear file and have been deployed on JBOss Server 4.xx . When I make a call to persist the entity bean object then it throws up an error as this :




** Please can you tell where the problem is . I am calling this stateless bean from a servlet .
+Pie Number of slices to send: Send
hi,
first your configure jndi datasoruce
in datasoruce.xml
<local-tx-datasource>
<jndi-name>JNDI java:/system<</jndi-name>
<connection-url>jdbc racle:thin:@localhost:1521:XE</connection-url>
<driver-class>oracle.jdbc.OracleDriver</driver-class>
<user-name>USERNAME HERE</user-name>
<password>PASSWORD HERE</password>
<min-pool-size>5</min-pool-size>
<max-pool-size>20</max-pool-size>
</local-tx-datasource>
</datasources>


and then reference it in persistance.xml file
do not give datasource properties in persistance.xml
here you give the ORM related properties
+Pie Number of slices to send: Send
Hi Mukhtiar ,
Thanks a lot for the Reply .
I had already all these datasource related entries in the datasource.xml file in the JbossServer/deploy directory and the server is giving a message that it is able to add this jndi name. But how can I give this persistence.xml information about that datasource.xml file information.
I mean I have deployed this persistence.xml file in the ear and now I need to put this datasource.xml file along with the persistence.xml file
in the ear or do I need to put this datasource.xml at two places : on in the deploy directory and other in the ear file .
Please provide me with some pointers over this, I am really stuck.
Regards
+Pie Number of slices to send: Send
TO further add to the things I had already put the ds.xml file in the deploy directory but it when I go to access the entity it throws up this error :

Internal Exception: javax.naming.InvalidNameException: Not a compound name: my-ejb-test
16:05:48,312 ERROR [STDERR] at oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:220)
16:05:48,312 ERROR [STDERR] at oracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerFactoryImpl.getServerSession(EntityManagerFactoryImpl.


Moreover in deploying this ear it throws this warning :

16:10:13,921 INFO [STDOUT] [TopLink Warning]: 2007.06.27 04:10:13.906--java.lang.NullPointerException: null was thrown on attempt of PersistenceLoadProcessor to load class src.FirstSessionBean. The class is ignored.
16:10:13,921 INFO [STDOUT] [TopLink Warning]: 2007.06.27 04:10:13.921--java.lang.NullPointerException: null was thrown on attempt of PersistenceLoadProcessor to load class com.hughes.testEjb.TestClient. The class is ignored.
16:10:13,921 INFO [STDOUT] [TopLink Warning]: 2007.06.27 04:10:13.921--java.lang.NullPointerException: null was thrown on attempt of PersistenceLoadProcessor to load class src.Employee. The class is ignored.
16:10:13,921 INFO [STDOUT] [TopLink Warning]: 2007.06.27 04:10:13.921--java.lang.NullPointerException: null was thrown on attempt of PersistenceLoadProcessor to load class src.FirstSession. The class is ignored.



My ds.xml is :

<?xml version="1.0" encoding="UTF-8"?>

<!-- ===================================================================== -->
<!-- -->
<!-- JBoss Server Configuration -->
<!-- -->
<!-- ===================================================================== -->

<!-- $Id: oracle-xa-ds.xml,v 1.13 2004/09/15 14:37:40 loubyansky Exp $ -->

<!-- ===================================================================== -->
<!-- ATTENTION: DO NOT FORGET TO SET Pad=true IN transaction-service.xml -->
<!-- ===================================================================== -->


<local-tx-datasource>
<jndi-name>my-ejb-test</jndi-name>
<connection-url>jdbc racle:thin:@127.0.0.1:1521:XE</connection-url>
<driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
<user-name>system</user-name>
ashu
<exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter
</exception-sorter-class-name>

<type-mapping>Oracle9i</type-mapping>

</local-tx-datasource>


My persistent.xml is :

<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
<persistence-unit name="testApp" transaction-type="JTA">
oracle.toplink.essentials.PersistenceProvider
<jta-data-source>java:/my-ejb-test</jta-data-source>


</persistence-unit>
+Pie Number of slices to send: Send
Hi,

Please check your Jboss log for your Data Source is bound successfully or not.
+Pie Number of slices to send: Send
Hi ,
As such there is no error thrown when the server is started but when I tried to look up for the datasource binding at the server console then there was an exception thrown up as this :






I tried to search for this exception and one of the web pages says that I am supposed to remove some hajndi entry from the jboss-service.xml file but this entry is absent in the server setup.

Now what do I do?
I'm gonna teach you a lesson! Start by looking at this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 2532 times.
Similar Threads
Error in calling Enity Bean from Stateless Bean (ejb3.0)
Probelm in using Toplink to persist entities in JBoss enviroment
Cannot access entity bean deployed in different machine
How can I call EJB3 beans from another comuter?
JBoss 4.2.2 Server Starting Issue
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 19:08:28.