facebook

Class Not Found: Web service project dependency problem?

  1. MyEclipse Archived
  2.  > 
  3. Web Services
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #308724 Reply

    lichtj
    Member

    I use myeclipse 8.5. I have a web service project prj_A in myeclipse. I have another web service project prj_B.

    In one servlet of prj_A, a class “class_b” in prj_B is called, which ofcoz uses some other classes in prj_B. So, I added prj_B to the build path of prj_A.

    Now, I need to deploy prj_A to tomcat. There is no problem compiling the project. But after deployed in tomcat, when requested, the service generated “class not found” problem as follows:

    May 28, 2010 10:47:29 PM org.apache.catalina.core.StandardWrapperValve invoke
    SEVERE: Servlet.service() for servlet prj_A threw exception
    java.lang.ClassNotFoundException: class_b
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1358)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1204)

    I understand and verified that the classes of those in prj_B were not generated and put in WEB-INF/classes of prj_A’s deployment folder in tomcat’s webapps (ofcoz, no .jar created for them either). No problem I can write ANT build file to compile prj_B’s classes and put them in prj_A’s web folder. But I thought myeclipse should be able to automatically compile those classes in prj_B and put them in prj_A’s deployed folder since I added dependency there for prj_A.

    So, my confusion: is this the case or is there some settings for telling MyEclipse what classes should be compiled from prj_B and saved to the target web service folder of prj_A?

    Thanks!

    -Michael

    #308725 Reply

    lichtj
    Member

    Or can I say the following?

    If a web service project depends on a java project, MyEclipse can automatically generate and save .class files from the java project in the web service .war file.

    If a web service project depends on another web service project, MyEclipse will not be able to save class files from these other web service project to the war file of the first.

    #308750 Reply

    lichtj
    Member

    It seems to me could this be a deployment feature flaw in MyEclipse? It could not pick up classes in a dependent project and deploy them in target project’s web-inf/class or save a jar file of them in web-inf/lib. Hope I am wrong. Coz if ME can’t do this, it is painful that we won’t be able to debug the target web service since the dependent project’s classes cannot be deployed and loaded into target service. Other than this, it is fine we can deploy the target web service with ant build file.

    #309153 Reply

    Ram
    Member

    I have escalated the issue to our Dev team member, they’ll get back to you on this.

    Thanks,
    Support-Ram.

    #309448 Reply

    Brian Fernandes
    Moderator

    Michael,

    It seems to me could this be a deployment feature flaw in MyEclipse? It could not pick up classes in a dependent project and deploy them in target project’s web-inf/class or save a jar file of them in web-inf/lib.

    This is actually by design. If you have a relationship between WAR files / web applications then you should be deploying an EAR which references both.

    However, if you wish a web project to use classes from another, then MyEclipse will only bundle dependent Java projects as you have already discovered. Deploying web projects as JARs within others would be incorrect and hence it is not something we support.

Viewing 5 posts - 1 through 5 (of 5 total)
Reply To: Class Not Found: Web service project dependency problem?

You must be logged in to post in the forum log in