Solved

Help with Entity Beans in jDeveloper

Posted on 2003-11-12
6
2,097 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
Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

 

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 is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Can't start JIRA for the first time 4 88
jersey import error 8 106
hashcode is calculated on the basis of value object 2 110
Java Exception example issues 11 84
-Xmx and -Xms are the two JVM options often used to tune JVM heap size.   Here are some common mistakes made when using them:   Assume BigApp is a java class file for the below examples. 1.         Missing m, M, g or G at the end …
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.…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

777 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