• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Developing with Eclipse and Tomcat

 
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi everybody,
I downloaded the source code of jforum 2.1.8 and now I have to modify some issue of it.
I need to integrate jforum on Eclipse and then, from Eclipse, launch jforum to test my modify. Actually I imported the jforum source on Eclipse, but this is a normal eclipse project and not a web dynamic project in this way I do not know how launch jforum on tomcat from eclipse.
Could someone tell me how I can launch jforum on tomcat from eclipse?
Thanks, bye bye.
[originally posted on jforum.net by abdujaparov]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I do this by having Eclipse compile classes to the WEB-INF/classes directory in the jForum project. Then
using a Tomcat context file in the config/Catalina/localhost directory. Just name the same as the context URL you want (e.g. jforum.xml) and have something like:



FYI - docBase points to your jforum project directory (assuming you just imported the source directly in to it). Calls to /jforum will use this as the app root (instead of assuming a directory under the webapp dir.)

Also, the reloadable option will cause TC to monitor for changes to many of the class files and automatically restart the web app if they change. Just note that some classes may not trigger this. You may have to do a manual stop / start to reload the new code. (TC's service monitor works fine for this).

For extra credit you can combine this with some of the Eclipse tools that can run TC "inside" Eclipse.
[originally posted on jforum.net by monroe]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There is a way to convert JForum into a Dynamic Web Project. It involves manually adding additional <natures> to the .project file which allows the necessary facet configuration on the project's property page. Unfortunately though, JForum's directory setup is not entirely compatible with Eclipse's Dynamic Web Project support. The configuration of the docBase requires all deployment files to live in a sub-directory of the .project folder (default is "/WebContent"). In JForum, they're located at the project root level. Unless, you restructure the project layout this approach won't work.

Here's a more basic approach:

- After importing the .project into the workspace, add a new Server (right click in the Servers panel -> "New" -> "Server").
- Choose "Apache/Tomcat v6.0"
- If this is the first server you add, you will have to specify the installation path of an existing Tomcat installation. I would suggest to go with the offered "Download and Install..." of 6.0.14, since the latest version has slight compatibility issues. As a side benefit, it's a non-install, stand-alone version, which is only executed as needed.
- Next, right-click the newly created server and choose "Open".
- Select "Serve modules without publishing".
- Switch to the "Modules" screen (tab at the bottom of the window).
- Click "Add External Web Module...".
- Enter your JForum source location as the Document Base. Additionally, I use "/JForum" for the Path.
- Hit "OK" and save the Tomcat Configuration.
- Done!

This way, the Tomcat configuration is handled directly by Eclipse on a per-project basis and does not affect your global Tomcat setup. This makes working with Tomcat when switching projects and workspaces more straightforward, especially if you're dealing with multiple branches.

Now, you're done. You can start the server directly from the Servers panel in various modes. If you run it in debug with breakpoints set, you may be asked to add your source path for the debugger to work.

Enjoy!



[originally posted on jforum.net by drematic]
 
All of the world's problems can be solved in a garden - Geoff Lawton. Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic