Tomcat Webapp in Wildfly starten

Hallo Community,

ich versuche ein WAR File, welches in Tomcat sauber läuft im Wildfly zum laufen zu bekommen. Beim Start habe ich folgende Fehlermeldungen:

12:45:22,944 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-11) MSC000001: Failed to start service jboss.deployment.unit."webgui.war".WeldStartService: org.jboss.msc.service.StartException in service jboss.deployment.unit."webgui.war".WeldStartService: Failed to start service
	at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1904) [jboss-msc-1.2.0.Final.jar:1.2.0.Final]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [rt.jar:1.7.0_45]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.7.0_45]
	at java.lang.Thread.run(Unknown Source) [rt.jar:1.7.0_45]
Caused by: org.jboss.weld.exceptions.DeploymentException: WELD-001408: Unsatisfied dependencies for type Context with qualifiers @Default
  at injection point [BackedAnnotatedParameter] Parameter 3 of [BackedAnnotatedConstructor] @Inject org.sonatype.guice.plexus.shim.PseudoPlexusContainer(PlexusBeanLocator, PlexusBeanManager, Context)
  at org.sonatype.guice.plexus.shim.PseudoPlexusContainer.<init>(PseudoPlexusContainer.java:0)

	at org.jboss.weld.bootstrap.Validator.validateInjectionPointForDeploymentProblems(Validator.java:368)
	at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:289)
	at org.jboss.weld.bootstrap.Validator.validateGeneralBean(Validator.java:135)
	at org.jboss.weld.bootstrap.Validator.validateRIBean(Validator.java:166)
	at org.jboss.weld.bootstrap.Validator.validateBean(Validator.java:514)
	at org.jboss.weld.bootstrap.ConcurrentValidator$1.doWork(ConcurrentValidator.java:68)
	at org.jboss.weld.bootstrap.ConcurrentValidator$1.doWork(ConcurrentValidator.java:66)
	at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:60)
	at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:53)
	at java.util.concurrent.FutureTask.run(Unknown Source) [rt.jar:1.7.0_45]
	... 3 more

