Bug 364790 - Deploy required jars when deploying EGL app
Summary: Deploy required jars when deploying EGL app
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: EDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: pf yu CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-25 03:27 EST by Huo Zhen Zhong CLA
Modified: 2017-02-23 14:20 EST (History)
6 users (show)

See Also:


Attachments
sample (42.77 KB, application/x-zip-compressed)
2011-11-25 03:27 EST, Huo Zhen Zhong CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Huo Zhen Zhong CLA 2011-11-25 03:27:07 EST
Import attached project, deploy them into one web project, then run it on tomcat 6, click the button and you will get "EGL0024E: An exception occurred during a service call. Service:server.TestService, Function:server.TestService
", but if you change service binding to workspace, it will work well in VE.
Comment 1 Huo Zhen Zhong CLA 2011-11-25 03:27:35 EST
Created attachment 207517 [details]
sample
Comment 2 Brian Svihovec CLA 2011-11-27 20:57:27 EST
Joe, can you review this one and determine a priority for the .7 release?
Comment 3 Tony Chen CLA 2011-11-28 03:09:46 EST
The Service calls an external type which wraps up a java class located in a jar in
<Project ExternalJava>/lib/MyExternal.jar 

This jar does not get deployed to the target web project. Thus target web project contains compilation errors in the service's generated java files, and will not run correctly. 

I copied the jar to the target project's WebContent\lib and it worked. 

Neither does RBD copy the jars to the target deployment. It might be an enhancement to make our deployer aware of all the java resource in the class path. But this looks low priority to me. A developer knows how to use Java external types and jars are likely to know how to deploy the custom java code to the target project. 

I would suggest defer this.
Comment 4 Huo Zhen Zhong CLA 2011-11-28 04:11:08 EST
Add some info, deploy the projects into a web project called "targetTest9", then run H1.html in tomcat 6.
Comment 5 Brian Svihovec CLA 2011-11-28 08:48:02 EST
Marking this as Future for now. 

I will let Joe add more details about why this jar file is not being copied by default, and then we can determine if this is a defect, an enhancement, or should be closed as working as designed.
Comment 6 Will Smythe CLA 2011-11-28 09:33:44 EST
Does a jar sitting in the EGL project being deployed get copied into the target project?
Comment 7 Joseph Vincens CLA 2011-11-28 09:41:04 EST
Tony is correct in RBD we do not copy any jar files. The reason is there are many
ways to add a jar to the classpath besides adding it to the WebContent/lib.
Jars could be in a common folder on the server and the war is updated to point
to the jar, or if the application is using an EAR the jar could be in the EAR
classpath, or the jar could be in the server or the actual system classpath,
and I bet there are other ways to add it to the classpath. 

Let's take 3 examples: 
1. I have a jar that contains code that is common to an application and the
application is made up of multiple war files. In this case the jar belongs in
the EAR classpath.

2. You have multiple server instances and all of your applications on a server
instance use the same database driver jars, the jars can go in the server
classpath.

3. You have multiple server instances and all server instances use the same
database driver jars the jars can go in the system classpath.

Whoever implements this enhancement will have to investigate the J2EE
deployment/classloader structure (is this the same for all servers?).
Comment 8 Will Smythe CLA 2011-11-28 10:10:42 EST
I think our first goal should be to make the app work after it is deployed, and that means copying required jars into the deployed project (we already copy jars referenced by the database connection, right?). For advanced users, in the future we could offer an option (in the DD) to control which (if any) jars get deployed, like how we allow the developer to restrict which resources (WebContent) are deployed into the target project.

I think our goal, in general, should be to make things clean/simple for the basic scenarios, but give advanced users the ability to alter the behavior (e.g. not copy jars into the target project) for advanced scenarios. This philosophy should apply throughout EDT, not just on this particular issue ...