Unable to deploy drools-guvnor 5.5.0.Final on jboss eap 5.1
dsonnerat Nov 6, 2013 3:50 AMDrools-Guvnor (sponsored by redhat) proposes a war build for jboss eap 5.1 (http://www.jboss.org/drools/downloads download Guvnor 5.5.0.Final. Unzip guvnor-distribution-5.5.0.Final and find war binaries/guvnor-5.5.0.Final-jboss-eap-5.1.war)
This war should works out-of-the-box without any configuration (see "Chapter 11. Installation" in inline documentation http://docs.jboss.org/drools/release/5.5.0.Final/drools-guvnor-docs/html/ch11.html)
When we deploy this war on jboss eap 5.1 we first got the following error:
java.lang.RuntimeException: mapped-name is required for BeanManager of deployment guvnor-5.5.0.Final-jboss-eap-5.1.war
at org.jboss.web.tomcat.service.injection.WebResourceHandler.loadXmlResourceEnvRefs(WebResourceHandler.java:287)
at org.jboss.web.tomcat.service.injection.WebResourceHandler.loadXml(WebResourceHandler.java:325) …
To solve this problem we open the war file and suppress the following configuration in file WEB-INF/web.xml:
<resource-env-ref><!-- Needed to make weld/arquillian work on tomcat6, jetty6 and jetty7 -->
<resource-env-ref-name>BeanManager</resource-env-ref-name>
<resource-env-ref-type> javax.enterprise.inject.spi.BeanManager </resource-env-ref-type>
</resource-env-ref>
It seems to make sense since the comment indicates that this specific configuration is made for tomcat6, jetty6 and jetty7
So doing the following error was obtained:
java.lang.RuntimeException: java.io.IOException: Child not found guvnor-5.5.0.Final-jboss-eap-5.1.war/WEB-INF/seam-beans.xml/ for FileHandler@27406307 …
And resolved by adding an seam-beans.xml file in WEB-INF. This file contains only root xml node (no configuration in it).
This time, the server launches the application without errors.
However when we try to use guvnor (http://localhost:8080/guvnor-5.5.0.Final-jboss-eap-5.1) the following next error occurs:
Caused by: java.lang.IllegalStateException: CDI hasn't been properly started. Make sure your IDE classpath is in sync with the real maven classpath. The classpath should include weld-servlet.
at org.drools.guvnor.server.SecurityServiceServlet.getCurrentUser(SecurityServiceServlet.java:70)
org.drools.guvnor.server.SecurityServiceServlet.getCurrentUser method is:
public UserSecurityContext getCurrentUser() {
if (securityService == null) { // This is the first method called by the client. // If CDI hasn't kicked in (theoretically impossible...), throw a readable exception
throw new IllegalStateException("CDI hasn't been properly started.\n" + " Make sure your IDE classpath is in sync with the real maven classpath.\n" + " The classpath should include weld-servlet.");
}
return securityService.getCurrentUser();
}
securityService should be injected by WELD. But the injection is not done. We are struck at this point.
Jboss eap 5.1 is imposed by our firm, we cannot upgrade to a newer one.
Note that to avoid having error:
java.lang.NoSuchMethodError: org.jboss.logmanager.LogContext.getAttachment(Ljava/lang/String;Lorg/jboss/logmanager/Logger$AttachmentKey;)Ljava/lang/Object;
at org.jboss.solder.logging.internal.JBossLogManagerProvider.doGetLogger(JBossLogManagerProvider.java:52)
We also had to replace jboss-as/lib/jboss-logmanager.jar with a newer one.
Any help to make drools-guvnor 5.5.0.Final works on jboss eap 5.1 will be welcome
Thanks