HTTP Status 404 when packaging WAR in EAR file - java

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

Related

Context.xml not recognized and not executed by Tomcat

after setting $CATALINA_HOME in this path /usr/local/cellar/tomcat/9.0.68/libexec, i put the file Context.xml with the same name as my war "warName.xml" in this path : /usr/local/Cellar/tomcat/9.0.68/libexec/work/Catalina/localhost.
here is the content of my file :
<Context>
<Resources className="org.apache.catalina.webresources.StandardRoot">
<PreResources className="org.apache.catalina.webresources.DirResourceSet"
base="/Users/user.name/Desktop/workspace/projectName/dev-resources/config" webAppMount="/WEB-INF/classes/"/>
</Resources>
</Context>
and when i deploy and launch the server i have not my dev-resources/config folder inside /WEB-INF/classes/ in my unzipped project.
the unzipped project has the following permissions :
drwxr-x---
i'am wondering if the process can not inject the configuration because of permissions problems
thanks

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.

Gradle adds all modules as EJBs in application.xml

I have the following EAR project in my Gradle script having 2 deploy dependencies:
An EJB jar
An EJB client jar
What I want to do is create an EAR with the 2 jars in ear root but only the actual EJB jar in application.xml, i.e. something like this:
<?xml version="1.0" encoding="UTF-8"?>
<application id="Application_ID" version="6" 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_6.xsd">
<display-name>MyEJBEAR</display-name>
<module>
<ejb>MyEJB.jar</ejb>
</module>
</application>
Here is my build.gradle file:
project(':MyEJBEAR'){
apply plugin: 'ear'
dependencies {
deploy project(':MyEJBClient')
deploy project(':MyEJB')
earlib <common jars>
}
}
The produced EAR structure is what I want however it contains an application.xml file like this (i.e. adds all deploy dependencies as EJBs):
<?xml version="1.0"?>
<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_6.xsd" version="6">
<display-name>MyEJBEAR</display-name>
<module>
<ejb>MyEJB.jar</ejb>
</module>
<module>
<ejb>MyEJBClient.jar</ejb>
</module>
<library-directory>lib</library-directory>
</application>
I have tried to play with deploymentDescriptor like this but I had no luck:
ear {
deploymentDescriptor{
module("MyEJB.jar", "ejb")
}
}
Any idea on how could I exclude the MyEJBClient.jar reference from the application.xml file?
EDIT:
I have found a workaround solution to this by throwing my existing (IDE Generated) META-INF folder that contains a valid application.xml from the EAR project root to a dir(e.g. MyEJBEAR/resources) and adding the following
lines in project(':MyEJBEAR') closure:
ear {
appDirName = 'resources'
}
This done based on this section of Gradle Documentation but I still need to somehow generate a valid application.xml from my build script.

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>

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

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>

Categories

Resources