Do JBoss Seam applications have to be packages in an EAR? - java

Is it possible to package up a Seam application as a WAR file? I am trying to deploy a current Seam application that was running in JBoss to JBoss 6. It is packaged as a WAR file, but every example included with the Seam download seem to be packaged in an EAR with the Seam jar and application code, both deployed as EJBs

Sharing the error message at deployment would be helpful.
Was the web application (file.war) referencing services not in the file.war?
Most projects are deployed as an ear because the ejb modules are packaged separately (see below application.xml). Take a look at the application.xml back on the original pre JBoss 6 server that it was running on. It likely it had other modules besides the war file.
<application xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_5.xsd"
version="5">
<display-name>Seam Registration</display-name>
<module>
<web>
<web-uri>jboss-seam-registration.war</web-uri>Chapter 1. Seam
Tutorial 14
<context-root>/seam-registration</context-root></web>
</module>
<module>
<ejb>jboss-seam-registration.jar</ejb>
</module>
<module>
<ejb>jboss-seam.jar</ejb>
</module>
<module>
<java>jboss-el.jar</java>
</module>
</application>

Related

migration of jboss 4.2 to wildfly 8

we have legacy java project with ear deployment structure.
.ear---| classes
| lib
| META-INF ---| application.xml
| .war | jboss-app.xml
| MENIFEST.MF
which is running fine on jboss 4.2. now we are migrating jboss 4.2 to wildfly 8.
ERROR : jboss-app.xml is deprecated and "loader-repository" is ignored.
we gone through the wildfly document then we came to know that we have to create jboss-deployment-structure.xml to define modules.
we have jboss-app.xml:-
<jboss-app>
<module-order>strict</module-order>
<loader-repository>
com.mono.myproject:archive=CompleteApp.ear
<loader-repository-config>
java2ParentDelegation=false
</loader-repository-config>
</loader-repository>
<library-directory>/lib</library-directory>
<module>
<web>
<web-uri>firstWeb.war</web-uri>
<context-root>firstWeb</context-root>
</web>
</module>
<module>
<web>
<web-uri>secondWeb.war</web-uri>
<context-root>secondWeb</context-root>
</web>
</module>
<module>
<web>
<web-uri>thirdWeb.war</web-uri>
<context-root>thirdWeb</context-root>
</web>
</module>
</jboss-app>
How can we load above (loader-repository) in jboss-deployment-structure.xml in wildfly 8?
Without loader repository we have tried but got ERROR:- linkage error (com.mono.myproject not found)
Thanks in advance.

How to use custom module.xml and deploy after custom module of JBOSS EAP6.4 with Spring Boot Application

We are using artesia 3rd party product for our project and it is deployed in JBOSS EAP6.4, I want to use spring boot in our project and when I write sample REST webservices I am able to access the REST web service via URL.
As per the documentation of our product if we need to customize the project we need to write our custom war by specifying below two JBOSS files inside META-INF folder
jboss-all.xml
<?xml version="1.0" encoding="UTF-8"?>
<jboss umlns="urn:jboss:1.0">
<jboss-deployment-dependencies xmlns="urn:jboss:deployment-dependencies:1.0">
<dependency name="artesia.ear" />
</jboss-deployment-dependencies>
</jboss>
so our custom logic should begin after successful start of artesia.ear.
our jboss-deployment-structure.xml
<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure>
<sub-deployment>
<dependencies>
<module name="deploy" />
</dependencies>
</sub-deployment>
</jboss-deployment-structure>
Above deploy module contains all jars necessary for the project to run.
When I follow the same and created the war without spring in it, it was successful and there are no issues, we are able to use to customize war.
Now I want to do the same in Spring-boot 1.4.1 application, where my spring boot app should start after artesia.ear starts successfully and apart from spring jars my spring-boot app should use jars from module.xml.
I have placed the above two xml's inside META-INF of spring boot application but it is failing when deployed in JBOSS EAP6.4
Below is the error that I get
jboss-server.log
What I need to do to use same for my spring-boot app
EDIT 1:
I tried by placing both jboss files under WEB-INF folder of spring-boot application but still the facing the same issue
We need to make sure that META-INF and WEB-INF folders are lying side by side instead of keeping META-INF folder inside classes folder of WEB-INF which is where default spring-boot META-INF folder resides.

jboss 6.4 ignoring webapp directory structure

