2

I have a java application which is developed in Spring 4, hibernate 4 and java 8. I deploying it in wildfly 8.4 using Eclipse Luna.

But it is not deploying. When I am trying to access the application it is saying "forbidden" on the screen.

Then, I checked my console, I found few warnings

22:44:26,550 WARN  [org.jboss.as.ee] (MSC service thread 1-8) JBAS011006: Not installing optional component org.springframework.http.server.ServletServerHttpAsyncRequestControl due to an exception (enable DEBUG log level to see the cause)
22:44:26,552 WARN  [org.jboss.as.ee] (MSC service thread 1-8) JBAS011006: Not installing optional component org.springframework.web.context.request.async.StandardServletAsyncWebRequest due to an exception (enable DEBUG log level to see the cause)

22:44:26,885 WARN  [org.jboss.weld.deployer] (MSC service thread 1-8) JBAS016012: Deployment deployment "application.war" contains CDI annotations but no bean archive was found (no beans.xml or class with bean defining annotations).

Do I need to solve this warnings? What is reason it is not reading my application's annotations? How can I solve this issue?

user3035305
  • 285
  • 1
  • 9
  • 17
  • So did you do want the log output suggested? "enable DEBUG log level to see the cause". Please do this and post the complete error message. – dunni May 31 '15 at 18:54
  • I don know, How to do this...can you please guide me what and where I have to make changes..I tried to change `logging.properties` but it didn't work. – user3035305 May 31 '15 at 19:05
  • Can you run on command line instead of Eclipse Luna? – Ian Lim Jun 01 '15 at 02:30
  • See http://stackoverflow.com/a/24071990/1023341 or even better: http://stackoverflow.com/a/21757053/1023341 – gkephorus Jun 16 '15 at 09:35

1 Answers1

0

To stop WildFly from using Weld on a war, one can (according to @Yuri) disable 'bean-discovery' by adjusting the mode in the bean.xml. You can read @Yuri's answer here https://stackoverflow.com/a/21757053/1023341. The short is:

Add bean.xml to your war/jar (WEB-INF/beans.xml for war files, or as META-INF/beans.xml for jar files) put this in the bean.xml:

<?xml version="1.0" encoding="UTF-8"?>
<beans 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/beans_1_1.xsd"
   version="1.1" bean-discovery-mode="none">
</beans>

The option is nicely explained by reza_rahman (on Oct 03, 2013) in Default CDI Enablement in Java EE 7

Community
  • 1
  • 1
gkephorus
  • 1,232
  • 18
  • 31