Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Disable Jetty's locking of static files #7

Closed
GoogleCodeExporter opened this Issue Jul 7, 2015 · 17 comments

Comments

Projects
None yet
1 participant
What steps will reproduce the problem?
1. install the plugin on eclipse/windows and configure the launcher
2. hit any page with your browser
3. change any static file, like css or js files
4. try to save. Eclipse will complain

What version of the product are you using? On what operating system?

Eclipse: 3.3.1.1 (Build id: M20071023-1652)
OS: Windows XP/SP2
RunJettyRun: 1.0.0


Original issue reported on code.google.com by leandro....@gmail.com on 5 Feb 2008 at 4:32

I was excited to see a new version of the plugin, but didn't luck out.  I was 
hoping
it would let me specify a jetty config file, so that I could do the following:

http://docs.codehaus.org/display/JETTY/Files+locked+on+Windows

Original comment by mden...@gmail.com on 6 Feb 2008 at 3:56

You can do the following: extract the runjettyrun_1.0.1.jar in the eclipse 
plugin
directory, then extract the jetty-6.1.6.jar in the lib directory. Edit the file
org\mortbay\jetty\webapp\webdefault.xml and change the "useFileMappedBuffer" to
false. It should look like the following:

    <init-param>
      <param-name>useFileMappedBuffer</param-name>
      <param-value>false</param-value>
    </init-param>  

Then pack the jetty-6.1.6.jar and the runjettyrun_1.0.1.jar again. You can use 
a zip
program for the packing.

Original comment by hantsc...@gmail.com on 4 Mar 2008 at 7:56

It would be very nice if we didn't need to follow hanstchel's steps to have 
Jetty 
not locking CSS and Javaspript files . . .

Original comment by thiag...@gmail.com on 2 Sep 2008 at 9:29

Is there any time frame on this being fixed without doing the steps above?

As a side note, we tried these steps with Eclipse 3.3, RJR 1.0.1, and Tapestry
5.0.14.  The steps above did not work.

Original comment by dustin.digmann on 11 Sep 2008 at 11:45

Changing the webdefault.xml in the plugin package didn't worked for me either.

Original comment by pedrofu...@gmail.com on 6 Oct 2008 at 3:09

It worked for after also editing the file at
eclipse/configuration/**/jetty-6.jar/webdefault.xml. I belive that doing a 
eclipse
-clean will have the same effect.

Original comment by pedrofu...@gmail.com on 7 Oct 2008 at 1:24

I found another way, that may or may not be easier.
It surely is less intrusive.

Since run-jetty-run loads the webdefault.xml from the classpath, just make sure 
that
your webdefault.xml is located in the expected package and contained in the 
classpath
before the run-jetty-run libraries.

So having a org/mortbay/jetty/webapp/webdefault.xml in my projects classpath 
allowed
my to apply my own webdefault.xml.

Original comment by stevend...@gmx.at on 16 Jan 2009 at 11:47

But how will you make sure it will look for your webdefault.xml before the 
plugin's?

Original comment by pedrofu...@gmail.com on 16 Jan 2009 at 4:19

The order of the classpath entries determines that.
When searching for a resource, the classpath entries are iterated in the order 
they
were defined.

In the classpath tab of the "Run configurations" dialog you can make sure that 
the
entry containing your webdefault.xml is placed before the run-jetty-run 
libraries.

Original comment by stevend...@gmx.at on 17 Jan 2009 at 2:18

FWIW, version 1.1 has been released, and substantially changes the class path 
used, 
which may invalidate the workarounds described in the earlier comments.

Old summary: File locking on windows
New summary: Disable Jetty's locking of static files

Original comment by James.Sy...@gmail.com on 4 May 2009 at 12:43

  • Changed title: Disable Jetty's locking of static files
  • Changed state: Accepted
Issue 17 has been merged into this issue.

Original comment by James.Sy...@gmail.com on 4 May 2009 at 12:56



Original comment by James.Sy...@gmail.com on 6 Jun 2009 at 6:40

I used stevend's method and it worked like a charm.  For some reason I got 
errors when 
trying to launch after repacking the jars (I'm using Spring STS instead of a 
stock 
standard Eclipse install)

Original comment by trump...@gmail.com on 1 Jun 2010 at 2:20

The simple method that works for me is to add this configuration snippet to 
web.xml:

    <servlet>
        <servlet-name>default</servlet-name>
        <init-param>
            <param-name>useFileMappedBuffer</param-name>
            <param-value>false</param-value>
        </init-param>
    </servlet>

Sasa

Original comment by sasa.ske...@gmail.com on 26 Jun 2010 at 11:42

I think James fix this in r55 and now in Jetty 1.2 .


Original comment by tonylovejava on 11 Mar 2011 at 10:29

  • Changed state: Fixed
  • Added labels: 1.1
This still happens using 

<plugin>
    <groupId>org.mortbay.jetty</groupId>
    <artifactId>jetty-maven-plugin</artifactId>
    <version>7.4.5.v20110725</version>
</plugin>


Original comment by dev2.al...@gmail.com on 1 Aug 2011 at 12:16

errrr, maven-jetty-plugin is not part of RunJettyRun...

Original comment by tonyw...@potix.com on 1 Aug 2011 at 4:39

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment