how to deploy resource adapter in jboss - java

I am trying to deploy a rar which is packed inside an ear. I have the ra.xml packed inside the rar. I am trying to deploy it in jboss eap 6.x and I get the below error
{
"JBAS014671: Failed services" => {"jboss.deployment.subunit.\"jca-ear-0.0.1-SNAPSHOT.ear\".\"shm-jca-file-adapter-0.0.1-SNAPSHOT.rar\".INSTALL" => "org.jboss.msc.ser
vice.StartException in service jboss.deployment.subunit.\"jca-ear-0.0.1-SNAPSHOT.ear\".\"shm-jca-file-adapter-0.0.1-SNAPSHOT.rar\".INSTALL: JBAS018733: Failed to process
phase INSTALL of subdeployment \"shm-jca-file-adapter-0.0.1-SNAPSHOT.rar\" of deployment \"jca-ear-0.0.1-SNAPSHOT.ear\"
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: java.lang.NullPointerException
Caused by: java.lang.NullPointerException"},
"JBAS014771: Services with missing/unavailable dependencies" => ["jboss.deployment.unit.\"jca-ear-0.0.1-SNAPSHOT.ear\".deploymentCompleteService is missing [jboss.de
ployment.subunit.\"jca-ear-0.0.1-SNAPSHOT.ear\".\"shm-jca-file-adapter-0.0.1-SNAPSHOT.rar\".deploymentCompleteService]"]
}
Actually I tried searching many sites online. Every tutorial explain only the main parts and provides links to a sample resourceadapter application. All links are expired.
Can anyone please help me?
Previously I used to use glassfish app server and there used to be another file glassfish-resources.xml. I did not find jboss equivalent for the same file.
My ra.xml like something like below
<resourceadapter>
<outbound-resourceadapter>
<connection-definition>
<managedconnectionfactory-class>com.resourceadapter.impl.ManagedConnectionFactoryImpl</managedconnectionfactory-class>
<connectionfactory-interface>com.resourceadapter.FileConnectionFactory</connectionfactory-interface>
<connectionfactory-impl-class>com.resourceadapter.impl.FileConnectionFactoryImpl</connectionfactory-impl-class>
<connection-interface>com.resourceadapter.FileConnection</connection-interface>
<connection-impl-class>com.resourceadapter.impl.FileConnectionImpl</connection-impl-class>
</connection-definition>
<transaction-support>XATransaction</transaction-support>
</outbound-resourceadapter>
</resourceadapter>

I think this is your looking How can I hot deploy a resource-adapter activation in JBoss 7?
You need add the specific configuration META-INF/ironjacamar.xml, for the activation of resource adapters
[JBoss7] Resource Adapter in EAR
Resource adapters JBoss 7 Docs

Related

Deploy failed when develop a EJB

I am developing a simple stateful EJB. When deploy it, I get the error messages:
23:12:34,971 ERROR [org.jboss.as.server] (management-handler-thread - 2) WFLYSRV0021: Deploy of deployment "EJBTest2_ejb_exploded.rar" was rolled back with the following failure message:
{
"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"EJBTest2_ejb_exploded.rar\".INSTALL" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"EJBTest2_ejb_exploded.rar\".INSTALL: WFLYSRV0153: Failed to process phase INSTALL of deployment \"EJBTest2_ejb_exploded.rar\"
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: org.jboss.jca.common.api.validator.ValidateException: IJ010075: The resource adapter metadata must contain either an outbound or inbound configuration
Caused by: org.jboss.jca.common.api.validator.ValidateException: IJ010075: The resource adapter metadata must contain either an outbound or inbound configuration"},
"WFLYCTL0180: Services with missing/unavailable dependencies" => [
"jboss.naming.context.java.comp.EJBTest2_ejb_exploded.EJBTest2_ejb_exploded.CartEJB.ValidatorFactory is missing [jboss.naming.context.java.comp.EJBTest2_ejb_exploded.EJBTest2_ejb_exploded.CartEJB]",
"jboss.naming.context.java.comp.EJBTest2_ejb_exploded.EJBTest2_ejb_exploded.CartEJB.InAppClientContainer is missing [jboss.naming.context.java.comp.EJBTest2_ejb_exploded.EJBTest2_ejb_exploded.CartEJB]",
"jboss.deployment.unit.\"EJBTest2_ejb_exploded.rar\".batch.environment is missing [jboss.deployment.unit.\"EJBTest2_ejb_exploded.rar\".beanmanager]",
"jboss.deployment.unit.\"EJBTest2_ejb_exploded.rar\".weld.weldClassIntrospector is missing [jboss.deployment.unit.\"EJBTest2_ejb_exploded.rar\".beanmanager]",
"jboss.naming.context.java.comp.EJBTest2_ejb_exploded.EJBTest2_ejb_exploded.CartEJB.InstanceName is missing [jboss.naming.context.java.comp.EJBTest2_ejb_exploded.EJBTest2_ejb_exploded.CartEJB]",
"jboss.naming.context.java.comp.EJBTest2_ejb_exploded.EJBTest2_ejb_exploded.CartEJB.Validator is missing [jboss.naming.context.java.comp.EJBTest2_ejb_exploded.EJBTest2_ejb_exploded.CartEJB]"
]
}
What does it mean? It seems some dependency files are missing. What are they.
I appreciate for your help. :)
You should create WAR or JAR package, not RAR (which is for resource archive).
If you are going to expose some web content (including REST webservices) use WAR package, if you are about to write only business logic use JAR packaging.
If project is under build control tool such as maven just change packaging node value, otherwise change should be made in IDE.