we are moving from jboss 5.1 to jboss 6.4 and i have below entries in my xxx.ear/META-INF/application.xml. it seems like jboss 6.4 is not able to identify webapp but when I change this to webapp.war then it is deployed, due to this I need to rename my webapp folder to webapp.war.
With jboss 5.1 it is working fine but jboss 6.4 needs this change, is their any way I can suppress this?
Application scripts needs update to rename webapp to webapp.war every where and I want to avoid it.
Thanks in advance.
<?xml version='1.0' encoding='UTF-8'?>
<application xmlns="http://java.sun.com/xml/ns/j2ee" version="1.4"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/application_1_4.xsd">
<display-name>Web App</display-name>
<module>
<web>
<web-uri>webapp</web-uri>
<context-root>/app</context-root>
</web>
</module>
</application>

Glassfish 4.1: war inside ear does not expose webservices

I am currently working on upgrading an application from Java7 running on Glassfish 3.1.2.2, to Java8 running on Glassfish 4.1. The application is packaged as an ear-file, containing an ejb-jar, and a war. The war in turn contains some webservices.
In Glassfish 3.1.2.2, deploying the ear will lead to the war exposing a number of webservices. But, when I deploy the ear in Glassfish 4.1, no webservice are exposed. When listing the components for the ear in Glassfish, the war does not list webservices (only web) in 4.1 (but does in 3.1.2.2).
I have tried deploying the war-file as a standalone application, and when doing this the webservices becomes available.
Does anyone know if there is a known bug with regards to deploying webservices through an ear-file with Glassfish 4.1?
When it comes to changes, I have upgraded some dependencies, but as far as I know there is nothing that should affect this.
My application.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE application PUBLIC
"-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN"
"http://java.sun.com/dtd/application_1_3.dtd">
<application>
<display-name>myApplication-ear</display-name>
<description>myApplication</description>
<module>
<ejb>myApplication-ejb-5.2-SNAPSHOT.jar</ejb>
</module>
<module>
<web>
<web-uri>myApplication-war-5.2-SNAPSHOT.war</web-uri>
<context-root>/myApplication-war</context-root>
</web>
</module>
</application>
The problem was an old dependency:
<dependency>
<groupId>com.sun.xml.ws</groupId>
<artifactId>jaxws-rt</artifactId>
<version>2.2.7</version>
</dependency>
I removed it because it is already included in rt.jar in the java installation.
Somehow Glassfish didn't handle this at all, the webservices simply didn't work and no traces of error in the server.log
Can this be your scenario (?): EJB module deployment may fail when an EJB that is exposed as a web service, and which has a handler, is initialized before an EJB on which it has dependencies. This is caused by the way the EJB container initializes and loads EJB web services, the workaround is to rename the EJBs so that the EJB exposed as a web service is initialized after the EJB on which it has dependencies.

HTTP Status 404 when packaging WAR in EAR file

I'm using JBoss AS 7.1.1.Final and have been having problems getting my deployment to work. I have a couple of EJB jar files and a WAR file that I'm packaging into a single EAR. If I deploy the WAR file separately, I'm able to access it by the context-root specified in the jboss-web.xml file. However, when I package it up into an EAR file, I keep getting a "HTTP Status 404 - /pacbridge-web/" error for the same URL.
Here is what I have
EAR File:
|---pacbridge-app-6.0.0.jar
|---pacbridge-dom-6.0.0.jar
|---pacbridge-ejb-6.0.0.jar
|---pacbridge-web-6.0.0.war
|---META-INF
|---application.xml
|---MANIFEST.MF
|---lib
|----bunch of jar files
My application.xml looks like this:
<application ...>
<display-name>pacbridge-ear</display-name>
<module>
<web>
<web-uri>pacbridge-web-6.0.0.war</web-uri>
<context-root>/pacbridge-web</context-root>
</web>
</module>
<module>
<ejb>pacbridge-ejb-6.0.0.jar</ejb>
</module>
<module>
<ejb>pacbridge-app-6.0.0.jar</ejb>
</module>
<module>
<ejb>pacbridge-dom-6.0.0.jar</ejb>
</module>
<library-directory>lib</library-directory>
</application>
I'm not sure that it's applicable but there is my jboss-web.xml file:
<jboss-web>
<context-root>pacbridge-web</context-root>
</jboss-web>
Could someone give me some hints as to what I might be doing wrong?
Thanks

Categories

Resources