Code Monkey home page Code Monkey logo

Comments (15)

klauern avatar klauern commented on May 13, 2024

Holy. And within a minute of reporting this, the light went on to look at the alternate constructors for AssetsBundle, finding one where I set the maxCacheSize to 0, and voila, works...

Silly me.

from dropwizard.

BorisNaguet avatar BorisNaguet commented on May 13, 2024

Hello,
I know I comment a one year old issue, but I have the same problem AND this solution is not working anymore:
AssetsBundle has no maxCacheSize property anymore.

Have you find another way to set that?
Thanks

from dropwizard.

codahale avatar codahale commented on May 13, 2024

You'll need to figure out how to get your IDE to update resources in the classpath.

For IntelliJ, this means running the Dropwizard application in Debug mode and executing Run | Reload Changed Classes.

Dropwizard does not support a "dev mode", nor do I have any plans to add one.

from dropwizard.

BorisNaguet avatar BorisNaguet commented on May 13, 2024

Actually, I use Eclipse, and with "Automatic Build", resources are systematically copied from src/main/resources to /target/classes
I just made a test to be sure :)
So I thought it was some kind of cache...

As my webpages are 100% static, I can still use the jettyRun maven plugin on the side for dev and start both Dropwizard and this Jetty

from dropwizard.

BorisNaguet avatar BorisNaguet commented on May 13, 2024

Apparently it's windows specific, and it has changed since Jetty 8:

Here's proposed solution, that I'm not able to really understand:
http://stackoverflow.com/a/16235377

In DW config, I can set connectorType, and all the buffer'sizes but not the buffer's types.
Regards

from dropwizard.

BorisNaguet avatar BorisNaguet commented on May 13, 2024

I found it - just add in your config file:

    http:
      useDirectBuffers: false

Works perfectly now :)

from dropwizard.

ilja4 avatar ilja4 commented on May 13, 2024

since 0.7.0 there is no useDirectBuffers option.

from dropwizard.

Vadi avatar Vadi commented on May 13, 2024

OK. It is 2015 today. Any solution for this? Every time compiling when changing code in views is really killing time.

from dropwizard.

rjschu avatar rjschu commented on May 13, 2024

I do this by using grunt and a few grunt tasks (grunt-watch, grunt-clean and grunt-copy) to update my assets files in the build directory.

when you have grunt-watch running all you have to do is make the changes to you assets files and then grunt will replace the files in your build directory so you can just refresh your webpage and get the changes.

I know this isnt a solution to the issue but its a decent work around :)

from dropwizard.

BorisNaguet avatar BorisNaguet commented on May 13, 2024

Here's a solution on DW 0.7.1:

Dynamic dynamic = environment.admin().addServlet("assets", new AssetServlet("/website", "/admin-site/", "index.html", Charsets.UTF_8));
dynamic.addMapping("/admin-site/*");
if(devMode){
    dynamic.setInitParameter("useFileMappedBuffer", "false");
}

from dropwizard.

mv200580 avatar mv200580 commented on May 13, 2024

For Eclipse is good to use Filesync plugin, as it explained here http://www.onehippo.org/library/development/use-filesync-eclipse-plugin-for-faster-turn-around.html

from dropwizard.

esiqveland avatar esiqveland commented on May 13, 2024
Dynamic dynamic = environment.admin().addServlet("assets", new AssetServlet("/website", "/admin-site/", "index.html", Charsets.UTF_8));
dynamic.addMapping("/admin-site/*");
if(devMode){
    dynamic.setInitParameter("useFileMappedBuffer", "false");
}

Works for me in DW 0.9.
I use this and set my js build tool to copy the bundles into ./target/classes/assets/

from dropwizard.

jplock avatar jplock commented on May 13, 2024

Should we always default this parameter to false or make AssetBundle be configurable?

from dropwizard.

qinfchen avatar qinfchen commented on May 13, 2024

+1 on making AssetBundle configurable. Is there a plan to support "dev mode"?

from dropwizard.

esiqveland avatar esiqveland commented on May 13, 2024

I think it's good for production use, but very annoying for developing with.
Not sure if it should be configurable or not, but maybe DW could use an overall devmode? This has probably been discussed before though.

On the other hand it is part of dropwizard-assets, so it could be fine to add it to AssetBundle?

I'm guess it is something everyone using assets in dropwizard has to deal with.

from dropwizard.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.