GWT + Spring + No bean named 'dispatch' is defined - java

while trying to use spring dependency injection instead of guice, getting below error
No bean named 'dispatch' is defined
[WARN] /dispatch/
org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'dispatch' is defined
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:527)
at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1083)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:274)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1079)
at org.springframework.web.context.support.HttpRequestHandlerServlet.init(HttpRequestHandlerServlet.java:57)
at javax.servlet.GenericServlet.init(GenericServlet.java:212)
at org.mortbay.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:433)
at org.mortbay.jetty.servlet.ServletHolder.getServlet(ServletHolder.java:342)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:463)
Could you please help on this.
web.xml content is as below
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath*:META-INF/applicationContext.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<servlet>
<servlet-name>dispatch</servlet-name>
<servlet-class>org.springframework.web.context.support.HttpRequestHandlerServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>dispatch</servlet-name>
<url-pattern>/dispatch/*</url-pattern>
</servlet-mapping>
And SeverModule class is
package com.khush.util.server.spring;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import com.gwtplatform.dispatch.server.actionvalidator.ActionValidator;
import com.gwtplatform.dispatch.server.spring.HandlerModule;
import com.gwtplatform.dispatch.server.spring.actionvalidator.DefaultActionValidator;
import com.gwtplatform.dispatch.server.spring.configuration.DefaultModule;
import com.khush.util.shared.action.RetrieveAccountsAction;
#Configuration
#Import(DefaultModule.class)
public class ServerModule extends HandlerModule {
public ServerModule() {
}
#Bean
public RetrieveAccountsHandler getRetrieveAccountsHandler() {
return new RetrieveAccountsHandler();
}
#Bean
public ActionValidator getDefaultActionValidator() {
return new DefaultActionValidator();
}
protected void configureHandlers() {
bindHandler(RetrieveAccountsAction.class, RetrieveAccountsHandler.class);
}
}
Regards.

Can you paste in here the content of your applicationContext.xml. I think you forgot to add the tag :
<context:component-scan base-package="package to scan..."/>
Without this tag the Spring can't detect Beans outside the XML file.

Related

Getting 404 page not found after adding ContextLoaderListener to spring mvc project with primefaces pages

I am new to Spring and trying to make integration between spring and primefaces. I am getting 404 page no found when I run the project on tomcat after adding the ContextLoaderListener and RequestContextListener.
My web.xml file:
<?xml version = "1.0" encoding = "UTF-8"?>
<web-app xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance"
xmlns = "http://java.sun.com/xml/ns/javaee"
xmlns:web = "http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation = "http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
id = "WebApp_ID" version="2.5">
<welcome-file-list>
<welcome-file>login.xhtml</welcome-file>
</welcome-file-list>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet>
<servlet-name>dispatcher</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>dispatcher</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.xhtml</url-pattern>
<url-pattern>/faces/*</url-pattern>
</servlet-mapping>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/spring/spring.xml
</param-value>
</context-param>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
<listener>
<listener-class>
org.springframework.web.context.request.RequestContextListener
</listener-class>
</listener>
</web-app>
and this is my faces-config.xml file:
<?xml version="1.0" encoding="UTF-8"?>
<faces-config
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_3.xsd"
version="2.3">
<application>
<el-resolver>org.springframework.web.jsf.el.SpringBeanFacesELResolver</el-resolver>
</application>
<navigation-rule>
<display-name>/login.xhtml</display-name>
<from-view-id>/login.xhtml</from-view-id>
</navigation-rule>
<navigation-rule>
<display-name>/login.xhtml</display-name>
<from-view-id>/login.xhtml</from-view-id>
<navigation-case>
<from-outcome>viewRecords</from-outcome>
<to-view-id>view.xhtml</to-view-id>
<redirect/>
</navigation-case>
</navigation-rule>
</faces-config>
and following is my controller class:
package com.testtask.nagarro.controller;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import javax.validation.Valid;
import org.hibernate.annotations.Source;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;
import com.testtask.nagarro.forms.LoginForm;
import com.testtask.nagarro.forms.StatementForm;
import com.testtask.nagarro.interfaces.StatementRepository;
import com.testtask.nagarro.interfaces.UserService;
import com.testtask.nagarro.models.Statement;
#Controller
public class NagarroController {
#Autowired
private UserService userService;
public UserService getUserService() {
return userService;
}
public void setUserService(UserService userService) {
this.userService = userService;
}
#RequestMapping(value= "/", method=RequestMethod.GET)
public String loginPage() {
return "login";
}
#RequestMapping(value="/login", method=RequestMethod.GET)
public ModelAndView login() {
ModelAndView model = new ModelAndView();
model.setViewName("login");
return model;
}
#RequestMapping(value="/viewRecords", method = RequestMethod.POST)
public String showHomePage(StatementForm form) {
System.out.println("In view records controller");
List<Statement> records = getUserService().getRecordsByAccountId(form.getAccountId());
return "view";
}
#RequestMapping(method=RequestMethod.POST)
public String processForm(#Valid LoginForm loginForm, BindingResult result,
Map<String, LoginForm> model) {
String username = "UserName";
String password = "password";
if(result.hasErrors()) {
return "loginform";
}
loginForm = (LoginForm) model.get("loginForm");
if(!loginForm.getUsername().equals(username) || !loginForm.getPassword().equals(password)) {
return "loginForm";
}
model.put("loginForm", loginForm);
return "home";
}
}
I tried to find a solution online but I am confused because most of the examples are using jsps.
please point me to the problem, I am attaching the github link.
Your views are NOT in webapp/WEB-INF folder as you defined in your InternalViewResolver bean.
They are located in webapp folder.

Add a Controller class to a Servlet using Jersey Annotation getting 404

In the web.xml is defined this servlet mapping:
<servlet>
<servlet-name>JAX-RS External REST Servlet</servlet-name>
<servlet-class>org.glassfish.jersey.servlet.ServletContainer</servlet-class>
<init-param>
<param-name>javax.ws.rs.Application</param-name>
<param-value>xxx.rest.external.XxxExternalRestApplication</param-value>
</init-param>
<init-param>
<param-name>com.sun.jersey.config.feature.DisableWADL</param-name>
<param-value>true</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>JAX-RS External REST Servlet</servlet-name>
<url-pattern>/external/rest/*</url-pattern>
</servlet-mapping>
I cannot modify the web.xml.
I have created a WebAppplicationInitializer in order to get the registered Servlet on the path /external/rest
Here is the code:
package com.xxx.extended.base.config.sailpoint;
import com.xxx.extended.controllers.IRestControllerMarker;
import com.xxx.extended.controllers.LocalManagedEntitlementsRestController;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.glassfish.jersey.server.ServerProperties;
import org.glassfish.jersey.servlet.ServletProperties;
import org.springframework.web.WebApplicationInitializer;
import javax.servlet.ServletContext;
/**
* Uses to extend parameter of external rest api to include custom controllers
*/
public class XxxExternalRestWebApplicationInitializer implements WebApplicationInitializer
{
private static final Logger log = LogManager.getLogger(XxxExternalRestWebApplicationInitializer.class);
/**
* Rest api servlet name
*/
private static final String REST_SERVLET_NAME = "JAX-RS External REST Servlet";
#Override
public void onStartup(ServletContext servletContext) {
log.debug("Try to get external servlet by name:[{}]", REST_SERVLET_NAME);
var registration = servletContext.getServletRegistration(REST_SERVLET_NAME);
if (registration == null) {
log.error("Could not find external servlet registration. External api will not work!!!!");
return;
}
registration.setInitParameter(ServerProperties.PROVIDER_PACKAGES, LocalManagedEntitlementsRestController.class.getPackageName());
log.debug("Registered the controllers from this package: [{}]",IRestControllerMarker.class.getPackage().getName());
}
}
After the startup of the application the WebApplicationInitializer is actually recognized, but when I am sending a GET request to the controller I get a 404 Not Found, I pretty sure the URL is fine.
Actually it seems not scanning the package to fetch the controllers to show.
My feeling is that because in the Application defined:
xxx.rest.external.XxxExternalRestApplication
the controllers class are registed sigularly, it is not going scan packages.
Here the simplified code of the controller I'm trying to use:
#Path("custom")
public class LocalManagedEntitlementsRestController extends BaseResource
{
private static final Logger log = LogManager.getLogger(LocalManagedEntitlementsRestController.class);
#GET
#Path("/")
public String sayHello()
{
return "Welcome to the world of REST";
}
}

