Community
Participate
Working Groups
Some background about the usage scenario: This bug was found in the course of trying to get Axis Web service client generation enabled to Java projects and Utiltiy projects. When the Web service client code in generated into a Java project, the Web service client wizard still gives the user the option of creating a sample JSP to exercise that client code. The wizard creates a Web project to house the JSP and then adds the Java/Utility project as a dependency on the Web project. The tomcat server does not seem to see this dependency, so the JSP is not loading. Here's how to reproduce: 1. Create a Web project (web 2.4) with the tomcat 5.0 runtime 2. Copy AddressBook.wsdl into the Web project's WebContent folder 3. Select AddressBook.wsdl and launch the Web service client wizard File > New > Other, Web Services > Web service client 4. Page 1: Check "Test the Web service" 5. Page 2: Accept defaults 6. Page 3: In the Client project field, type in a new project name (ujp) In the Client Project type field, choose Utility Project 7. Click Finish. Once the wizard is finished (about a 1 min), the Web Services Test Client will launch in browser, but one of the frames will have an HTTP Status 500. -------------------------------------------------------------------------------- HTTP Status 500 - -------------------------------------------------------------------------------- type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception org.apache.jasper.JasperException: /sampleAddressBookProxy/Result.jsp(8,0) The value for the useBean class attribute webservice.addressbook.AddressBookProxy is invalid. org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39) org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:409) org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:150) org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:1227) org.apache.jasper.compiler.Node$UseBean.accept(Node.java:1116) org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163) org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213) org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2219) org.apache.jasper.compiler.Node$Root.accept(Node.java:456) org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163) org.apache.jasper.compiler.Generator.generate(Generator.java:3272) org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:244) org.apache.jasper.compiler.Compiler.compile(Compiler.java:470) org.apache.jasper.compiler.Compiler.compile(Compiler.java:451) org.apache.jasper.compiler.Compiler.compile(Compiler.java:439) org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) note The full stack trace of the root cause is available in the Apache Tomcat/5.0.28 logs. -------------------------------------------------------------------------------- The error is occurring because, even though the Web project that was created by the wizard (ujpSample) to contain the JSP application depends on the utility project (ujp), the dependency is not being "seen" at runtime. If I select ujpSample, Right click > Properties and then expand J2EE Module Dependencies and select Web Libraries, ujp is checked. If I go through the following steps, the dependency seems to get noticed by the server: 1. Use ujpSample's Properties pane to manually remove the dependency on ujp. Be sure to remove it from the module dependencies and the Java build path. 2. Manually clean the projects (ujp and ujpSample). You should see compile errors in ujpSample. 3. Use ujpSample's properties pane to manually add the dependency on ujp. 4. Manually clean the projects (ujp and ujpSample). You should see compile errors go away. 5. Restart the server. 6. Select ujpSample/WebContent/sampleAddressBookProxy/TestClient.jsp and "Run on server" There's still an HTTP status 500 but with a different error, for which I'm opening a different bug. This bug is meant to cover the problem of the dependency on ujp not being seen at all. -------------------------------------------------------------------------------- HTTP Status 500 - -------------------------------------------------------------------------------- type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception javax.servlet.ServletException: javax/xml/rpc/ServiceException org.apache.jasper.servlet.JspServlet.service(JspServlet.java:244) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) root cause java.lang.NoClassDefFoundError: javax/xml/rpc/ServiceException java.lang.Class.getDeclaredConstructors0(Native Method) java.lang.Class.privateGetDeclaredConstructors(Class.java:1618) java.lang.Class.getConstructor0(Class.java:1930) java.lang.Class.getConstructor(Class.java:1027) org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:1222) org.apache.jasper.compiler.Node$UseBean.accept(Node.java:1116) org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163) org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213) org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2219) org.apache.jasper.compiler.Node$Root.accept(Node.java:456) org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163) org.apache.jasper.compiler.Generator.generate(Generator.java:3272) org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:244) org.apache.jasper.compiler.Compiler.compile(Compiler.java:470) org.apache.jasper.compiler.Compiler.compile(Compiler.java:451) org.apache.jasper.compiler.Compiler.compile(Compiler.java:439) org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) note The full stack trace of the root cause is available in the Apache Tomcat/5.0.28 logs.
Created attachment 30561 [details] AddressBook.wsdl Attaching AddressBook.wsdl
I can't follow the instructions - at step 6 'Utility Project' is not an option. If I explicitly type it in the field, it says that Axis doesn't support it. Any idea what I could be doing wrong?
Sorry Tim, got a little ahead of myself. You won't see the Utility Project option and so won't be able to reproduce the problem until Kathy/Chris commit and release my patches for bug 105473. I'll add you the CC list for that bug so you'll get notified once the changes are in.
Tried with a regular Java utility project. I found a J2EE problem that will cause an issue when there are resource duplicated in the src and bin dirs (e.g. a manifest), but otherwise publishing and running went fine. Will wait for web services testcase.
Found the problem once I moved to a build with the new option - although the build path is updated as well as the J2EE Dependancy property page (can't find where these values are stored), the .component file does not include the dependancy. As a result, the J2EE team "correctly" tells server tools that the sample project does not have any child/dependant projects. Once I add the dependancy to .components by hand, everything works fine. I don't know how you are creating the sample project and why some things are updated but no physical dependancy is created. If you are using J2EE tools API to create this dependancy then you'll need to pass this bug on to them. Otherwise, you'll need to fix the web services code that tries to create the dependancy.
*** Bug 117927 has been marked as a duplicate of this bug. ***
We need to change the way we create the module dependency in AddModuleDependenciesCommand. Specifically, these two lines in the execute method addJAROrModuleDependency(sampleIProject, uri); addBuildPath(sampleIProject, clientIProject); should be replaced with this: addJavaProjectAsUtilityJar(clientIProject, sampleIProject, uri, monitor); When I do this, the .component file in the sample Web project shows the module dependency and it seems to be recognized at runtime (though not at compile time which looks like a separate J2EE bug that can be opened once this bug is fixed.
Opened bug 122799 for the compile time problem mentioned in comment #7.
After a discussion with Kathy Chan and Chris Brealey, there are a couple of options we need to investigate further. Given that Java utility projects don't have a way of specifying to the server which additonal JARs on their build path need to be deployed with the WAR, we'll need to somehow reckon with the missing Axis JARs. Options are: 1. Prevent the Sample JSP Test facility from appearing as an option when Axis clients are generated into Java projects. This would require a couple of additional attributes on the org.eclipse.jst.ws.consumption.ui.tester extension point: runtime and projectType. 2. Have the Sample JSP Test facility copy the Axis JARs to the Web project's lib folder. This would require one additional attribute on the org.eclipse.jst.ws.consumption.ui.tester extension point: runtime Only the test extension for the Axis runtime would then add the Axis JARs.
*** Bug 148876 has been marked as a duplicate of this bug. ***
Hi Gil, Please follow the RFE bug 116856 (which bug 138648 is dup on) for enhancements to Java classpath and J2EE dependency issue which may solve this problem of letting Tomcat server know to add the JARs of a dependent Java Utility project. Please follow the wiki page for requirements and progress on this RFE: http://wiki.eclipse.org/Web_Tools_Platform_Release_3.0_Requirements/JavaCPvsJavaEEModDeps I've added your name to the CC list of bug 116856.
According to Rob Frost, there's currently a way to specify which JAR in the dependent Java Utility project should be deployed to a server. That can be accomplished now (i.e. in 2.0) by adding the publish/export classpath attribute to the library cp entries in the utility project that are associated with the JARs you want deployed. Adding the attribute programmatically can be accomplished via API in the org.eclipse.jst.j2ee.classpathdep package (see UpdateClasspathAttributeUtil.addDependencyAttribute()). See https://bugs.eclipse.org/bugs/show_bug.cgi?id=185176 for more details on how this all works currently. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=116856#c11 for details on Rob's comment. Please give it a try for WTP 3.0 M3. If the current mechanism does not achieve what we need, we would need to follow up with RFE bug 116856.
Let's try to address this early in M4.
Deferring to M5.
Trung, Please take a look at this for WTP 3.0 M5.
Created attachment 89478 [details] Fixes the problem, now the Test JSP can run nicely. First: please ignore all comments of Rupam. They make no sense, and in fact they led me into the wrong direction. Second: Name of the bug is misleading as well. it should be something like: Dependencies of a Java utility project are not bundled along with the project when the project is exported. Third: Found another bug during working on this one. Luckily, sever tooling bug not our web service :D Forth: My Patch for this, please review.
Patch reviewed, tested and committed. Released to WTP 3.0 as v200802130444.
Please verify the defect you originated with a recent WTP driver which could be found in: http://download.eclipse.org/webtools/downloads/ If defects in resolved state is not verified within a couple of weeks, the development team might verify and close the defect on the originator's behalf. Thank you for your attention!
mass change to add 'contributed' keyword based on bugzilla query, please correct if that's not accurate (by marking patches as obsolete and removing the 'contributed' keyword.
Closing on behalf of Rupam.