Solved

Help with Entity Beans in jDeveloper

Posted on 2003-11-12
6
2,100 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
Independent Software Vendors: 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 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

How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

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…
Upgrading Tomcat – There are a couple of methods to upgrade Tomcat is to use The Apache Installer is to download and unzip and run the services.bat remove|install Tomcat6 Because of the App that we are working with, we can only use Tomcat 6.…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

705 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