Http 404 Spring java config

Hello i have problem with java config in spring. I was trying to complete it by learning from mutliple tutorials but still i have something wrong. Any clue ?
error
AppConfig.java
package org.spring.mvc.libraryDemo.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.web.servlet.ViewResolver;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.view.InternalResourceViewResolver;
import org.springframework.web.servlet.view.JstlView;
/**
* Created by wiktor on 28.12.2015.
*/
#Configuration //adnotacja oznaczajaca plik konfiguracyjny
#EnableWebMvc
#ComponentScan(basePackages = "org.spring.mvc.libraryDemo") //enable skan komponentow
#Import({AppConfig.class}) //na co musi jeszcze uwazac Spring
public class AppConfig {
#Bean
public ViewResolver viewResolver() {
InternalResourceViewResolver viewResolver = new InternalResourceViewResolver();
viewResolver.setViewClass(JstlView.class);
viewResolver.setPrefix("/WEB-INF/pages/");
viewResolver.setSuffix(".jsp");
return viewResolver;
}
}
SpringConfigInit
package org.spring.mvc.libraryDemo.config;
import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;
public class SpringConfigInitializer extends AbstractAnnotationConfigDispatcherServletInitializer {
#Override
protected Class<?>[] getRootConfigClasses() {
return new Class[] { AppConfig.class };
}
#Override
protected Class<?>[] getServletConfigClasses() {
return null;
}
#Override
protected String[] getServletMappings() {
return new String[] { "/" };
}
}
Controller
package org.spring.mvc.libraryDemo.controllers;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
/**
* Created by wiktor on 28.12.2015.
*/
#Controller
public class HomeController {
#RequestMapping(value="/",method= RequestMethod.GET)
public String sayHello(ModelMap modelMap)
{
modelMap.addAttribute("greeting","witaj");
return "index";
}
}
Web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
version="3.1">
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<servlet>
<servlet-name>dispatcher</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>dispatcher</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
</web-app>
With this type of servlet mapping, I think you will find your app at http://localhost:8080/{warfile name}/, not at http://localhost:8080/
You are mixing up two approaches here (as seen is your web.xml):
ContextLoaderListener with /WEB-INF/applicationContext.xml : this means that your spring application will be configured by the xml stuff in applicationContext.xml.
But obviously you want to use the Java Config, that is the beans defined under #Configuration annotated classes. To enable this, one way is to change your web xml for something like this:
<servlet>
<servlet-name>spring</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
<init-param>
<param-name>contextClass</param-name>
<param-value>org.springframework.web.context.support.AnnotationConfigWebApplicationContext</param-value>
</init-param>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>SpringRootConfig</param-value>
</init-param>
</servlet>
AnnotationConfigWebApplicationContext is the key here. That will scan your classpath and take the #Configuration stuff into account.
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
version="3.1">
<context-param>
<param-name>contextClass</param-name>
<param-value>
org.springframework.web.context.support.AnnotationConfigWebApplicationContext
</param-value>
</context-param>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>org.spring.mvc.libraryDemo.config.AppConfig</param-value>
</context-param>
<servlet>
<servlet-name>spring</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>spring</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
</web-app>