Failure deploying RESTful web service application using IntelliJ IDEA

I am trying to create a simple RESTful web service on IntelliJ IDEA and I am now encountering the following error:
The content of element 'application' is not complete. One of '{"http://java.sun.com/xml/ns/javaee":description, "http://java.sun.com/xml/ns/javaee":display-name, "http://java.sun.com/xml/ns/javaee":icon, "http://java.sun.com/xml/ns/javaee":initialize-in-order, "http://java.sun.com/xml/ns/javaee":module}
I believe these elements were not needed inside my application.xml before, then suddenly I encountered this problem when deploying.
I have the javaEEApplication and Web facets enabled in my project, the deployment descriptors seem to be set up correctly as well. I am referencing Jersey-2.2 as a library to use the RESTful services. My project also has GlassFish 4.1.1 - RESTful Web Service as a dependency.
I am using a Exploded artifact autogenerated from modules, and the run configuration is set to build then build artifacts. The credentials for the glassfish admin are correct.
I'm wondering why I am suddenly encountering this problem, I though that IntelliJ would auto generate any necessary content inside the deployment descriptor (application.xml) that it needed. Does anyone have any idea what I am missing? Perhaps I have to reference Java EE 6 or 7 as a library itself? I'm lost here.
Full error log below just in case:
"C:\Program Files (x86)\glassfish4\glassfish\bin\asadmin.bat" start-domain domain1
"C:\Program Files\Java\jdk1.8.0_77\bin\java" -Dfile.encoding=windows-1252 -classpath "C:\Program Files (x86)\glassfish4\glassfish\modules\javax.ejb-api.jar;C:\Program Files.....
[2017-02-05 03:16:49,423] Artifact CapstoneIntelliJProject:war exploded: Server is not connected. Deploy is not available.
Detected server admin port: 4848
Detected server http port: 8080
Attempting to start domain1.... Please look at the server log for more details.....
Connected to server
[2017-02-05 03:16:52,358] Artifact CapstoneIntelliJProject:war exploded: Artifact is being deployed, please wait...
[2017-02-05 03:16:53,536] Artifact CapstoneIntelliJProject:war exploded: Error during artifact deployment. See server log for details.
[2017-02-05 03:16:53,537] Artifact CapstoneIntelliJProject:war exploded: java.io.IOException: com.sun.enterprise.admin.remote.RemoteFailureException: Error occurred during deployment: Exception while deploying the app [CapstoneIntelliJProject_war_exploded] : org.xml.sax.SAXParseException; lineNumber: 7; columnNumber: 15; Deployment descriptor file META-INF/application.xml in archive [CapstoneIntelliJProject_war_exploded]. cvc-complex-type.2.4.b: The content of element 'application' is not complete. One of '{"http://java.sun.com/xml/ns/javaee":description, "http://java.sun.com/xml/ns/javaee":display-name, "http://java.sun.com/xml/ns/javaee":icon, "http://java.sun.com/xml/ns/javaee":initialize-in-order, "http://java.sun.com/xml/ns/javaee":module}' is expected.. Please see server.log for more details.
"C:\Program Files (x86)\glassfish4\glassfish\bin\asadmin.bat" stop-domain domain1
Process finished with exit code 0
Waiting for the domain to stop .
Command stop-domain executed successfully.
Disconnected from server
Edit: I have solved this particular issue, having the javaEEapplication facet enabled for the project was a mistake, as it is only a restful web service. Now I face a new problem where the output is telling me Application [CapstoneIntelliJProject_war_exploded] contains no valid components. . The server log doesn't contain any useful information. I'm not sure what is wrong with my war, it seems to be configured fine.
I have solved the war exploded issue by recreating the war

FUSE hibernate with CXF

