|
GettingStarted
Installing and using the plug-in
InstallingWell, that's easy. Simply use Eclipse's update manager (Help -> Updates -> Find and install... -> Search for new features to install) to add a remote site and point it to http://run-jetty-run.googlecode.com/svn/trunk/updatesite. Click finish, select the plugin (just one choice atm) and finish again. Done. UsingThe plugin provides a launch configuration. It will only work with Java projects (Scala and other Java VM languages should work as well if they have a Java nature) with a web application in them (i.e. the project has a folder that is the root of the web application, and in that folder is a WEB-INF folder containing a web.xml file). You can run such projects with Jetty using the launch configuration this plugin provides. Here is a screen shot of the Jetty tab in the launch dialog:
These options are required:
If an HTTPS port is specified, these options area also required:
If you need more control than Run Jetty Run provides, you have choices:
Run Jetty Run, or the various projects of that are part of the Wicket family.
Have fun with it! |
Thank you for the update of Jetty launcher! One small thing though, shouldn't the update address be: "http://run-jetty-run.googlecode.com/svn/trunk/updatesite/"?
Yes, indeed. Thanks, it is fixed now.
Love this plugin, thanks. A question, how can I configure jetty to autoreload a webapp when I change java code? Is that possible through this plugin? I am developing through wicket, and being able to save and test directly would speed up development considerably...
Hi Christian,
This plugin doesn't do any magic, so there are no special reloading facilities is exposes. However, it plays well with Java's hotswap functionality (see http://java.sun.com/j2se/1.4.2/docs/guide/jpda/enhancements.html), so you shouldn't have to reload many smaller changes. How well that works depends on the JDK version you are using.
When I try to launch it, I get the following error: 2008-01-02 10:11:55.191::INFO: Logging to STDERR via org.mortbay.log.StdErrLog? 2008-01-02 10:11:55.300::INFO: jetty-6.1.6 2008-01-02 10:11:55.441::INFO: NO JSP Support for /, did not find org.apache.jasper.servlet.JspServlet? 2008-01-02 10:11:55.659:/:INFO: default: init 2008-01-02 10:11:55.659:/:INFO: jsp: init 2008-01-02 10:11:55.691::INFO: Started SelectChannelConnector?@0.0.0.0:8080
and then I am not able to compile jsp. Do you know how to solve this problem? Thank you
Ah, I probably have to include the appropriate libs to turn JSP support on. Could you please file a ticket? I'll get to it shortly.
I am currently using a hacked version of the Jetty Launcher so I can use Jetty 6. Would like to switch to this plugin, but I need the ability to read the jetty xml configuration file instead of defining the Context and WebApp? dir. Do you think this feature will be available in the future?
I'm not anxious to add any other functionality than it has now, but if you give me a good patch I guess it would be OK. Or you could help out with this project as a committer if you are interested (and promise to do a decent job and keep things simple) :-)
Eelco: Does this plugin support webapps whose URLs are rewritten? Here is an example of what I mean by that.
Imagine a foo.war webapp. Say the webapp uses Struts, so I may have Struts Action such as /foo/Login.do. Imagine that the webapp uses JSPs and that there is normally a link to this Login.do page, such as href="/foo/Login.do" type of thing. But this is one ugly URL, so imagine a situation where a developer decides to make use of Apache's URL rewriting capabilities and instead uses the following in his JSP: a href="/login" . This /login is a URL that the Apache server fronting the servlet container knows how to rewrite to /foo/Login.do under the hood.
So now I have JSPs with nice URLs, but those URLs are not /foo/xxx URLs. I could not get JettyLauncher? to work with this setup. Will r-j-r work with this setup?
Thanks!
This plugin just supports Jetty. If you know a way to configure Jetty to use URL rewriting and configure that via a Jetty XML configuration file and we implement support for the Jetty XML file in the future (shouldn't be too difficult, though I'm still extremely short in time... in fact I'm writing this from a shop in Bangkok while finalizing the wedding cards for my upcoming wedding), you should be good. Jetty is very configurable, so I can imagine that it can be done.
Good luck with the wedding and what follows! :)
As for Jetty and URL rewriting, Jetty is really 100% unaware of the fact that requests to it come from prettier URLs (e.g. /login) that the Apache that fronts it rewrites to webapp-specific URLs (e.g. /foo/Login.do). So, there is no telling Jetty about URL rewriting.
Thanks Otis! If you want to follow our wedding adventures, check out http://kayandeelco.weddingwindow.com/
> As for Jetty and URL rewriting, Jetty is really 100% unaware of the fact that requests to it come from prettier URLs (e.g. /login) that the Apache that fronts it rewrites to webapp-specific URLs (e.g. /foo/Login.do). So, there is no telling Jetty about URL rewriting.
In that case, I see no reason for you to get into trouble with this plugin. Just keep apache running and you should be fine, right? I'd say try it and let me know if you run into trouble :-)
I get the same error message as Angelo (from 1/2/08) - I'm a Tapestry user and was looking to move to this. Any clue where I should start?
oh - and I understand you're busy ... I got jettylauncher working w/ 3.3 for now, just wanted to make the switch in the long-term... congratz
Does the support for auto reloading of wicket html pages?I downloaded the plugin and run it w/ europa 3.3. It seems that the debugger and java files only can be auto-reload w/ just goin back-fort w/ the pages.What i want is that when i just press F5 the changes i made in html will take effect w/out further restarting the jetty server. Thanks a lot. Cheers.. nwei, happy weeding to eelco :)
The plugin does nothing special here, so it works like it works elsewhere :-)
Markup reloading will work if you turn it on. For instance, when you start up Wicket in development mode (provide -Dwicket.configuration=development in the VM arguments block, and I believe it is even still the default for Wicket)
Nice work. I had been itching to run jetty from eclipse using Java 1.6. (Jetty launcher can't do that, apparently).
Do you plan on supporting multiple simultaneous web applications?
First and foremost, I plan to keep things simple. How would you configure multiple web apps for instance? If you need specific things that are not supported, it is probably better to create a class with a main function that starts up Jetty exactly the way you want it (that's what the wicket-examples project does for instance, and what I'm using for my day job).
But hey, if you have a good patch, we can always discuss it :-)
This plugin does not seem to be working for me on Eclipse 3.2.2, Clicking "New" does not produce a new configuration.
Damn. You have an error log for me?
Using this plugin my application appears to initialize successfully, including MyFaces?. But when I access the URL an exception is thrown:
sun.misc.InvalidJarIndexException?: Invalid index
Further down the stack trace I see: 12:44:32,989 btpool0-1? ,log ? Nested in org.apache.jasper.JasperException?: Unable to compile class for JSP: org.apache.jasper.JasperException?: Unable to compile class for JSP
Any ideas as to why I am seeing this type of behavior?
Yeah, it looks like I need to package the plugin with Jasper (JSP compile) dependencies. I hope to find a little bit of time this weekend to look at it.
I'm not certain if it helps but I also followed a document on "Debugging Cocoon in Eclipse" which sets up a project to allow for debugging in Eclipse with Jetty 6. I followed it exactly as outlined and I received the same error. I don't know if the two are related or if it will lead you into a direction for resolution but here is the link.
http://cocoon.apache.org/1301_1_1.html
I created a new version of the plugin. Could you test with that please? Unfortunately, you first have to deinstall the first one; the update manager won't find updates. See the front page of this project.
I´m having problems with file locking on windows. I know I can configure jetty to "fix" this. but I can´t configure the plugin with the same settings.
Any ideas? See: http://docs.codehaus.org/display/JETTY/Files+locked+on+Windows
I uninstalled the old plugin and installed the new one, started the server and hit the application URL but received the following exception again:
sun.misc.InvalidJarIndexException?: Invalid index
Further down the stack shows: 12:15:20,185 btpool0-1? ,log ? Nested in org.apache.jasper.JasperException?: Unable to compile class for JSP: org.apache.jasper.JasperException?: Unable to compile class for JSP
Chris. I tested starting up a web app with a JSP and that worked fine. Anything special you're doing by any chance? What kind of web app are you trying to run?
The project uses MyFaces?. Nothing to extravagant. It's actually very simple what I am trying to do. The page that I am hitting is a login page that is very simplistic. It does a little song and dance with checking variables contained within the Request and/or Session. If it doesn't find them it simply directs the user to a login page to gather the info. The page is tied to a backing bean for binding the data elements.
I'll set some break points to see if I can hit any of my code or if it is failing before I even get that far.
Or you could see whether you can give patching the plugin a try. Shouldn't be too hard if you're comfortable with Java and Eclipse.
When I try to launch my app, I get this error : org.apache.xerces.parsers.XIncludeAwareParserConfiguration cannot be cast to org.apache.xerces.xni.parser.XMLParserConfiguration
The launch is working fine on Tomcatv5.5 though.
Also, when I launch my application with Jetty only (without eclipse and the plugin), everything is fine, I don't get this xerces/parser error. Any idea?
Not really. Do you have a stacktrace?
Ok, here is the stacktrace :
java.lang.ClassCastException?: org.apache.xerces.parsers.XIncludeAwareParserConfiguration cannot be cast to org.apache.xerces.xni.parser.XMLParserConfiguration
What PluginParser? does is simply : parser = new SAXParser(); Could it be a conflict with xerces implementations provided by run-jetty-run?
Pfff. I have no idea.
Would you be able to patch the dependencies of run-jetty-run and see how that works out? If you want to try, you need to check out run-jetty-run and run-jetty-run-bootstrap and tweak dependencies in these projects (var places, including in the build.xml, which produces a jar that i used in run-jetty-run).
Btw, are you using Java 5 or Java 4? If 4, could you try switching to 5 just for the test? I'm just now reading Jetty's docs and see that the JSP libs they are including depend on the version of Java in use. Currently, I just include the JSP libs for 5, but if I look at the libs for 4, they also include an xerces lib. So the solution to your problem and the JSP problems mentioned before might be to let the inclusion of jars depend on the java version or just include the ones for 4.
Eelco,
I need more time to investigate my issue. I'm begining to think that this is a ClassPath? issue. My project works when I run it from within Eclipse using Tomcat with the server plugin. To be able to compile my app successfully I need to include the server runtime libraries, without them the application will not compile. I think that when launching Jetty these libraries may be causing some complications which is resulting in the exceptions that I am seeing. I think I need to create a System Library variable which includes only those libraries that I need for compilation and the runtime libraries (like log4j). This may resolve the issue but will take me some time to configure.
I also get an issue with Hibernate that only occurs when using this plugin. I too believe this to be a class path issue, as it seems as though /META-INF/orm.xml isn't being added to the classpath for some reason. Is there support for META-INF class pathing?
That should work like it normally does. I don't think there's anything special I can do for this.
Okay, so I found the root cause of my problem when launching with runjettyrun. It appears as though in hibernate the following function:
will always return null. When I run in Tomcat, it does not. The funny thing about it is that the annotation is present in the debugger. I have not idea why this might be. Maybe someone could shed some light if they have had similar experiences
Please note that element.isAnnotationPresent is coming from rt.jar. Thus if something special is going on with that jar inside the plugin (a special local jar perhaps?), that maybe causing an issue.
And which JDK do you run it with in Eclipse?
jre1.6.0_02
Also, I get some weird reflection issues with Spring, Struts2, etc.
For example: com.cit.linkory.web.struts.converter.ThemeTypeConverter? cannot be cast to ognl.TypeConverter?
But it extends it. I notice the same thing if I remove hibernate and spring from the equation. So something is fundamentally wrong in my setup.
But if I remove struts from the picture, at least the app will load. Sorry for all the posts. If there is a better place for this discussion, let me know.
I don't know how to fix your problem (just posting while run-jetty-run installs!) but it may be helpful to know that class cast issues where you know the cast should work are usually down to the classloader - given class A extends B, if A and B are loaded in different ClassLoaders? then A instanceof B will be false.
Don't know whether that's of any use to you!
That's what I was thinking hmm... classloaders.... fun
I'm getting this error from eclipse any ideas why? Plug-in runjettyrun was unable to load class runjettyrun.JettyLaunchConfigurationTabGroup?. runjettyrun/JettyLaunchConfigurationTabGroup? (Unsupported major.minor version 49.0)
I assume I have some odd eclipse version from the error. This is what I'm running
Version: 3.3.1.1 Build id: M20071023-1652
What JDK are you running Eclipse on?
I upgraded from 1.4.2 to 5 today
And does it still fail after upgrading? I guess I should compile the starter using 1.4 (something I forgot to do I think).
it still fails email me 2 ncesitz@hotmail.com when the starter is ready
I'll post news on this site, and it should pop up as updates in Eclipse from now on. It might be a while before I have time to work on this again though.
I am using eclipse 3.3,Java 6, run-jetty-run ver. 1.0 , If I cannot resolve/connect to java.sun.com, startup time is slow. Something is attempting to open an http connection to java.sun.com. The timeout is 20 - 30 seconds. I would guess that something is attempting to locate a DTD or XSD on Jetty startup. Are there jetty dtd or xsd files missing from the plugin. After the delay, Jetty will start. Even when I can resolve java.sun.com run-jetty-run is 10 - 15 seconds slower on startup than a standalone version of jetty.
Trying to download the plugin for Eclipse 3.3 and receiving the following error:
Network connection problems encountered during search.
I can get to the site but not sure what's needed to download or where to install /config the plugin. Any suggestions?
Is there any way to hook into jetty.xml from the plugin?
I want to be able to set:
<Set name="classLoaderJava2Compliant">true</Set>
as described here:
http://jetty.mortbay.org/jetty5/faq/faq_s_250-Configuration_t_200classloading.html
The plugin will not accept WEB-INF directly under Eclipse project dir. Trying to enter ../ causes the plugin to freeze and throws error when selecting a Jetty webapp.
rtiernay,
I assume you mean using an alternate configuration file.
If you put your jetty.xml in a file named jetty-web.xml or web-jetty.xml in your WEB-INF/ directory, Jetty will use. In jetty-web.xml you can also define an alternate webdefault.xml which allows you to modify other server settings.
See: http://jetty.mortbay.org/jetty5/faq/faq_s_250-Configuration_t_150xmljettyweb.html
Thank you
I still have a question. Is it possible to enable the https too?
I am also having the same problem as zimowski74; I want to have a different output folder than the base of the project. When I do this, it cannot find the web.xml that I specify. Is there a different way to do this other than using ../src/webapp/WEB-INF?
I'm always using a different output folder myself. If you use src/webapp for your web app (like I always do in fact), put src/webapp in the WebApp? dir field.
zimowski74 did you try ./?
What about the plugin::
http://www.webtide.com/eclipse
That's a fine plugin as well, but it requires WTP and Jetty to be installed first.
Hello everybody,
I have also had some small troubles with run-jetty-run plugin. When I am deploying (using the plugin) a simple tapestry application (type of HelloWorld?) I get the following stack trace:
javax.servlet.ServletException?: Unable to initialize application servlet: Error: Module hivemind is duplicated! Definition in jar:file:/C:/source/workspaces/foobar/demo/WebRoot/WEB-INF/lib/hivemind-1.1.1.jar!/META-INF/hivemodule.xml has been ignored in favor of existing definition from jar:file:/C:/source/workspaces/foobar/demo/WebRoot/WEB-INF/lib/hivemind-1.1.1.jar!/META-INF/hivemodule.xml.
I have been searching for an answer from the web and I think this is an classloader issue. When I package the application as WAR -file and deploy it to Jetty 6.1.7 standalone (not using the eclipse plugin) or Tomcat 5.5 standalone it works just fine.
My environment as follows: Eclipse 3.3.2 Run-jetty-run plugin 1.0.1 (including Jetty 6.1.6) JRE 1.6.0_01 Tapestry 4.1.5 (packaged into the app)
Any ideas how to tackle this issue?
Great plugin! But how can I get it to log to log4j instead of stderr?
For newbie like me:
Hi!
My webapp needs a userrealm. I add this using the following in the jetty config:
<Call class="java.lang.System" name="setProperty"> <Arg>java.security.auth.login.config</Arg> <Arg><SystemProperty name="jetty.home" default="." />/etc/login.conf</Arg> </Call> <Set name="UserRealms"> <Array type="org.mortbay.jetty.security.UserRealm"> <Item> <New class="org.mortbay.jetty.plus.jaas.JAASUserRealm"> <Set name="Name">EMCSREALM</Set> <Set name="LoginModuleName">EMCSLogin</Set> </New> </Item> </Array> </Set>How can I do this with in eclipse???
Thanks in advanced.
Marco
I successfully installed this plugin in Eclipse 3.3.2, but can't seem to find the icon/link to launch the screen shown above. Where is the icon/link supposed to be located?
Never mind. I found the run link.
I have also got the problem with classpath/classloader. Most notable is Hibernate:
java.lang.IllegalArgumentException?: Cannot convert value of type org.hibernate.impl.SessionFactoryImpl? to required type org.hibernate.SessionFactory? for property 'sessionFactory': no matching editors or conversion strategy found
Even though one is an implementation of the other. I have checked and double checked to make sure that the project only contains one reference to the hibernate library.
When I run the application in normal Jetty 6.x or Tomcat x it works like a charm, so I'm backing up the classpath/classloader issue.
Added an issue on this as well, anyone got any luck on solving this?
Hello
I also have problems with classloader. http://code.google.com/p/run-jetty-run/issues/detail?id=15
hi~!
i got a lot of ClassCastException?,after i move all jars from WEB-INF/lib to ${WebAppRoot?}/lib these problem solved,the project can run successfully. but it still get ClassCastException? when i try to login,any one got these exception also?
I setup my projects so that the project folder IS the webapp folder so it's <project/WEB-INF/web.xml> when i try and create a launch config, it tells me web directory is not set? I can't say project root?
Hi Eelco,
Congrats on the 6 month wedding anniversary!
Just installed this and have the following issue. In my Eclipse log, I get this:
!ENTRY org.eclipse.debug.core 4 5020 2008-08-27 15:04:35.174 !MESSAGE Launch configuration type id "com.iw.plugins.jettylauncher.webApp" does not exist. Possible causes:
Missing specification of a launch type (missing plug-in) Incorrect launch configuration XML
Now, my webapp seems to startup correctly (according to the logs) but I can't reach it, i.e I always get a 404. Is it possible that this is related?
Installed on 3.4 on OSX and get : Exception in thread "main" java.lang.NoClassDefFoundError?: javax/servlet/http/HttpServletRequest?
How do you see the logs for this? I am able to redirect the page to a url but I don't see the pages.
Unfortunately run-jetty-run does not play nice with m2eclipse plugin because m2eclipse does some magic with the runtime classpath (described at http://docs.codehaus.org/display/M2ECLIPSE/Runtime+classpath).
I am trying to use the plugin but I am getting this exception every time I run the plugin I get this exception Caused by: java.lang.ClassNotFoundException?: javax.servlet.ServletRequestListener?
when I explicitly put the servlet-api.jar in the classpath I then get this exception java.lang.ClassNotFoundException?: org.slf4j.Logger
Has anyone see this before ?
Petros
Great work! Installation without any problems, works like a charm! Thanks!
Great plugin! Thank you.
Hi,
I'm using the "plus" features of Jetty - my servlet seems to blow fail as soon as I try calling any method in it. Is there a way to use this plugin with the "plus" features enabled?
Thanks
tdilinux said:
- Installed on 3.4 on OSX and get : Exception in thread "main" java.lang.NoClassDefFoundError?: javax/servlet/http/HttpServletRequest?
I had the same issue. I had a Jetty 6 download from a while back and added the servlet-api-2.5-6.0.2.jar file that came with it to the classpath and it worked.
Is it work with Eclipse 3.4? I face this error when trying to install:
An error occurred during provisioning.
Just installed r-j-r version 1.0.1 on eclipse 3.4.0(Build id: I20080617-2000)
Able to create run configuration, but when try to launch got exception java.lang.NoClassDefFoundError?: org/apache/juli/logging/LogFactory? in console
manually add tomcat-juli.jar from tomcat installation in run configuration classpath solve the problem
How can we remote debug with plugin?
Hi!
Why does it only work the first time. Second time I want to build after changes I get: 13:43:08.329 WARN!! Failed to start: SocketListener0?@0.0.0.0:8081 FATAL - Start - Could not start the Jetty server: org.mortbay.util.MultiException?Address already in use?
anyone figure out the slf4j logger issue from above?
The slf4j issue was fixed for me when I added the following VM argument in the debug configuration
-Dorg.mortbay.jetty.webapp.parentLoaderPriority=true
Martijn Brinkers
is there an updated version available for jetty-6.1.15,
because the mvn jetty:run was plugin was taking this version and
jetty-webapp plugin is still starting the application with 6.1.4 version itself
and giving some context not loaded errors while i try to start the debug of my application from eclipse?
Hi!
How do I reload the servlet? If i start the Jetty server from ecplise using the run configuration it works fine. When making changes in the code and updating the .class file the servlet isnt redeployed. I have to change the context or use another port. Isnt there a way to reaload the servlet when i launch it from this plugin?
Cheers!
Works great, thanks very much!
Hey, 1st of all, thanks for your work! works great!
i have a question: where are the compiled JSP during the runtime?
thx!
Sebastian, I think you're asking where the JSP compiler puts the generated Java files. I'm not certain, but you might read the following:
http://jetty.mortbay.org/jetty5/faq/faq_s_950-JSP_t_JSP.html
I suspect it will be difficult with run-jetty-run to control the location of the generated Java files.
James
Thx for your answer James!
The page didn't helped me. I think, RunJettyRun? holds the compiled JSPs in the RAM. I'm asking because of an Exception in a JSP, and the stacktrace just links to the compiled JSP...
Could you package this as a .zip file so that I could just drop everything into p2's dropins/ directory? This saves us from reinstalling this wonderful plugin from update site everytime I upgraded my Eclipse.
Thanks.
Please submit an enhancement request for this. I'm thinking of automating the build with Maven (it is currently quite manual), and could include this idea if you'll help me remember it.
while double clicking Jetty from Run,Conf I am getting an error stating "An error has occurred. See error log for more details. org.eclipse.jdt.internal.debug.ui.launcher.WorkingDirectoryBlock?: method <init>()V not found" Version using -->eclipse 3.4.2 Jetty plugin ->1.4.1 machine -> Windows Xp
Please help me to proceed.
@harishmatrix
Do you mean you're using Java 1.4.1? If so, you'll need to use Java 1.5 or greater (I don't recall if I've tried running it with Java 1.6).
Good plugin.. It's working very well.
How to create the configuration tab in our java project.We need to use the JDK1.5 or higher to run this HTTP server in our project!