Embedded Message Driven Resource Adapter fails to deploy - jboss

I have been struggling to get an example of a Message driven (inbound) resource adapter to deploy and interact with an EAR on Wildfly 8.2.0.
I used this Java EE 7 JCA sample as the basis of my application.
I can see in the log files that the Resource Adapter gets deployed
INFO [org.jboss.as.connector.deployers.RADeployer] (MSC service thread 1-2)
IJ020002: Deployed: file:/C:/Software/jboss/wildfly/8.2.0.Final/standalone/tmp/
vfs/deployment/deployment4490b91cd6391845/jca-ra.rar-86794a0699d3da23/contents/
but when the MDB gets initialised I get the following error:
Caused by: java.lang.IllegalStateException: JBAS014521: No message listener
of type org.javaee7.jca.filewatch.adapter.FileSystemWatcher found in
resource adapter jcaInflowApp.ear#jca-ra.rar
The message listener is definitely in the RAR and the RAR is embedded in that location in the EAR.
I've uploaded the code base that I've been working on up to github - hopefully somebody can peruse and see what the issue is?
EDIT for anybody that wants to see a working JBoss example please see the github repo

The issue is duplicate JAR's containing message listener within your EAR. Change the scope of JAR to provided so that it does not get bundled inside lib folder. I've sent you a PR with the fix.

Related

How to clean JBoss AS 7.1.1 in IntelliJ + JRebel

I recently stated using IntelliJ + JRebel and like it so far.
There is just one thing which is kind of annoying. You can't see the content of the JBoss deployment directory as you can for Eclipse (where you see all files currently deployed).
As far as I understood IntelliJ is starting JBoss in a specific way that it points to the directory were the archive (ear/war/whatever) is compiled to.
But now I am facing a problem that IntelliJ seems to have an old version of my war somewhere (I can't find it in the target folder where the war is created), and tries to deploy my app twice.
I get the following error
14:10:55,111 INFO [org.jboss.as.server.deployment:66] JBAS015876: Starting deployment of "B-webapp.war"
14:10:55,111 INFO [org.jboss.as.server.deployment:66] JBAS015876: Starting deployment of "A-webapp.war"
14:10:55,113 INFO [org.jboss.as.server.deployment.scanner:266] JBAS015012: Started FileSystemDeploymentService for directory /Users/macbook15/jboss-as-7.1.1.Final/standalone/deployments
after that I get a failure that JBoss can't find the war for webapp B
14:10:55,159 ERROR [org.jboss.msc.service.fail:94] MSC00001: Failed to start service jboss.deployment.unit."CRF-webapp.war".STRUCTURE: org.jboss.msc.service.StartException in service jboss.deployment.unit."CRF-webapp.war".STRUCTURE: Failed to process phase STRUCTURE of deployment "CRF-webapp.war"
pointing that it can't find the war file
Caused by: java.io.FileNotFoundException: /Users/macbook15/Downloads/repo.hg/naiis-webapp/target/CRF-webapp.war (No such file or directory)
Is there any cache held in IntelliJ or another place were this information (that there is another app to deploy) might be still stored.
Thanks for any help
Depending on standalone or deployment configuration that you are using, the war file may be sitting in the respective content directory. Check the question related to content directory here Also check the last segment stanalone.xml or domain.xml which will have information on the content directories.

error in running a web application on tomcat server

I am currently converting my Java project written under Eclipse to a web application and trying to run on tomcat server. I have converted the project into a maven module, changed its project facets and other requirements to make it a web app. I have put my project.cfg.xml file under WEB-INF and included deployment to web.xml file. When i run my browser and point to "http://localhost:8080/manager/html", i am able to see my deployed war file. But it says running = false and when i click on my project, it shows me
HTTP Status 404 - /myproject/
type Status report
message /myproject/
description The requested resource is not available.
Apache Tomcat/7.0.32
I faced the same problem in running sample programs from "quickstart" also.
You should read $TOMCAT_HOME/logs/catalina.out This log records the lifecycle of web applications. You should be able to find the part where it attempts to start your web application and it is most likely throwing some errors at that location.
Observe the tomcat console . Surely, there are some errors being thrown at the application start-up, due to which it's not starting.

What's the solution to the JBoss AS 7.1 dom4j Exception?

I've got RESTful web services that I deploy in a .war file in JBoss AS 7.1. So far so good. Now I'm adding a .jar file with JPA 2.0 Entities. When I deploy the .war with the .jar file with the JPA Entities included I get this Exception at deploy time:
org.dom4j.DocumentFactory cannot be cast to org.dom4j.DocumentFactory
This problem is posted numerous times all over the web and there are about half as many suggested solutions but none of them work.
There is no dom4j.jar in my archive. My Hibernate 4.0 dependencies are all <scope>provided</scope>. None of the .jar files included in my .war file have any dom4j classes in them.
Does anyone know what causes this with JBoss 7.1 and what the solution is?
Thanks.
The dom4j Exception was caused by having an incorrect port number in the in standalone.xml. Instead of throwing a meaningful exception JBoss threw the meaningless exception about dom4j.
After correcting the port number, I tried to reproduce the error by undeploying the archive, shutting down JBoss and setting the port number back to the incorrect port number. When I deployed and enabled the archive this time JBoss showed an Exception that it could not get a managed connection for the datasource. The meaningless exception gets replaced by meaningful exception after the first successful deployment of the archive with the correct .
A longer thread about this process is here.

JBPM workflow deployment into alfresco error

I'm getting the following error when deploying from JBPM eclipse interface to alfresco. This happens when I select 'classes and resources to include in process archive', like 'src/main/java' etc.
Exception happened while deploying
java.lang.NullPointerException
at org.jbpm.gd.jpdl.util.ProcessDeployer.addClassOrResource(Unknown Source)
It was working perfectly, just stopped working suddenly. Any clues?
Thanks.
You should try not selecting anything in the Java Classes and Resources pane. You should be able to deploy your process definition XML file. If you have Java classes specific to your process definition, just have your build script JAR those up alongside your other Alfresco related Java classes you may have and put those in WEB-INF/lib.

Deploy failed on online GlassFish, works locally

I have an EJB JAR + JSF WAR that runs fine on local GlassFish deployed from NetBeans, but if i try to deploy the WAR on an online GlassFish, I get the following error:
Exception while loading the app :
java.lang.Exception: java.lang.IllegalStateException:
ContainerBase.addChild: start: org.apache.catalina.LifecycleException:
com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED!
com.ejb.entity.myEntity
EDIT GlassFish Log Message:
Message ID
Unsanitized stacktrace from failed start... com.sun.faces.config.ConfigurationException
Complete Message
http://pastebin.com/deSsYgDV
Also:
EJB deploys fine on online GF
EJB # local GF: sometimes yes, mostly not: http://pastebin.com/9R1acDVq
The EJB is pretty messy, both interfaces implement the same methods: When a session bean has remote as well as local business interface, there should not be any method common to both the interfaces. Should I fix this first?
Both servers are configured the same way. The EJB is imported in the WAR. What could be the problem? Any thoughts or ideas would be appreciated!
When a session bean has remote as well as local business interface, there should not be any method common to both the interfaces.
This is a NetBeans warning which I thought would cause no problems since the web application was using Local interfaces only. After removing the Remote interfaces from the EJB, I was able to deploy the WAR on both local and online GlassFish.