Solved

Help with Entity Beans in jDeveloper

Posted on 2003-11-12
6
2,096 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This exercise is about for the following scenario: Dmgr and One node with 2 application server. Each application server contains it owns application. Application server name as follows server1 contains app1 server2 contains app1 Prereq…
This article is about some of the basic and important steps to be used to improve the performance in web-sphere commerce application development. 1) Always leverage the Dyna-caching facility provided by the product 2) Remove the unwanted code …
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

910 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

23 Experts available now in Live!

Get 1:1 Help Now