Solved

Help with Entity Beans in jDeveloper

Posted on 2003-11-12
6
2,095 Views
Last Modified: 2013-12-01
Hi experts, i have the following problem..

i have two proyects in the same aplication workspace, these two proyect
have different entity beans created form the same database(different tables).

When i run the application, this give me the following error
"The Network Adapter could not establish the connection"

If i put the entity beans in the same proyect the application runs nicely,
but i need to have two o more EJB proyects in the same applicaction


Please help...


(im working with jdeveloper 10g, mySQL 4.0.13, WindowsXP)
0
Comment
Question by:Rhaennyn
  • 3
  • 3
6 Comments
 
LVL 9

Expert Comment

by:vzilka
ID: 9737748
If you put them in 2 projects that means you have 2 orion-ejb-jar.xml files.
So probably one of these files (the one in the project that doesn't work) isn't configured to use your correct data source.

Can you post the 2 orion-ejb-jar.xml files in here?
0
 

Author Comment

by:Rhaennyn
ID: 9739810
Ok, i create a new empty workspace with 2 empty proyects, in each of these projects i add a new EJB diagram, inside of the diagram i put a EntityBean(from a test DB) and a Session EJB...

In the navigator look like...

- Workspace
  - Proyect1
    - Application Sources
      + META-INF
      - mypackage1
        - SessionEJB_A (session EJB)
        - TablaA (Entity Bean)
        - EJB Diagram1
  - Proyect2
    - Application Sources
      + META-INF
      - mypackage2
        - SessionEJB_B (session EJB)
        - TablaB (Entity Bean)
        - EJB Diagram1

When i run one of these EJBs i get the error....
"SQL error: E/S Exception : The Network Adapter could not establish the connection"


The orion-ejb-jar files are...

Proyect1
----------------------------------
<?xml version = '1.0' encoding = 'windows-1252'?>
<!DOCTYPE orion-ejb-jar PUBLIC "-//Evermind//DTD Enterprise JavaBeans 1.1 runtime//EN" "http://xmlns.oracle.com/ias/dtds/orion-ejb-jar.dtd">
<orion-ejb-jar>
  <enterprise-beans>
    <session-deployment name="SessionEJB_A"/>
    <entity-deployment name="TablaA" data-source="jdbc/MySQLDS" table=".tabla_a">
      <primkey-mapping>
        <cmp-field-mapping name="tabla_a" persistence-name="tabla_a" persistence-type="varchar(100)"/>
      </primkey-mapping>
      <cmp-field-mapping name="tabla_a" persistence-name="tabla_a" persistence-type="varchar(100)"/>
    </entity-deployment>
  </enterprise-beans>
</orion-ejb-jar>
----------------------------------

Proyect2
----------------------------------
<?xml version = '1.0' encoding = 'windows-1252'?>
<!DOCTYPE orion-ejb-jar PUBLIC "-//Evermind//DTD Enterprise JavaBeans 1.1 runtime//EN" "http://xmlns.oracle.com/ias/dtds/orion-ejb-jar.dtd">
<orion-ejb-jar>
  <enterprise-beans>
    <session-deployment name="SessionEJB_B"/>
    <entity-deployment name="TablaB" data-source="jdbc/MySQLDS" table=".tabla_b">
      <primkey-mapping>
        <cmp-field-mapping name="tabla_b" persistence-name="tabla_b" persistence-type="varchar(100)"/>
      </primkey-mapping>
      <cmp-field-mapping name="tabla_b" persistence-name="tabla_b" persistence-type="varchar(100)"/>
    </entity-deployment>
  </enterprise-beans>
</orion-ejb-jar>
----------------------------------

Thanx for the help...
0
 
LVL 9

Expert Comment

by:vzilka
ID: 9739874
Are you sure jdbc/MySQLDS is configured correctly? I have many problems with MySQL and JDeveloper10G. Did you try opening the connection and test its configuration?
0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 

Author Comment

by:Rhaennyn
ID: 9739992
Yes, if i place the Entity beans in the same proyect, the aplication runs correctly...

I test these problem with Oracle 9i database too, and i give the same problem...

Thanx...

0
 
LVL 9

Accepted Solution

by:
vzilka earned 500 total points
ID: 9740296
I assume here you do not create CMRs in your project.
I tried to create the same projects and got the same exception.

OK.
The reason for the problem is that both projects are using a classes output directory for their build. This causes a collision in the location of the orion-ejb-jar.xml when deploying to OC4J.

Here is the fix I found.
Right click on one of the projects.
Select Project Properties.
In the dialog box open Profiles-->Development-->Paths
Select the text box Output Directory, and change the classes directory to classes2.

This should work.



0
 

Author Comment

by:Rhaennyn
ID: 9741001
It works...

Thanks very much!!!!!!!!!!!!
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Most of the developers using Tomcat find it easy to configure the datasource in Server.xml and use the JNDI name in the code to get the connection.  So the default connection pool using DBCP (or any other framework) is made available and the life go…
There are numerous questions about how to setup an IBM HTTP Server to be administered from WebSphere Application Server administrative console. I do hope this article will wrap things up and become a reference for this task. You need three things…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now