- This topic has 12 replies, 6 voices, and was last updated 20 years, 6 months ago by Scott Anderson.
-
AuthorPosts
-
Sean DynanMemberHi again
I running through the Web Project tutorial in the MyEclipse User Guide, though I’m deploying to JBoss not Tomcat.
The deployment goes okay; JBoss starts and the HelloWorld WAR is deployed as expected.
However when I refresh http://localhost/HelloWorld/helloWorld.jsp my Eclipse JSP debugger presents me with this error:
Source not found for helloWorld_jsp._jspService(HttpServletRequest, HttpServletResponse) line: 29
The precompiled JSP is created here jboss\server\default\work\MainEngine\localhost\HelloWorld\helloWorld_jsp.java, and the _jspService() method is in there all right.
Any ideas why the Eclipse debugger can’t find it in my JBoss?
My config:
- Windows XP Pro SP1
JBoss 3.2.2
JDK 1.4.2_02
Eclipse 2.1.2
MyEclipse 2.6.4—
Sean
support-michaelKeymasterHi Sean,
If you’re setting breakpoints in JSPs then note that MyEclipse requires the server support the JSR045 spec which defines a standard interface to debugging info for JSP-like languages. Presently the servers that we know support JSP debugging are Tomcat5, BEJY, and Weblogic 7 & 8, although Weblogic is not JSR045 compliant we adapted to its mechanisms. Jetty and Resin are supposed to support this capability very soon. If you can find a Tomcat5-JBoss integration you’ll be golden.
Regards,
Michael
MyEclipse Support
support-michaelKeymasterI reread your post info and the issue is that the source code for the compiled JSP can not be located. This makes sense since the compiled JSP code resides outside of the project’s source path and thus the debugger can not locate it.
Some developers actually import the compiled JSP code into a separate source folder. Doing this will enable Java src level debugging.
Michael
Sean DynanMemberThanks Michael. I re-ran the tutorial against a standalone Tomcat 5 and, unsurprisingly, everything went by the numbers. I could also step into the servlet’s source on JBoss/Tomcat 4, but not the compiled JSP (just like you said).
It seems I have two options if I wish to deploy/debug my JSPs on JBoss:
(1) Download JBoss 3.2.3RC1 and perform the hack documented here (see the JBossWeb section) to integrate Tomcat 5.(2) Compile my JSPs to sources and locate them somewhere in my project’s source path.
Advice sought
(1) Whilst the hack mentioned above might work for a standalone JBoss instance, how do I make the MyEclipse JBoss connector launch the necessary run.sh -c tomcat5 command?(2) Alternatively, whereabouts in my project’s source path should I place the compiled JSPs? Or is there a neat way of getting Eclipse to do that for me?
Many thanks for all your help guys.
—
Sean
Scott AndersonParticipantSean,
(1) You really can’t make the JBoss connector launch a shell script. However, you might be able to decouple Tomcat and JBoss with this technique and use the script once to start Tomcat and then use the connector to start and stop JBoss. I don’t know how well this will work, since I’ve never tried it however. Alternatively, I think I remember someone mentioning that on the JBoss 4 source tree that a Tomcat 5 integration exists.
(2) Yes, there is a neat way. 🙂 Use File > New > Folder (NOT Souce folder) and click the advanced button. Set the ‘use linked folder’ option and point to the temp directory that Tomcat uses to store the JSP’s temporary .java files. Give it a name and click OK to create it. Now go to the project properties and select Source Build Folders and add the new linked folder you just created. That should do it.
–Scott
MyEclipse Support
Sean DynanMemberHi Scott
you might be able to decouple Tomcat and JBoss with this technique and use the script once to start Tomcat and then use the connector to start and stop JBoss
Tomcat is integrated as a JBoss service. The last time I tried this I crashed and burned. I might try again if I can summon up the gumption.
And yes, a Tomcat5/JBoss3 integation does exist. But, as documented here you have to start JBoss with that -c tomcat5 switch to activate it. Thus my original enquiry about the MyEclipse JBoss connector.
Use File > New > Folder (NOT Souce folder) and click the advanced button. Set the ‘use linked folder’ option and point to the temp directory that Tomcat uses to store the JSP’s temporary .java files. Give it a name and click OK to create it. Now go to the project properties and select Source Build Folders and add the new linked folder you just created. That should do it.
Okay, I tried this but I couldn’t get it to work. Eclipse sees the auto-generated helloWorld_jsp.java file and compiles an additonal .class. JBoss’ Tomcat then throws
java.lang.ClassNotFoundException: org.apache.jsp.helloWorld_jsp
If I add a “*.java” exclusion filter to the Eclipse linked source folder I observe the orginal debugger problem, namely
Source not found for helloWorld_jsp._jspService(HttpServletRequest, HttpServletResponse) line: 29
—
Sean
support-michaelKeymasterIf I add a “*.java” exclusion filter to the Eclipse linked source folder I observe the orginal debugger problem, namely Quote:
Source not found for helloWorld_jsp._jspService(HttpServletRequest, HttpServletResponse) line: 29The issue is that Tomcat4 and Tomcat5 manage their JSP compilation areas differently. Specifically the servlet file that Tomcat4/Jasper creates is not in the proper file structure for its declared package. For example a helloWorld project with a top-level helloWorld.jsp will have a corresponding Tomcat4 servlet with a packaged name of org.apache.jsp located in the directory <Tomat4 install>/work/Standalone/localhost/helloWorld. Tomcat4 uses a custom classloader to deal with the fact that there is no org/apache/jsp directory hierarchy for the org.apache.jsp package name of the servlet. Tomcat5 generates JSP servlets into the proper directory structure. Thus the procedure provided earlier is Tomcat5 specific.
The Tomcat4 procedure requires you to create the org/apache/jsp dir hierarchy and copy all contents in the Tomcat4 work area for your project under into this new dir structure. An alternative to this is for you to post an enhancement request on the “Features” forum since our management give user request a lot of attention.
Regards,
Michael
MyEclipse Support
Sean DynanMemberMichael
Firstly let me thank you for the effort you’ve put in debugging what is really a JBoss3/Tomcat4 issue. I don’t want to tie you up any longer supporting a problem that isn’t related to MyEclipse.
I might drop an enhancement request like you suggested, though JBoss will probably have shipped Tomcat5 by the time you guys have provided a fix 😉 Actually, that raises another question.
Time for a new Topic…
—
Sean
arghhhMemberThis thread prompted an experiment. I got JBoss3.2.3 to work with the integrated tomcat5.
1) Do what the jboss instructions say, “ant -buildfile build-tc5-config.xml”
2) Under Windows->Preferences->MyEclipse->Application Servers->JBoss 3
a) change “Server Name” to “tomcat5”
b) change “Optional Program Arguments” to “-c tomcat5”Then you get debugging of jsp! Yeah!
Sean DynanMemberHi arghhh!
Great advice! It works well now.
One more thing worth mentioning in case anyone else gets tripped up by this: you have to enable mapped files in the JBossweb config otherwise the JSP source files don’t sync with their corresponding servlet code as you step through the JSPs in the debugger.
Add the following init param to the jsp servlet entry in jboss/server/tomcat5/deploy/jbossweb-tomcat50.sar/web.xml:
<servlet> <servlet-name>jsp</servlet-name> ... <init-param> <param-name>mappedfile</param-name> <param-value>true</param-value> </init-param> ... </servlet>
—
Sean
Aby AbrahamMemberAfter a lot of searching in the net, I integrated tomcat 5 with JBoss 3.2.3, and it is working fine. The steps are given below.
1. go to the JBOSS_HOME/docs/examples/tomcat folder in command
prompt. There should be a file called build-tc5-config.xml2. Using ant, build this file. ( ant -buildpath build-tc5-config.xml )
3. It should show Copying 130 files, and then copying 30 files… and
finally a BUILD SUCCESS message.4. Now you have built the tomcat 5 service for JBoss, and a directory
called tomcat5 should be under JBOSS_HOME/server. The JBoss –
Tomcat5 integration is done.5. To tell JBoss to start the tomcat5 service instead of the default one,
we have to give arguments to run.bat. To execute it manually, give
the command “run -c tomcat5”6. Now, Eclipse integration. I used Eclipse 3.0 M8. You can download
the JBoss IDE plugin for Eclipse. Then install it in the plugin directory
of eclipse. (just unzip it).7. We have to configure it. Open the eclipse. Rightclick on the top tool
bar, and select Customize Perspective. In the Commands tab, select
Default Server. Click OK. Now a new menu and some buttons should
appear.8. Go to Run > Debug, and on the left side, you can see a list of JBoss
servers, select JBoss 3.2.x. If you want to change the perspective,
change it. Next, click New to create a new configuration.9. Select the new configuration, and select the JBoss installation
directory on the Home tab. On the Start tab in the Program
arguments textbox, type “-c tomcat5”. Remember, we started the
JBoss server manually using this option with run.bat!10. Press Close.
11. Go to Window > Perspective, and select JBoss IDE > Launcher, and
in the Default Server, select our new configuration. Click OK.Congratulations! You can now use the new buttons in your toolbar. Click the Start Server. You can see the output in the console window. Make sure that in the output, it shows ……/servers/tomcat5…. , and not
……/servers/default…..! Thats it. Pretty cool, eh?
Riyad KallaMemberaby.abraham,
We really appreciate you taking the time to post the steps for other users, thank you.
Scott AndersonParticipantAnd, just for completeness, JBoss 3.2.4 will include Tomcat 5 natively. However, at the time of this post it has not been officially released yet. But, if you’d like to download the source and build it yourself (very easy) you can find out how in this post:
https://www.genuitec.com/forums/topic/tomcat-5-jboss-3-2-4-jsp-debugging-support-closed/ -
AuthorPosts