I was able to develop two applications (One application used Hibernate and other application used CXF web service followed by this tutorial) separately and deploy to the FUSE 6.3.0 with out any issue.
But my problem arises when I try to install hibernate in FUSE where FUSE has already installed CXF application which I developed. I try to execute following command to install hibernate.
fabric:profile-edit --bundle mvn:org.hibernate/hibernate-core/4.2.22.Final-redhat-1 jboss-fuse-full
If I do not have CXF application installed in the FUSE then no exception thrown from FUSE but when I have CXF application deployed in FUSE it gives following exception.
Exception in thread "SpringOsgiExtenderThread-2" org.apache.camel.RuntimeCamelException: org.apache.camel.FailedToCreateRouteException: Failed to create route cxf: Route(cxf)[[From[cxf:bean:serviceEndpoint]] -> [RecipientLis... because of Failed to resolve endpoint: cxf://bean:serviceEndpoint due to: No component found with scheme: cxf
at org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1690)
at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:138)
at org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:340)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:96)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:334)
at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:954)
at org.springframework.osgi.context.support.AbstractOsgiBundleApplicationContext.finishRefresh(AbstractOsgiBundleApplicationContext.java:235)
at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.java:358)
at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)
at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:320)
at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:132)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.camel.FailedToCreateRouteException: Failed to create route cxf: Route(cxf)[[From[cxf:bean:serviceEndpoint]] -> [RecipientLis... because of Failed to resolve endpoint: cxf://bean:serviceEndpoint due to: No component found with scheme: cxf
at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:201)
at org.apache.camel.impl.DefaultCamelContext.startRoute(DefaultCamelContext.java:974)
at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:3301)
at org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:3024)
at org.apache.camel.impl.DefaultCamelContext.access$000(DefaultCamelContext.java:175)
at org.apache.camel.impl.DefaultCamelContext$2.call(DefaultCamelContext.java:2854)
at org.apache.camel.impl.DefaultCamelContext$2.call(DefaultCamelContext.java:2850)
at org.apache.camel.impl.DefaultCamelContext.doWithDefinedClassLoader(DefaultCamelContext.java:2873)
at org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:2850)
at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:2819)
at org.apache.camel.spring.SpringCamelContext.maybeStart(SpringCamelContext.java:275)
at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:136)
... 10 more
Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: cxf://bean:serviceEndpoint due to: No component found with scheme: cxf
at org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:594)
at org.apache.camel.util.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:79)
at org.apache.camel.model.RouteDefinition.resolveEndpoint(RouteDefinition.java:211)
at org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:107)
at org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:113)
at org.apache.camel.model.FromDefinition.resolveEndpoint(FromDefinition.java:69)
at org.apache.camel.impl.DefaultRouteContext.getEndpoint(DefaultRouteContext.java:89)
at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:1052)
at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:196)
... 22 more
Does any one experienced this kind of issue before and able to resolve it. Please be kind enough to share your experience to resolve this issue.
I also had same kind of issue when I try to install CXF with ActiveMQ.I was able to resolve it by uninstalling the already installed CXF project and then install the ActiveMQ.
Make sure that you have installed the required dependencies for the Hibernate correctly. After verifying that you have installed required dependencies you can reinstall application/
So in your case, you can first uninstall CXF project first and then install Hibernate(Note that you may required to install all the dependencies required).Then retry to install the CXF project.
You can use following command to uninstall existing project
uninstall <processID> eg-: uninstall 418

Configuring JBoss in IntelliJ

I just started working with Java EE. Does anyone know what I'm missing here? Let me know if you need more information. I'm working with intelliJ and JBoss EAP.
[2016-02-21 11:57:19,930] Artifact helloworld:war: Error during artifact deployment. See server log for details.
[2016-02-21 11:57:19,931] Artifact helloworld:war: java.lang.Exception: {"JBAS014671: Failed services" => {"jboss.deployment.unit.\"helloworld.war\".INSTALL" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"helloworld.war\".INSTALL: JBAS018733: Failed to process phase INSTALL of deployment \"helloworld.war\"
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS011047: Component class com.rd.helloworld.HelloServlet for component com.rd.helloworld.HelloServlet has errors:
JBAS011440: Can't find a persistence unit named null in deployment \"helloworld.war\""},"JBAS014771: Services with missing/unavailable dependencies" => ["jboss.deployment.unit.\"helloworld.war\".weld.weldClassIntrospector is missing [jboss.deployment.unit.\"helloworld.war\".beanmanager]"]}
Looks like your persistence.xml is in the wrong place, hence the "Can't find a persistence unit named null in deployment"
Try copying persistence.xml in src\main\resources\META-INF

Unable in running Project from Tomcat to Glassfish server in Netbeans

I made a Java web project using Tomcat server.Now I am opening the same project in another PC where only Glassfish is installed(Due to some reasons I don't wanna run the project using Tomcat anymore).But it gives this exception now.
Exception during lifecycle processing
Exception while loading the app : java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: java.lang.IllegalArgumentException: java.lang.IllegalArgumentException: Unable to add listener of type: com.chat.listeners.ChatAppListener, because it does not implement any of the required ServletContextListener, ServletContextAttributeListener, ServletRequestListener, ServletRequestAttributeListener, HttpSessionListener, or HttpSessionAttributeListener interfaces
Is there any warning when you opening the project in netbeans.Right click on the project , select resolve server missing problem.Choose Glassfish server.Run once again.
You have apache specific relations in your web.xml file (like file handler servlets).
That is why glassfish can't start your application.

Categories