12:45:22,959 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) JBAS014613: Operation ("deploy") failed - address: ([("deployment" => "webgui.war")]) - failure description: {"JBAS014671: Failed services" => {"jboss.deployment.unit.\"webgui.war\".WeldStartService" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"webgui.war\".WeldStartService: Failed to start service
    Caused by: org.jboss.weld.exceptions.DeploymentException: WELD-001408: Unsatisfied dependencies for type Context with qualifiers @Default
  at injection point [BackedAnnotatedParameter] Parameter 3 of [BackedAnnotatedConstructor] @Inject org.sonatype.guice.plexus.shim.PseudoPlexusContainer(PlexusBeanLocator, PlexusBeanManager, Context)
  at org.sonatype.guice.plexus.shim.PseudoPlexusContainer.<init>(PseudoPlexusContainer.java:0)
"}}
12:45:23,056 INFO  [org.jboss.as.server] (ServerService Thread Pool -- 29) JBAS018559: Deployed "webgui.war" (runtime-name : "webgui.war")
12:45:23,059 INFO  [org.jboss.as.controller] (Controller Boot Thread) JBAS014774: Service status report
JBAS014777:   Services which failed to start:      service jboss.deployment.unit."webgui.war".WeldStartService: org.jboss.msc.service.StartException in service jboss.deployment.unit."webgui.war".WeldStartService: Failed to start service

12:45:23,182 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015961: Http management interface listening on http://127.0.0.1:9990/management
12:45:23,183 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015951: Admin console listening on http://127.0.0.1:9990
12:45:23,183 ERROR [org.jboss.as] (Controller Boot Thread) JBAS015875: WildFly 8.0.0.Final "WildFly" started (with errors) in 12255ms - Started 727 of 1112 services (331 services failed or missing dependencies, 90 services are lazy, passive or on-demand)
12:45:23,313 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-3) JBAS010418: Stopped Driver service with driver-name = webgui.war_com.mysql.jdbc.Driver_5_1
12:45:23,320 INFO  [org.jboss.weld.deployer] (MSC service thread 1-15) JBAS016009: Stopping weld service for deployment webgui.war
12:45:23,777 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-11) JBAS015877: Stopped deployment webgui.war (runtime-name: webgui.war) in 478ms
12:45:24,153 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS018558: Undeployed "webgui.war" (runtime-name: "webgui.war")
12:45:24,224 INFO  [org.jboss.as.controller] (DeploymentScanner-threads - 2) JBAS014774: Service status report
JBAS014775:    New missing/unsatisfied dependencies:
      service jboss.deployment.unit."webgui.war".WeldBootstrapService (missing) dependents: [service jboss.deployment.unit."webgui.war".component."com.sun.faces.taglib.html_basic.CommandLinkTag".WeldInstantiator, service jboss.deployment.unit."webgui.war".component."org.springframework.web.servlet.tags.TransformTag".WeldInstantiator, service jboss.deployment.unit."webgui.war".component."org.springframework.web.servlet.tags.UrlTag".WeldInstantiator, service jboss.deployment.unit."webgui.war".component."org.apache.taglibs.standard.tag.el.fmt.MessageTag".WeldInstantiator, JBAS014799: ... and 163 more ] 
      service jboss.deployment.unit."webgui.war".WeldStartService (missing) dependents: [service jboss.deployment.unit."webgui.war".component."com.sun.faces.taglib.html_basic.CommandLinkTag".WeldInstantiator, service jboss.deployment.unit."webgui.war".component."org.springframework.web.servlet.tags.TransformTag".WeldInstantiator, service jboss.deployment.unit."webgui.war".component."org.springframework.web.servlet.tags.UrlTag".WeldInstantiator, service jboss.deployment.unit."webgui.war".component."org.apache.taglibs.standard.tag.rt.fmt.RequestEncodingTag".WeldInstantiator, JBAS014799: ... and 127 more ] 
      service jboss.deployment.unit."webgui.war".component."com.sun.faces.config.ConfigureListener".CREATE (missing) dependents: [service jboss.deployment.unit."webgui.war".component."com.sun.faces.config.ConfigureListener".START] 
      service jboss.deployment.unit."webgui.war".component."com.sun.faces.config.ConfigureListener".START (missing) dependents: [service jboss.undertow.deployment.default-server.default-host./webgui.UndertowDeploymentInfoService, service jboss.undertow.deployment.default-server.default-host./webgui] 
      service jboss.deployment.unit."webgui.war".component."com.sun.faces.config.ConfigureListener".WeldInstantiator (missing) dependents: [service jboss.deployment.unit."webgui.war".component."com.sun.faces.config.ConfigureListener".START] 
      service jboss.deployment.unit."webgui.war".component."com.sun.faces.ext.taglib.CreditCardValidatorTag".CREATE (missing) dependents: [service jboss.deployment.unit."webgui.war".component."com.sun.faces.ext.taglib.CreditCardValidatorTag".START] 
      service jboss.deployment.unit."webgui.war".component."com.sun.faces.ext.taglib.CreditCardValidatorTag".START (missing) dependents: [service jboss.undertow.deployment.default-

... some more

      service jboss.deployment.unit."webgui.war".component."org.springframework.web.servlet.tags.form.SelectTag".START (missing) dependents: [service jboss.undertow.deployment.default-server.default-host./webgui.UndertowDeploymentInfoService, service jboss.undertow.deployment.default-server.default-host./webgui, service jboss.deployment.unit."webgui.war".deploymentCompleteService] 
      service jboss.deployment.unit."webgui.war".component."org.springframework.web.servlet.tags.form.TextareaTag".CREATE (missing) dependents: [service jboss.deployment.unit."webgui.war".component."org.springframework.web.servlet.tags.form.TextareaTag".START] 
      service jboss.deployment.unit."webgui.war".component."org.springframework.web.servlet.tags.form.TextareaTag".START (missing) dependents: [service jboss.undertow.deployment.default-server.default-host./webgui.UndertowDeploymentInfoService, service jboss.undertow.deployment.default-server.default-host./webgui] 
      service jboss.deployment.unit."webgui.war".component."org.springframework.web.servlet.tags.form.TextareaTag".WeldInstantiator (missing) dependents: [service jboss.deployment.unit."webgui.war".component."org.springframework.web.servlet.tags.form.TextareaTag".START] 
      service jboss.deployment.unit."webgui.war".ee.ComponentRegistry (missing) dependents: [service jboss.undertow.deployment.default-server.default-host./webgui.UndertowDeploymentInfoService] 
      service jboss.deployment.unit."webgui.war".jndiDependencyService (missing) dependents: [service jboss.deployment.unit."webgui.war".component."org.apache.taglibs.standard.tag.el.fmt.TimeZoneTag".START, service jboss.deployment.unit."webgui.war".component."org.apache.taglibs.standard.tag.el.xml.ParamTag".START, service jboss.deployment.unit."webgui.war".component."com.sun.faces.taglib.jsf_core.ViewTag".START, service jboss.deployment.unit."webgui.war".component."org.apache.taglibs.standard.tag.el.core.UrlTag".START, JBAS014799: ... and 156 more ] 
      service jboss.undertow.deployment.default-server.default-host./webgui.UndertowDeploymentInfoService (missing) dependents: [service jboss.undertow.deployment.default-server.default-host./webgui] 
      service jboss.undertow.deployment.default-server.default-host./webgui.codec (missing) dependents: [service jboss.undertow.deployment.default-server.default-host./webgui.UndertowDeploymentInfoService] 
JBAS014777:   Services which failed to start:      service jboss.deployment.unit."webgui.war".WeldStartService

12:45:28,090 WARN  [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 2) JBAS015002: Deployment of 'webapp' requested, but the deployment is not present
12:45:28,091 INFO  [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 2) JBAS015003: Found webgui.war in deployment directory. To trigger deployment create a file called webgui.war.dodeploy

Was sagt mir dieser Fehler?

Hi,

das sieht, wie schon im anderen Thread erwähnt, nach einem Konflikt aus. Ist es eine eigenentwicklung von dir? Kannst du mal die Dependencies deines WAR auflisten? Jersey, JSF… irgendweine Bibliothek drin, die der Wildfly eh schon anbietet?

Gruß,
Tim

Ich nehme an, dass liegt daran, dass Du Guice verwendest. Anscheint läuft das nicht vernünftig mit CDI zusammen im Wildfly zusammen (Vermutung!).

Mein Tip: Guice durch CDI ersetzen

Andernfalls musst Du CDI bzw. Weld im Wildfly entfernen. Das kann man allerdings nicht einfach deaktivieren, da es zum EE-Stack gehört. In der standalone.xml müsste man wohl die org.jboss.as.weld entfernen und vermutlich auch das entfernen.

*** Edit ***

Es kann auch an Jersey liegen. Das wird bereits mit ausgeliefert und darf nicht als Dependency im Projekt sein (In Maven einfach auf provided setzen)

Guice habe ich nicht, aber Spring

Meine pom.xml:
[xml]

1.7
<com.sun.faces.jsf.version>2.2.4</com.sun.faces.jsf.version>
<org.springframework-security-version>3.2.0.RELEASE</org.springframework-security-version>
<org.slf4j-version>1.5.10</org.slf4j-version>

<repositories>
	<repository>
		<id>prime-repo</id>
		<name>PrimeFaces Maven Repository</name>
		<url>http://repository.primefaces.org</url>
		<layout>default</layout>
	</repository>
</repositories>

<dependencies>
	<!-- Spring Security -->
	<dependency>
		<groupId>org.springframework.security</groupId>
		<artifactId>spring-security-core</artifactId>
		<version>${org.springframework-security-version}</version>
	</dependency>

	<dependency>
		<groupId>org.springframework.security</groupId>
		<artifactId>spring-security-web</artifactId>
		<version>${org.springframework-security-version}</version>
	</dependency>

	<dependency>
		<groupId>org.springframework.security</groupId>
		<artifactId>spring-security-config</artifactId>
		<version>${org.springframework-security-version}</version>
	</dependency>

	<dependency>
		<groupId>org.springframework</groupId>
		<artifactId>spring-webmvc</artifactId>
		<version>3.2.6.RELEASE</version>
	</dependency>



	<!-- @Inject -->
	<dependency>
		<groupId>javax.inject</groupId>
		<artifactId>javax.inject</artifactId>
		<version>1</version>
	</dependency>

	<!-- Servlet -->

	<dependency>
		<groupId>javax.servlet</groupId>
		<artifactId>javax.servlet-api</artifactId>
		<version>3.1.0</version>
	</dependency>
	<dependency>
		<groupId>javax.servlet.jsp</groupId>
		<artifactId>jsp-api</artifactId>
		<version>2.1</version>
		<!--$NO-MVN-MAN-VER$ -->
		<scope>provided</scope>
	</dependency>
	<dependency>
		<groupId>javax.servlet</groupId>
		<artifactId>jstl</artifactId>
		<version>1.2</version>
	</dependency>
	<dependency>
		<groupId>org.primefaces.themes</groupId>
		<artifactId>all-themes</artifactId>
		<version>1.0.10</version>
	</dependency>


	<!-- JSF API -->

	<dependency>
		<groupId>com.sun.faces</groupId>
		<artifactId>jsf-api</artifactId>
		<version>${com.sun.faces.jsf.version}</version>
	</dependency>

	<dependency>
		<groupId>com.sun.faces</groupId>
		<artifactId>jsf-impl</artifactId>
		<version>${com.sun.faces.jsf.version}</version>
	</dependency>
</dependencies>

[/xml]

Zunächst einmal musst Du alle javax.* und com.sun.faces Dependencies auf provided setzen. Vielleicht reicht das schon.

OK, erledigt. Nun sieht es so aus, aber immer noch derselbe Fehler:
[xml]

1.7

	<com.sun.faces.jsf.version>2.2.4</com.sun.faces.jsf.version>
	<org.springframework-security-version>3.2.0.RELEASE</org.springframework-security-version>
	<org.slf4j-version>1.5.10</org.slf4j-version>

</properties>

<repositories>
	<repository>
		<id>prime-repo</id>
		<name>PrimeFaces Maven Repository</name>
		<url>http://repository.primefaces.org</url>
		<layout>default</layout>
	</repository>
</repositories>

<dependencies>
	<!-- Spring Security -->
	<dependency>
		<groupId>org.springframework.security</groupId>
		<artifactId>spring-security-core</artifactId>
		<version>${org.springframework-security-version}</version>
	</dependency>

	<dependency>
		<groupId>org.springframework.security</groupId>
		<artifactId>spring-security-web</artifactId>
		<version>${org.springframework-security-version}</version>
	</dependency>

	<dependency>
		<groupId>org.springframework.security</groupId>
		<artifactId>spring-security-config</artifactId>
		<version>${org.springframework-security-version}</version>
	</dependency>

	<dependency>
		<groupId>org.springframework</groupId>
		<artifactId>spring-webmvc</artifactId>
		<version>3.2.6.RELEASE</version>
	</dependency>

	<!-- @Inject -->
	<dependency>
		<groupId>javax.inject</groupId>
		<artifactId>javax.inject</artifactId>
		<version>1</version>
		<scope>provided</scope>
	</dependency>

	<!-- Servlet -->
	<dependency>
		<groupId>javax.servlet</groupId>
		<artifactId>javax.servlet-api</artifactId>
		<version>3.1.0</version>
		<scope>provided</scope>
	</dependency>
	<dependency>
		<groupId>javax.servlet.jsp</groupId>
		<artifactId>jsp-api</artifactId>
		<version>2.1</version>
		<!--$NO-MVN-MAN-VER$ -->
		<scope>provided</scope>
	</dependency>
	<dependency>
		<groupId>javax.servlet</groupId>
		<artifactId>jstl</artifactId>
		<version>1.2</version>
		<scope>provided</scope>
	</dependency>
	<dependency>
		<groupId>org.primefaces.themes</groupId>
		<artifactId>all-themes</artifactId>
		<version>1.0.10</version>
	</dependency>

	<!-- JSF API -->
	<dependency>
		<groupId>com.sun.faces</groupId>
		<artifactId>jsf-api</artifactId>
		<version>${com.sun.faces.jsf.version}</version>
		<scope>provided</scope>
	</dependency>

	<dependency>
		<groupId>com.sun.faces</groupId>
		<artifactId>jsf-impl</artifactId>
		<version>${com.sun.faces.jsf.version}</version>
		<scope>provided</scope>
	</dependency>

</dependencies>

[/xml]