2015-08-06 7 views
5
unterstützt

Ich habe ein Problem in meinen Krieg Datei bereitstellen, alles erwartet, dass der Web-Service arbeitet gut Das Fehlerprotokoll unterBereitstellen von Jersey Web-Service-Anwendung in Jboss als 7.1.1 zeigt einen Web Service im Paket ws nicht

16:14:08,866 INFO [com.sun.jersey.api.core.PackagesResourceConfig] (MSC service thread 1-1) Scanning for root resource and provider classes in the packages:com.fut.ws 

16:14:08,920 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/fut-wager]] (MSC service thread 1-1) StandardWrapper.Throwable:com.sun.jersey.core.spi.scanning.ScannerException: The URI scheme vfs of the URI vfs:/content/fut-wager.war/WEB-INF/classes/com/fut/ws/ is not supported. Package scanning deployment is not supported for such URIs. 
Try using a different deployment mechanism such as explicitly declaring root resource and provider classes using an extension of javax.ws.rs.core.Application at com.sun.jersey.core.spi.scanning.PackageNamesScanner.scan(PackageNamesScanner.java:225) [jersey-bundle-1.9.1.jar:1.9.1] at com.sun.jersey.core.spi.scanning.PackageNamesScanner.scan(PackageNamesScanner.java:139) [jersey-bundle-1.9.1.jar:1.9.1] at com.sun.jersey.api.core.ScanningResourceConfig.init(ScanningResourceConfig.java:80) [jersey-bundle-1.9.1.jar:1.9.1] at com.sun.jersey.api.core.PackagesResourceConfig.init(PackagesResourceConfig.java:104) [jersey-bundle-1.9.1.jar:1.9.1] at com.sun.jersey.api.core.PackagesResourceConfig.<init>(PackagesResourceConfig.java:78) [jersey-bundle-1.9.1.jar:1.9.1] 
    at com.sun.jersey.api.core.PackagesResourceConfig.<init>(PackagesResourceConfig.java:89) [jersey-bundle-1.9.1.jar:1.9.1] at com.sun.jersey.spi.container.servlet.WebComponent.createResourceConfig(WebComponent.java:700) [jersey-bundle-1.9.1.jar:1.9.1] at com.sun.jersey.spi.container.servlet.WebComponent.createResourceConfig(WebComponent.java:678) [jersey-bundle-1.9.1.jar:1.9.1] at com.sun.jersey.spi.container.servlet.WebComponent.init(WebComponent.java:203) [jersey-bundle-1.9.1.jar:1.9.1] at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:373) [jersey-bundle-1.9.1.jar:1.9.1] at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:556) [jersey-bundle-1.9.1.jar:1.9.1] 
    at javax.servlet.GenericServlet.init(GenericServlet.java:242) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final] at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1202) [jbossweb-7.0.13.Final.jar:] 
    at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1102) [jbossweb-7.0.13.Final.jar:] 
    at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3655) [jbossweb-7.0.13.Final.jar:] 
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:3873) [jbossweb-7.0.13.Final.jar:] 
    at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final] 
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) 
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) 
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_11] 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_11] 
    at java.lang.Thread.run(Thread.java:619) [rt.jar:1.6.0_11] 

16:14:08,974 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/fut-wager]] (MSC service thread 1-1) Servlet /fut-wager threw load() exception: com.sun.jersey.core.spi.scanning.ScannerException: The URI scheme vfs of the URI vfs:/content/fut-wager.war/WEB-INF/classes/com/fut/ws/ is not supported. Package scanning deployment is not supported for such URIs. 
Try using a different deployment mechanism such as explicitly declaring root resource and provider classes using an extension of javax.ws.rs.core.Application 
    at com.sun.jersey.core.spi.scanning.PackageNamesScanner.scan(PackageNamesScanner.java:225) [jersey-bundle-1.9.1.jar:1.9.1] 
    at com.sun.jersey.core.spi.scanning.PackageNamesScanner.scan(PackageNamesScanner.java:139) [jersey-bundle-1.9.1.jar:1.9.1] 
    at com.sun.jersey.api.core.ScanningResourceConfig.init(ScanningResourceConfig.java:80) [jersey-bundle-1.9.1.jar:1.9.1] 
    at com.sun.jersey.api.core.PackagesResourceConfig.init(PackagesResourceConfig.java:104) [jersey-bundle-1.9.1.jar:1.9.1] 
    at com.sun.jersey.api.core.PackagesResourceConfig.<init>(PackagesResourceConfig.java:78) [jersey-bundle-1.9.1.jar:1.9.1] 
    at com.sun.jersey.api.core.PackagesResourceConfig.<init>(PackagesResourceConfig.java:89) [jersey-bundle-1.9.1.jar:1.9.1] 
    at com.sun.jersey.spi.container.servlet.WebComponent.createResourceConfig(WebComponent.java:700) [jersey-bundle-1.9.1.jar:1.9.1] 
    at com.sun.jersey.spi.container.servlet.WebComponent.createResourceConfig(WebComponent.java:678) [jersey-bundle-1.9.1.jar:1.9.1] 
    at com.sun.jersey.spi.container.servlet.WebComponent.init(WebComponent.java:203) [jersey-bundle-1.9.1.jar:1.9.1] 
    at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:373) [jersey-bundle-1.9.1.jar:1.9.1] 
    at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:556) [jersey-bundle-1.9.1.jar:1.9.1] 
    at javax.servlet.GenericServlet.init(GenericServlet.java:242) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final] 
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1202) [jbossweb-7.0.13.Final.jar:] 
    at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1102) [jbossweb-7.0.13.Final.jar:] 
    at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3655) [jbossweb-7.0.13.Final.jar:] 
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:3873) [jbossweb-7.0.13.Final.jar:] 
    at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final] 
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) 
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) 
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_11] 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_11] 
    at java.lang.Thread.run(Thread.java:619) [rt.jar:1.6.0_11] 

