2

I'm trying to deploy an Apache Isis project on a WildFly server.

The project is just the simpleapp-archetype-1.10.0 and it starts and works well with mvn antrun:run -P self-host and mvn jetty:run-war.

For the jetty part, I added configuration to the org.eclipse.jetty plugin of the parent pom.xml

<plugin>
    <groupId>org.eclipse.jetty</groupId>
    <artifactId>jetty-maven-plugin</artifactId>
    <version>9.3.2.v20150730</version>
    <configuration>
        <war>${project.basedir}/webapp/target/simpleapp.war</war>
    </configuration>
</plugin>

Now I wanted to deploy this on a WildFly server, but I get the following error:

Cannot upload deployment: {"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"simpleapp.war\".WeldStartService" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"simpleapp.war\".WeldStartService: Failed to start service Caused by: org.jboss.weld.exceptions.DeploymentException: WELD-001408: Unsatisfied dependencies for type IsisJdoSupport with qualifiers @Default at injection point [BackedAnnotatedField] @Inject org.apache.isis.objectstore.jdo.datanucleus.service.support.TimestampService.isisJdoSupport at org.apache.isis.objectstore.jdo.datanucleus.service.support.TimestampService.isisJdoSupport(TimestampService.java:0) "}}

How can I fix this error, and why does jetty bypass this error?

goggelz
  • 93
  • 1
  • 6

1 Answers1

2

I got an answer via the Apache Isis Mailing List.

The error says that WildFly tries to do CDI work. Jetty is just a web server and doesn't support Java EE stuff like CDI. Try to disable CDI support for this application (I have no idea how exactly).

http://isis.markmail.org/message/d3coq6qus3rca7kx

To fix this error:

Add the file jboss-all.xml to Simple App Webapp/Web Pages/WEB-INF with the following code:

<jboss xmlns="urn:jboss:1.0">
    <weld xmlns="urn:jboss:weld:1.0" require-bean-descriptor="true"/>
</jboss>

https://docs.jboss.org/author/display/WFLY8/CDI+Reference

Credits to Martin Grigorov though.

goggelz
  • 93
  • 1
  • 6
  • CDI/Weld can be used on Jetty, but currently only when included in your war's `WEB-INF/lib` (you'll also have some WebAppContext configuration to setup on the jetty-distribution to allow Weld past the WebApp Classloader isolation) – Joakim Erdfelt Dec 16 '15 at 20:52
  • Yes. In my answer in Apache Isis mailing lists I meant that Jetty won't try to scan for CDI components by default. If you add Weld and configure it then it will work. Apache Wicket examples show how to do this. – martin-g Dec 17 '15 at 08:26