Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Help with Entity Beans in jDeveloper

Posted on 2003-11-12
6
Medium Priority
?
2,106 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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 2000 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

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…
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…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…

604 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