Comments (12)
Some changes you make to the classfile are properly hot updated. So it's not a
good
idea to always restart jetty upon classfile change.
Original comment by [email protected]
on 26 Feb 2008 at 1:08
from run-jetty-run.
I've actually found the reason for this ... I kept all my libraries in
WEB-INF/lib,
this caused them to get loaded twice (by both runjettyrun and jetty I suppose).
A fix for this would be greatly appreciated :)
Original comment by [email protected]
on 24 Apr 2008 at 10:02
from run-jetty-run.
I've developed a fix for this, which works for me and may for others: I set the
class path of the launched Bootstrap to be the minimum
to start Bootstrap and Jetty, and set the class path of the web app to the
class path of the project.
Some background explaining why I did this:
My team uses maven and tomcat (I'm the only Eclipse and jetty user), where we
have a root directory (let's call it foo :-)), which
contains several directories which I've setup as separate Eclipse projects
(e.g. foo/core/ and foo/web/ become Eclipse projects core
and web). Maven compiles to foo/core/target/classes/ and
foo/web/target/classes/, and packages such that foo/web/target/product.war
is the result, with foo/web/target/product/ is the unpacked form of the war
(i.e. all the classes are now in jars in foo/web/target/product/WEB-INF/lib/).
When I launch web (with my WebApp Dir set to web/target/product), RJR runs
fine, until I want to edit the code while it in the
debugger. Because Eclipse writes the classes to <project>/target/classes, the
JVM doesn't see that the file has changed (the JVM
read the class files from the jars in foo/web/target/product/WEB-INF/lib/).
The same applies to changes to resource files.
The reason this happens is as follows: when RJR launches, it sets the class
path to a concatenation of the following:
* The class path of the web project (i.e. the foo/<project>/target/classes/
directories, and each of the jars on the class path of
those projects).
* The 8 jars that RJR includes (e.g. jetty, servlet and
run-jetty-run-bootstrap).
When Bootstrap starts Jetty, Jetty creates a WebAppClassLoader for the webapp
that it populates with the contents of the webapp's WEB-
INF/classes and WEB-INF/lib directories, where maven puts the built jars, and
the jars they depend upon. The parent class loader is
the one for Bootstrap, which contains the directories where Eclipse will write
class files.
As a result of this arrangement, each of the classes we build, and their
dependencies, appear on the effective class path twice, and
with the jar form appearing "first" (the WebAppClassLoader will first look in
WEB-INF before falling back to the parent class loader).
When running my webapp from Eclipse, with Jetty, I want to ignore the contents
of the WEB-INF/classes and WEB-INF/lib directories, and
instead use the project's class path. So, I changed RJR to produce two class
paths, one used to start the JVM, the other passed as a
-D argument that Bootstrap uses to create a ProjectClassLoader (a new subclass
of WebAppClassLoader, that blocks the addition of the
WEB-INF/classes directory and the WEB-INF/lib jars), and this
ProjectClassLoader is used to initialize the WebAppContext.
I have not yet made this behavior conditional (well, it is in Bootstrap, but
not in the RJR plug-in).
If folks are interested, I can either attach the changes, or check them in
(which I assume would require me being added as a project
member).
Original comment by [email protected]
on 10 Oct 2008 at 1:33
from run-jetty-run.
I am really interested. How can I get your solution?
Original comment by fernando.wermus
on 15 Apr 2009 at 8:22
from run-jetty-run.
Fernando,
Eelco has added me to the project. I'll work on producing a new version of RJR
(hopefully over the weekend).
James
Original comment by [email protected]
on 17 Apr 2009 at 9:35
from run-jetty-run.
could i join?
I have exactly the same problem. have both class paths, which are very annoying.
I'll appreciate that.
Thanks,
Jia
Original comment by [email protected]
on 1 May 2009 at 8:24
from run-jetty-run.
I've released version 1.1 of Run Jetty Run to address this problem (at least,
as it
impacted my use).
Changing summary from "Add scanner to restart the server when classes change"
to "Add dependent projects to class path"
Original comment by [email protected]
on 4 May 2009 at 12:26
- Changed state: Fixed
from run-jetty-run.
Issue 15 has been merged into this issue.
Original comment by [email protected]
on 4 May 2009 at 12:55
from run-jetty-run.
Hi,
I just enhanced your project to redeploy(like tomcat did) the classpath which
is modified(only scan directory not jar file). And I also added two attributes
to the configuration's panel, one is Scan Interval Seconds and the other is
Enable Scanner. If someone like me desire this feature please mail to me, I
will send the updated version to you.
Cheers,
Jumper
Original comment by [email protected]
on 13 Oct 2010 at 2:22
from run-jetty-run.
I tested jumperchen's modification and it seems to work perfectly! This feature
should definitively be added to the official version.
Original comment by [email protected]
on 5 Nov 2010 at 6:56
from run-jetty-run.
Thanks Jumper and above discussion to provide me the scanner code fix,
it will merge in 1.2 .
Original comment by tonylovejava
on 10 Mar 2011 at 5:54
- Added labels: 1.1.1
from run-jetty-run.
it's not working in 1.2 because a wrong commit.
Will fix in 1.2.1
Original comment by tonylovejava
on 22 Mar 2011 at 7:30
- Added labels: 1.2
- Removed labels: 1.1.1
from run-jetty-run.
Related Issues (20)
- Duplicated bootstrap implementation in every jetty version plugin
- No repository found at http://xzer.github.io/run-jetty-run-updatesite/current/. HOT 2
- The jetty plugin makes opening "run configurations" very slow HOT 10
- servlet3 does work, but spring mvc aysnc (servlet3) doesn't HOT 2
- No context loaded when using custom jetty.xml HOT 6
- How to enable Jetty's JMX?
- Update site broken HOT 1
- Error occurs when installing on Eclipse Luna HOT 2
- Provide a way to set setWantClientAuth (or do it by default) HOT 1
- How to allow reverse proxy through RunJettyRun HOT 1
- Maven Managed Dependencies cannot be loaded automatically. HOT 1
- How to add support for Jetty 9.4.6.v20170531 HOT 2
- Cannot update from nightly update site HOT 9
- Update site is down HOT 5
- how to let single instance jetty-run for multiple web apps HOT 2
- How to install RJR OFFLINE HOT 1
- The calling class org.jboss.resteasy.cdi.CdiInjectorFactory is placed in multiple bean archives HOT 1
- Test dependencies are present in the runtime classpath
- error about jsr356 when start in eclipse used RJR
- Using recent JREs yields MaxPermSize error HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from run-jetty-run.