cancel
Showing results for 
Search instead for 
Did you mean: 

How to exclude Jar Files from being packaged into EAR file?

former_member343107
Participant
0 Kudos

Hi All,

I'm developing an application using NetWeaver Developer Studio. In my EJB project, I right clicked the project node -> properties -> Java Build Path -> Libraries and added some jar files to the path using "Add External Jars" button. These jar files are automatically packaged into the EAR file. I viewed the properties of the EAR project and found that in the "Archive Build Info" tab, no item is selected to be packaged into the EAR file.

How can I pretend those jar files from being packaged into the EAR file? They already have a copy in the server.

Thanks + Regards

Jerome

Message was edited by: Jerome Zhao

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Jerome,

You should create a Library Project for example "myLibs" into the same workplace than your application "myApp". Include all necessary JAR files into "myLibs" and reference it to your Java Build Path onto the tab Projects.

Now the compiler knows all libraries but they will not be packed into the EAR file.

Regards André

former_member343107
Participant
0 Kudos

Hi André,

Thanks a lot. Now I understand what to do.

Have a nice day!

Best Regards

Jerome

maniksaha
Explorer
0 Kudos

I have done what you have recommended, the ear file is successfully created.

However when I deploy to the J2EE server, I get the following error.

Result
=> deployment aborted : file:/C:/DOCUME~1/xxxxx/LOCALS~1/Temp/temp41836xBtrService.ear
Aborted: development component 'xBtrService'/'abc.com'/'localhost'/'2005.06.22.17.30.10':
Caught exception during application deployment from SAP J2EE Engine's deploy service:
java.rmi.RemoteException: Cannot deploy application abc.com/xBtrService.. Reason: Exception during generation of components of application abc.com/xBtrService in container EJBContainer.; nested exception is: 	com.sap.engine.services.deploy.exceptions.ServerDeploymentException: Exception during generation of components of application abc.com/xBtrService in container EJBContainer.
 (message ID: com.sap.sdm.serverext.servertype.inqmy.extern.EngineApplOnlineDeployerImpl.performAction(DeploymentActionTypes).REMEXC)

Deployment exception : The deployment of at least one item aborted.

Thanks,

Manik

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Jerome,

you can deploy your libraries as SDA file and hold a refernce to it. This refernce is to specify into the application-j2ee-engine.xml of your EAR archive. If you do this you have to deploy your library SDA only once.

Regards André

former_member343107
Participant
0 Kudos

Hi André,

Thanks a lot for the information. If I don't specify these jar files in the "Build Path", Devleoper Studio could not compile my application code because my code use classes in those jar files. If I do, Developer Studiio will automatically package those jar files into the EAR. The problem is how can I use the local jar files during development and exclude them from package during deployment. Could you have some suggestion?

Thanks + Regards

Jerome

Message was edited by: Jerome Zhao

Former Member
0 Kudos

Hi Jerome,

Wouldn't it be safer to actually have the jar files that you tested your application with packaged everytime into the EAR? That way, you might avoid "rare" errors of having tested your application with a particular jar file only to find that it does not run on the production server due to an outdated jar file there.

My two cents,

Pranav

former_member343107
Participant
0 Kudos

Hi Pranav,

You are right. Packaging all jars in the EAR is much safer. But all the jar files are more than 13 MB. My own applicaiton is only 60KB. Deploying so large an EAR file to remote server is a nightmare. So I need to exclude those lib files to avoid upload them each time I changed my applicaiton.

Thanks + Regards

Jerome