- This topic has 8 replies, 2 voices, and was last updated 14 years, 7 months ago by support-shalini.
-
AuthorPosts
-
rsingh03MemberI am using MyEclipse Blue Edition Version: 8.0 Blue. I am trying to add a class from one Java Web Project to another one. I have tried the following
1. I tried to add class folder
2. Tried to add project in project references
3. Also tried adding the exact classes using the add jarsNone of them have helped to include the class to the classpath. Are you able to tell me what I am missing.
Thanks
support-shaliniMemberrsingh03,
Please go through the following link on how to add dependent java projects to web projects –
http://www.myeclipseide.com/documentation/quickstarts/webprojects/#dependent_projects
rsingh03MemberHi Shalini,
Thanks for your reply. I had followed the steps mentioned in the link you sent to me. I do not get compile time errors but at runtime the classess in the web project are not found and I get java.lang.RuntimeException: Unable to find Class for name errors. Also in the deployed folder I cannot see the classess in the WEB-INF\lib or in the WEB-INF\classes folders. I have selected the smart deploy option for deployment. Is there something else I need to do?
Thanks
rsingh03MemberThe thing is project that I am trying to reference is a java web project. I have included a java project and that works fine. So is there some special setting for including classes from a WEB project
support-shaliniMemberrsingh03,
Add the second web project as a referenced project to the first project. Now add the two web projects to an EAR project as web modules. This will allow the Web project to reference its dependent project.Let me know if that helps
rsingh03MemberShalini,
I tried that I created an EAR project and add the 2 web projects as web modules. I am using tomcat as the application server, now when i deploy my web project as normal and run I still get the same error as before ie java.lang.ClassNotFoundException. Also I noticed the deployed application does not have the classes that I am using at runtime. Do I need to do something with the EAR project?
support-shaliniMemberrsingh03,
You will have to deploy the EAR application to application servers like glassfish, Jboss etc.
rsingh03MemberHi Shalini,
Is there any way to do this on tomcat that is the application server that we are using?
Thanks
Reena
support-shaliniMemberReena,
I am afraid, you cannot use tomcat as it is not a full Java EE application server.
Please refer to the following link for further reference –
http://www.javaworld.com/javaworld/jw-01-2008/jw-01-tomcat6.html?page=1 -
AuthorPosts