cancel
Showing results for 
Search instead for 
Did you mean: 

Three tier Application

Former Member
0 Kudos

Hi EveryBody

The way I developed the application is

First I create java project.

put all the hibernate related code in it and make 1 point interface class to access add update delete.

Second Create a Stateless Session Bean 3 with all the business logic in it.

Third I create a web project where I am using JSF. From JSF manage bean I call Session bean and Its is accessable. but the exception throws when EJB 3 code call simple java project that contain hibernate related code.

If I create a jar file for java code and attach it to EJB its work but its not development friendly.

I just give the project reference in the Ejb project and it compile fine. and deploy but I think

When it deploy It leaves the java project and not bundle it with them

Any suggestion to solve this issue is really appreciated

Thank you

best Regard

Syed Saifuddin

Accepted Solutions (1)

Accepted Solutions (1)

Vlado
Advisor
Advisor
0 Kudos

Hi Syed,

I assume in the end you package the EJB and Web projects into an EAR project, right? Well, you have to also add the Java project as a bundled library in order to be part of your application. In the Project Explorer open your EAR project, right click on Bundled Libraries, and add the Java project there.

HTH

-Vladimir

Former Member
0 Kudos

Hi Vladimir Pavlov

After adding java project to the bundle libraries I am getting following error in deployment.

/***********************************

Nov 22, 2006 4:12:24 PM /userOut/daView_category (eclipse.UserOutLocation) [Thread[Deploy Thread,5,main]] ERROR: Deploy Exception.An error occurred while deploying the deployment item 'sap.com_YTEAR'.; nested exception is:

java.rmi.RemoteException: class com.sap.engine.services.dc.gd.DeliveryException: An error occurred during deployment of sdu id: sap.com_YTEAR

sdu file path: C:\SAP\DevStudio\eclipse\workspace\YTEAR\YTEAR.ear

version status: HIGHER

deployment status: Admitted

description:

1. Error:

Cannot update application sap.com/YTEAR. Reason: Cannot add deployed component YTHIB.jar in container data for app_libraries_container, because it is already added...

Reason: Cannot add deployed component YTHIB.jar in container data for app_libraries_container, because it is already added.; nested exception is:

java.rmi.RemoteException: class com.sap.engine.services.deploy.server.utils.DSRemoteException: Cannot update application sap.com/YTEAR. Reason: Cannot add deployed component YTHIB.jar in container data for app_libraries_container, because it is already added...

Reason: Cannot add deployed component YTHIB.jar in container data for app_libraries_container, because it is already added.; nested exception is:

java.rmi.RemoteException: class java.lang.IllegalStateException: Cannot add deployed component YTHIB.jar in container data for app_libraries_container, because it is already added.

**********************************/

Any Comments

Thank You

Syed Saifuddin

Vlado
Advisor
Advisor
0 Kudos

Well, because of the project reference EJB -> Java project, the latter has already been added to the EAR. So, actually you don't need to bundle it as a library in this case (please forget my previous post). My understanding now is that your aplication consists of three modules:

- web_project.war

- ejb_project.jar

- java_project.jar (i.e. YTHIB.jar)

Is it the case?

> but the exception throws when EJB 3 code call simple java project

What exception do you get there? At least the stacktrace would be helpful, I guess.

> If I create a jar file for java code and attach it to EJB its work

This is also not very clear. Can you elaborate a bit? What are you doing exactly?

Regards,

Vladimir

Former Member
0 Kudos

Hi Vladimir Pavlov

Now for checking perpose I just add hibernate.jar and other related jar file in YTEJB project library. And its seems that the problem is resolved. But a new problem comes.

As it nort allow to add jdbc driver.jar file as lib.

So I deploy jtds driver with name sqlserver2000.

Now after all this when I deployed the application it ask for net.sourceforge.jtds.jdbc.Driver

a line of error is

Caused by: org.hibernate.HibernateException: JDBC Driver class not found: net.sourceforge.jtds.jdbc.Driver

my Hibernate file that worked on other server if I package driver with it is

<!-- Database Connection Setting-->

<!-- <property name="connection.driver_class">com.mysql.jdbc.Driver</property> -->

<property name="connection.driver_class">net.sourceforge.jtds.jdbc.Driver</property>

<!-- <property name="connection.url">jdbc:mysql://localhost:3306/yousifitravel</property> -->

<property name="connection.url">jdbc:jtds:sqlserver://localhost:1433/YousifiTravel</property>

<!-- <property name="connection.username">root</property> -->

<property name="connection.username">sa</property>

<!-- <property name="connection.password">rootpass</property> -->

<property name="connection.password"></property>

Please help me in this regard.

Thank You

Syed Saifuddin

Answers (1)

Answers (1)

Former Member
0 Kudos

Thank You EveryBody

The problem solved by adding the jar files to EJB project as add external jar.