16:14:09,038 INFO [org.jboss.web] (MSC service thread 1-1) JBAS018210: Registering web context: /fut-wager 
16:14:09,155 INFO [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS018559: Deployed "fut-wager.war" 
16:15:00,034 INFO [com.fut.scheduler.MatchScheduler] (org.springframework.scheduling.quartz.SchedulerFactoryBean#0_Worker-9) -- Match expiring scheduler execution started -- 
16:15:00,037 INFO [com.fut.ws.user.handler.MatchHandlerImpl] (org.springframework.scheduling.quartz.SchedulerFactoryBean#0_Worker-9) --Inside match expiring service-- 
16:15:00,039 INFO [com.fut.dao.user.MatchDao] (org.springframework.scheduling.quartz.SchedulerFactoryBean#0_Worker-9) --Inside match expiring dao-- 
16:15:00,313 INFO [com.fut.scheduler.MatchScheduler] (org.springframework.scheduling.quartz.SchedulerFactoryBean#0_Worker-9) -- Match expiring scheduler execution completed -- 
gegeben
+2

Die Ausnahme gibt eine Fehlermeldung aus, was das Problem ist, und was Sie können versuchen, es zu beheben. _ "Das URI-Schema vfs des URI vfs: /content/fut-wager.war/WEB-INF/classes/com/fut/ws/ wird nicht unterstützt. Die Bereitstellung von Paket-Scans wird für solche URIs nicht unterstützt. Versuchen Sie es mit einem verschiedene Implementierungsmechanismen, z. B. explizite Deklaration von Stammressourcen- und Providerklassen mit einer Erweiterung von javax.ws.rs.core.Application "_ –

+2

Wenn Sie sich nicht sicher sind, wie das geht, lesen Sie [hier] (https: // trikot. java.net/documentation/1.18/user-guide.html#d4e188) –

+0

Ich habe tri Ed bestimmte Dinge, aber es ändert sich nicht –

Antwort

4

Ich habe den gleichen Fehler und gelöst mit Hilfe von Peeskillet zur Verfügung gestellt. Hier ist Beispiel:

Web Service Application

package org.webservice.application;  
import java.util.HashSet; 
import java.util.Set; 
import javax.ws.rs.core.Application; 
import org.webservice.rs.HelloWorldService; 

public class RSApplication extends Application 
{ 
    public Set<Class<?>> getClasses() 
    { 
     Set<Class<?>> s = new HashSet<Class<?>>(); 
     s.add(HelloWorldService.class); 
     return s; 
    } 
} 

Ressourcen

package org.webservice.rs; 
import javax.ws.rs.GET; 
import javax.ws.rs.Path; 
import javax.ws.rs.core.Response; 

@Path("/hello") 
public class HelloWorldService 
{ 
    @GET 
    public Response getMsg() 
    { 
     String output = "I M Jersey"; 
     return Response.status(200).entity(output).build(); 
    } 
} 

web.xml

<?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_3_0.xsd" 
    id="WebApp_ID" version="3.0"> 
    <display-name>J2EEDemo</display-name> 
    <servlet> 
     <servlet-name>Jersey Web Application</servlet-name> 
     <servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class> 
     <init-param> 
      <param-name>javax.ws.rs.Application</param-name> 
      <param-value>org.webservice.application.RSApplication</param-value> 
     </init-param> 
    </servlet> 

    <servlet-mapping> 
     <servlet-name>Jersey Web Application</servlet-name> 
     <url-pattern>/rest/*</url-pattern> 
    </servlet-mapping> 
</web-app> 

pom.xml Eintrag für Abhängigkeits

<dependencies> 
    <dependency> 
     <groupId>com.sun.jersey</groupId> 
     <artifactId>jersey-core</artifactId> 
     <version>1.8</version> 
    </dependency> 

    <dependency> 
     <groupId>com.sun.jersey</groupId> 
     <artifactId>jersey-server</artifactId> 
     <version>1.8</version> 
    </dependency> 
</dependencies> 

Hit url: http://<HOST>:<PORT>/<CONTEXT>/rest/hello

2

Ich habe auch das gleiche Problem. unten funktioniert das für mich probier es.

Problem: com.sun.jersey.core.spi.scanning.ScannerException: The URI scheme vfs of the URI vfs `

Lösung: Notwendigkeit web.xml Datei ändern

I erstellt haben - Paket: com.rest.spring - Klasse: PaymentService

und ich habe diese Werte innerhalb vorgesehen <init-Parm> in der Datei web.xml. Siehe unten:

<servlet> 
     <servlet-name>jersey-serlvet</servlet-name> 
     <servlet-class>com.sun.jersey.spi.spring.container.servlet.SpringServlet 
    </servlet-class> 
     <init-param> 
      **<param-name> 
       com.sun.jersey.config.property.packages 
      </param-name> 
      <param-value>com.rest.spring</param-value>** 
     </init-param> 
     <load-on-startup>1</load-on-startup> 
    </servlet> 

Nach der Bereitstellung habe ich oben Fehler. Das einzige, was müssen wir das ändern ist <init param> siehe unten:

  **<param-name> 
       javax.ws.rs.core.Application 
      </param-name> 
      <param-value>com.rest.spring</param-value>** 

genießen ...