Wildfly resteasy javax.ws.rs.NotFoundException

i know that this post is duplicate and there are a lot of solutions yet, but i wasn't able to use them to resolve the problem.
I am trying to use spring + wildflyAS + resteasy. I have problems with resteasy integration, here is error which i am getting while trying to access controller:
javax.ws.rs.NotFoundException: Could not find resource for full path: http://localhost:8080/BQP/rest/student/test/1/pass/1
Controller:
#Controller
#RequestMapping(value = "student")
public class StudentController {
#Autowired
StudentService studentService;
public StudentController() {
}
#RequestMapping(value = "/test/{id}/pass/{testId}", method = RequestMethod.GET, produces = "application/json")
public
#ResponseBody
Response getCurrentTest(#PathVariable("id") String id,#PathVariable("testId") String testId){
TestDTO testDTO = studentService.getCurrentTest(id,testId);
return Response.status(200).entity(testDTO).build();
}
}
web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<display-name>BQP</display-name>
<!--Spring-->
<servlet>
<servlet-name>Spring MVC Servlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/spring-mvc-context.xml</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>Spring MVC Servlet</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
<!--/Spring-->
<!--RestEASY-->
<servlet>
<servlet-name>Resteasy</servlet-name>
<servlet-class>org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Resteasy</servlet-name>
<url-pattern>/rest/*</url-pattern>
</servlet-mapping>
<context-param>
<param-name>javax.ws.rs.Application</param-name>
<param-value>com.bionic.rest.ApplicationConfiguration</param-value>
</context-param>
<context-param>
<param-name>resteasy.servlet.mapping.prefix</param-name>
<param-value>/rest</param-value>
</context-param>
<listener>
<listener-class>org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap</listener-class>
</listener>
<!--/RestEASY-->
ApplicationConfiguration:
package com.bionic.rest;
import javax.ws.rs.core.Application;
import java.util.HashSet;
import java.util.Set;
public class ApplicationConfiguration extends Application {
private Set<Object> singletons = new HashSet<Object>();
private Set<Class<?>> empty = new HashSet<Class<?>>();
public ApplicationConfiguration() {
singletons.add(new StudentController());
}
#Override
public Set<Class<?>> getClasses() {
return empty;
}
#Override
public Set<Object> getSingletons() {
return singletons;
}
}
Moreover, i can access this controller without /rest in url.

Integrating Jetty with RESTEasy

Any links on how to integrate Jetty and RESTEasy? I am kinda stuck trying to configure RESTEasy with Jetty together....and there seems to be no credible help on the web.
public static void main(String[] args) throws Exception
{
Server server = new Server(8080);
WebAppContext context = new WebAppContext();
context.setDescriptor("../WEB-INF/web.xml");
context.setResourceBase("../src/webapp");
context.setContextPath("/");
context.setParentLoaderPriority(true);
server.setHandler(context);
server.start();
server.join();
}
My Web.xml is copied directly from:
http://docs.jboss.org/resteasy/docs/1.0.0.GA/userguide/html/Installation_Configuration.html
The error I get back is a HTTP 404 when I try to open up a link in my resource file. Everything looks reasonable on the surface, any suggestions?
My resource file looks like:
package webapp;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
#Path("/*")
public class Resource {
#GET
public String hello() {
return "hello";
}
#GET
#Path("/books")
public String getBooks() {
return "books";
}
#GET
#Path("/book/{isbn}")
public String getBook(#PathParam("isbn") String id) {
return "11123";
}
}
This is the prints that I see when Jetty starts up:
2012-04-10 09:54:27.163:INFO:oejs.Server:jetty-8.1.1.v20120215 2012-04-10 09:54:27.288:INFO:oejw.StandardDescriptorProcessor:NO JSP Support for /, did not find org.apache.jasper.servlet.JspServlet 2012-04-10 09:54:27.319:INFO:oejsh.ContextHandler:started o.e.j.w.WebAppContext{/,file:/C:/Users/xyz/Anotherproj1/src/webapp} 2012-04-10 09:54:27.319:INFO:oejsh.ContextHandler:started o.e.j.w.WebAppContext{/,file:/C:/Users/xyz/Anotherproj1/src/webapp} 2012-04-10 09:54:27.381:INFO:oejs.AbstractConnector:Started SelectChannelConnector#0.0.0.0:8080
The follwing works for me:
web.xml:
<web-app xmlns:javaee="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<context-param>
<param-name>resteasy.scan</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>resteasy.resources</param-name>
<param-value>webapp.Resource</param-value>
</context-param>
<context-param>
<param-name>javax.ws.rs.core.Application</param-name>
<param-value>webapp.MyApplicationConfig</param-value>
</context-param>
<!-- set this if you map the Resteasy servlet to something other than /*
<context-param>
<param-name>resteasy.servlet.mapping.prefix</param-name>
<param-value>/resteasy</param-value>
</context-param>
-->
<!-- if you are using Spring, Seam or EJB as your component model, remove the ResourceMethodSecurityInterceptor -->
<context-param>
<param-name>resteasy.resource.method-interceptors</param-name>
<param-value>
org.jboss.resteasy.core.ResourceMethodSecurityInterceptor
</param-value>
</context-param>
<listener>
<listener-class>org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap</listener-class>
</listener>
<servlet>
<servlet-name>Resteasy</servlet-name>
<servlet-class>org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Resteasy</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
</web-app>
With
public class MyApplicationConfig extends Application {
private static final Set<Class<?>> CLASSES;
static {
HashSet<Class<?>> tmp = new HashSet<Class<?>>();
tmp.add(Resource.class);
CLASSES = Collections.unmodifiableSet(tmp);
}
#Override
public Set<Class<?>> getClasses(){
return CLASSES;
}
}
Resource
package webapp;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
#Path("/")
#Produces("text/plain")
public class Resource {
#GET
public String hello() {
return "hello";
}
#GET
#Path("/books")
public String getBooks() {
return "books";
}
#GET
#Path("/book/{isbn}")
public String getBook(#PathParam("isbn") String id) {
return "11123";
}
}
and Main Class
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.webapp.WebAppContext;
import org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap;
public class Main {
public static void main(String[] args) throws Exception
{
Server server = new Server(8080);
WebAppContext context = new WebAppContext();
context.setDescriptor("./src/main/webapp/WEB-INF/web.xml");
context.setResourceBase("./src/main/webapp");
context.setContextPath("/");
context.setParentLoaderPriority(true);
server.setHandler(context);
server.start();
server.join();
}
}
Are you sure that #Path("/*") is correct path. Try #Path("/") maybe this * is a problem. As far as I know path expressions does not accept regexps.
EDIT
I was wrong, you can use regexps in #Path, at least RESTEasy supports that.
To get RESTEasy and Jetty to work together without a web.xml ensure you have a dependency on resteasy-servlet-initializer in your pom.xml.
This may help (JBoss RESTEasy documentation): https://docs.jboss.org/resteasy/docs/3.0.4.Final/userguide/html/Installation_Configuration.html#d4e111

Categories

Resources