dropwizard

Dropwizard Assets not serving static content outside of root path

别说谁变了你拦得住时间么 提交于 2019-12-14 04:05:51
问题 Here's my Dropwizard (0.8.5) app's basic project structure: myapp/ src/main/groovy/ org/example/myapp/ MyApp.groovy <lots of other packages/classes> controllers/ site/ SiteController.groovy dashboard/ DashboardController.groovy org/example/myapp/views site/ SiteView.groovy dashboard/ DashboardView.groovy src/main/resources/ assets/ images/ mylogo.png org/example/myapp/views/ site/ header.ftl index.ftl dashboard/ dashboard.ftl Where the gist of each of those classes is: class MyApp extends

Dropwizard Application crashed by AbstractJAXBProvider

戏子无情 提交于 2019-12-14 03:55:17
问题 I have a server application implemented using Dropwizard and Gradle as Build System. Now I want to integrate Apache Mahout for some recommender system action. After adding the Mahout dependency and try to run, I get exceptions. My initial dependencies look like dependencies { compile 'io.dropwizard:dropwizard-core:0.9.1' compile 'io.dropwizard:dropwizard-jdbi:0.9.1' compile 'mysql:mysql-connector-java:5.1.37' compile 'redis.clients:jedis:2.8.0' compile 'com.google.guava:guava:18.0' compile

JDBI's @BindBean doesn't find named parameters in bean class during INSERT

本小妞迷上赌 提交于 2019-12-14 02:16:22
问题 I am consistently getting the following exception below when inserting values using JDBI's @BindBean into my Mysql database within Dropwizard. The problem seems to be that JDBI is unable to find the properties in the bean. I already isolated the issue into a separate project, but can't figure out where this is going wrong. I would be very grateful for some advice. org.skife.jdbi.v2.exceptions.UnableToExecuteStatementException: Unable to execute, no named parameter matches "title" and no

@Context injection not working in Jersey ContainerRequestFilter (Dropwizard)

ⅰ亾dé卋堺 提交于 2019-12-13 13:28:23
问题 @Context injection works with classes but not able to make it work with Objects. httpServletRequest in ContainerRequestFilter produces null pointer. Dropwizard Version:- 1.1.0 ContainerRequestFilter public class ApplicationIPAuthFilter implements ContainerRequestFilter { private static final Logger LOGGER = LoggerFactory.getLogger(ApplicationIPAuthFilter.class); private HerculesRestAccessor restAccessor; private String applicationName; @Context private HttpServletRequest httpServletRequest;

Using cometd in dropwizard

ⅰ亾dé卋堺 提交于 2019-12-13 04:29:57
问题 I'm trying to use cometd as a servlet to dropwizard but BayeuxServer doesn't seem to get injected in my service. I'm adding my two servlets as so (note, I'm not using web.xml so I'm defining the params myself): cometdConfig.put("services", MyService.class.getCanonicalName()); System.out.print("OrderService name: " + MyService.class.getCanonicalName()); environment.addServlet(AnnotationCometdServlet.class, "/cometd/*").addInitParams(cometdConfig).setInitOrder(1); environment.addServlet(new

Dropwizard RequestLog

本小妞迷上赌 提交于 2019-12-13 01:41:36
问题 I have an strange exception while integration testing my Dropwizard 0.9.2 service. The exception and configuration are below. I dont understand why requestLog is unknown? The DW documentation say, that below configuration part should work. The requestLog can be found in io.dropwizard.server.AbstractServerFactory.class and io.dropwizard.server.DefaultServerFactory.class extends it, so it should be possible to use the requestLog. Whats wrong here? Someone knows this problem already?

How do I implement Guava Caching in Dropwizard?

旧巷老猫 提交于 2019-12-13 01:39:12
问题 I'm trying to setup a cache using guava, with the following code: private List<Profile> buildCache() { LoadingCache cache = CacheBuilder.newBuilder() .expireAfterWrite(10, TimeUnit.MINUTES) .maximumSize(40) .build( new CacheLoader<Profile, List<Profile>>() { @Override public List<Profile> load(Profile profile) throws Exception { Profile profile1 = new Profile(); Profile.setEmployed(true); return profileDAO.getAllProfiles(Profile1, null); } } ); return (List<Profile>) cache; } public List

Unit testing views in dropwizard

馋奶兔 提交于 2019-12-12 18:43:03
问题 I'm trying to test that a view returned from a drowpizard resource is assembled correctly. Specifically, the view to add a user has a field that allows a password checker to reject an attempt to build a user if it fails to meet certain rules. The view works great when deploying and running the webapp, and specifying a bad password, but when I try to unit test it, it throws a web application exception saying there's no message body writer for the view. My unit test is pretty plain: @Test

Removing an added provider in Jersey

被刻印的时光 ゝ 提交于 2019-12-12 18:10:01
问题 I am using com.yammer.dropwizard.config.Environment addProvider method to register providers in Jersey.I have a custom provider too which does a task similar to Dropwizards own MessageBodyWriterProvider. Jersey seems to select the inbuilt MessageBodyWriter instead of my custom one.So I figured that if I remove the inbuild provider which is registered and register my own it will work properly. Is there a way to remove the already added provider with the class name or other way? 回答1: