I am attempting to deploy a war file in Jboss eap 6.4 and I want to use the --name argument with the deploy. However, when I do so the war gets deployed but is inaccessible via the name..
The war file is named testweb.war. It works perfectly fine when I deploy it without the --name argument during the deploy command, but I am creating a deploy script where customers need to be able to name the application as well...
Here is the web.xml in my war file:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Application 2.3//EN"
"http://www.jboss.org/j2ee/dtd/jboss-web_3_0.dtd">
<jboss-web>
<context-root></context-root>
</jboss-web>
The command I'm using with the jboss-cli is:
deploy /path/to/war/testweb.war --name=testweb
And the web application is inaccessible via the url:
localhost:8085/testweb
This is the correct port number, and should be the correct application name..
Thank you in advance.
Well, I figured it out today in case anyone out there was also asking this very obscure question haha..
The issue is with the runtime-name of the deployed war. In Jboss the runtime name must end with the extension of the file being deployed.. So if you deploy example.war the runtime name must end with .war
When you specify a name without specifying the runtime name you get a problem, because by default jboss will use the application name as the runtime name.
So when I did: deploy /path/to/war/testweb.war --name=testweb
It was subsequently using testweb as the runtime name, and therefore wouldn't work properly.
/path/to/war/testweb.war --name=testweb --runtime-name=testweb.war is a way to fix this issue.
Related
I have an application deployed on JBoss Eap 6.4 and I need to access to images that are located outside of my project in C:\AdminCont\Images, Is there any form to configure for JSP access to this images or any other form using NFS?
I´m trying using overlay in jboss-web.xml but I don´t know how is the correct implementation.
A portable way to implement this is to write a small servlet which simply maps the request URL to a filesystem location and sends the content out.
A not portable way, a JBoss specific way, is to declare an outside directory to <overlay> in jboss-web.xml in order to add non-existing files to your deployment. Here is an example:
<jboss-web version="7.0"
xmlns:jboss="http://www.jboss.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.jboss.com/xml/ns/javaee jboss-web_7_0.xsd">
...
<overlay>/path/to/your/images/</overlay>
...
</jboss-web>
The object is to build .ear by using ANT then deploy it on Websphere 8.5 with wsadmin.
Manually, the ear file is generated from a jar file and after deployment, the web application works very well.
But if I use the ear generated by ANT, after deployment (by hand or by wsadmin), I always have this error :
SRVE0255E: A WebGroup/Virtual Host to handle /WebApp$%7Blogout.url%7D has not been defined.
SRVE0255E: A WebGroup/Virtual Host to handle localhost:9080 has not been defined.
Someone knows which might invoke this problem. I met this message before while my colleague deploy on websphere with a war file directly from a Tomcat server.
Thanks in advance.
It looks like you have not defined web application bindings during deployment. There are several ways to do this, but before that I suggest that you read about Application bindings in WAS, especially the paragraph Virtual host bindings for web modules.
Required bindings can be provided either as parameters to install command of AdminApp or by including binding files directly inside WAR. In some cases WAS can generate default binding for you. For example, to install web application with default bindings you need to provide the following command to wsadmin (simplified):
AdminApp.install(path_to_your_war_file, [
'-appname', your_app_name,
'-CtxRootForWebMod', [
['.*', '.*', your_app_context_root]
],
'-usedefaultbindings'])
I also recommend deploying application once in WAS console to understand possible bindings.
I have an Eclipse Java web application that I am deploying to Tomcat 7 from within Eclipse 3.7. In my Eclipse server configuration at Servers > Tomcatv7-config > server.xml, I see the following line is added when I deploy my application:
<Context docBase="myapp" path="/myapp" reloadable="true" source="org.eclipse.jst.j2ee.server:myapp"/>
My question is this: is there any way for me to add a parameter to this <Context> element for a specific project?
What I need to do is add useHttpOnly=”false” in order for DWR to work properly in Tomcat 7. I understand the security risks with this, so please no lecture :)
You should be able to specify a context.xml in /META-INF/ within your WAR/Project which will trump the server.xml line:
In an individual file at /META-INF/context.xml inside the application
files. Optionally (based on the Host's copyXML attribute) this may be
copied to $CATALINA_BASE/conf/[enginename]/[hostname]/ and renamed to
application's base file name plus a ".xml" extension.
I have created myProj.ear file and copied it into the deploy folder of the JBoss server.. How to run my project after starting the jBoss server?
I have been using war file and
deploying it in Tomcat till now to run
my project.... I am having a new
requirement to run the project in
JBoss. So, I converted my war file
into an ear file using the command Jar
-cvf myProj.ear ., Should I change anything in my project to run
the application in JBoss or just
copying my .ear file in to the jBoss
deploy folder is enough?
JBoss normally support hot deployment - meaning that if your application was deployed correctly (watch the console), it can be accessed via the browser (if you have a UI) or via web services, managed beans or any other interface you have provided.You can see the status of your application on the JBoss Admin Console. You can reach it by typing the URL of your JBoss installation. If you run your vanilla JBoss locally, you should be able to find the console under http://127.0.0.1:8080/admin-console
To reiterate: there is no explicit startup necessary, JBoss handles it for you.
Deploying an application in JBoss is pretty straightforward. You just have to copy the EAR file to the deploy directory in the 'server configuration' directory of your choice. Most people deploy it to the 'default' configuration, by copying the EAR file to the JBOSS_DIR/jboss-as/server/default/deploy directory.
Once copied, just run run.sh from bin, you can use the following params to bind it to an ip (-b) or binding it to anything other port (-Djboss.service.binding.set)
./run.sh -b 9.xxx.xxx.xxx -Djboss.service.binding.set=ports-01
Once you run it, Look at the console for error message. If everything goes fine you'd see "Started J2EE application" after couple of seconds.
If there are any errors or exceptions, make a note of the error message. Check that the EAR is complete and inspect the WAR file and the EJB jar files to make sure they contain all the necessary components (classes, descriptors,
jboss-deployment-structure.xml etc.).
You can safely redeploy the application if it is already deployed. To undeploy it you just have to remove the archive from the deploy directory. There’s no need to restart the server in either case. If everything seems to have gone OK, then point your browser at the application URL.
http://localhost:8080/xyz
I have an EAR file I am trying to deploy alongside various WAR deployments on JBoss 4.2.3
The individual standalone WAR deployments are all working fine and are just a copy of the same application that is contained inside the EAR but the EAR deployment and it's included WAR(s) does not work correctly.
I am receiving a blank white page in the browser when I visit the virtual host that the jboss-web.xml is configured to associate with this EAR. The other virtual hosts associated with the standalone WAR deployments all work fine and are configured the same way.
I get no errors on startup and JBoss reports that the site was started. I have a jboss-web.xml file in the WAR's WEB-INF that ties it into a definition from server.xml. This works on every other type of configuration except the EAR. I keep getting just a white page, as if JBoss can't connect the WAR in the EAR to the host or maybe the WAR isn't starting right or I have some config wrong here.
When I fire up JBoss it creates the flex and railo directories in webwar1.war/WEB-INF as well as a railo-server directory as railo.ear/lib/railo-server but still just serves me a blank white page.
Here is where I stand...
I have a set of shared Railo JAR files are located in /JBoss/server/default/deploy/jboss-web.deployer/railojars/lib (I have told jboss-service.xml to include this as a classpath)
My site1.WAR and site2.WAR files are in the deploy folder and each contain an index.cfm and a WEB-INF with web.xml and jboss-web.xml mapped to a virtual host. They each use this shared Railo JAR instance and run perfectly. The sites I've configured in server.xml with a docPath and appPath to an outside folder use this shared JAR installation and run perfectly. Everything is good with this.
If I place a railo1.war, railo2.war, etc in the /JBoss/server/default/deploy folder (the full WAR with Railo lib folder) those sites use the Railo instance contained within the WAR. This is also great.
So, my only problem left is this:
under /JBoss/server/default/deploy I have created railo.ear
Inside railo.ear is:
META-INF which contains application.xml with:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE application PUBLIC "-//Sun Microsystems, Inc.//DTD J2EE Application 1.2//EN" "http://java.sun.com/j2ee/dtds/application_1_2.dtd">
<application id="RailoInstance1">
<display-name>Railo3</display-name>
<description>Railo3</description>
<module id="Module1">
<web>
<web-uri>webwar1.war</web-uri>
<context-root>/webwar1</context-root>
</web>
</module>
</application>
It also contains webwar1.war which contains: index.cfm and WEB-INF
WEB-INF has has web.xml, lib and jboss-web.xml
jboss-web.xml looks like this:
<jboss-web>
<context-root>/</context-root>
<virtual-host>foo3.com</virtual-host>
</jboss-web>
From server.xml:
<Host name="foo3.com">
<Alias>www.foo3.com</Alias>
</Host>
foo3.com is using jk_mod to send to JBoss via a virtual host from Apache. The other two sites (foo1.com, foo2.com) which are mapped to WAR deployments are configured the exact same way and work fine.
The WEB-INF includes the lib folder so I would expect this webwar1.WAR instance to use the Railo JAR files contained in that lib folder. The problem is that when I start JBoss, all of my other sites configured their various ways work, but the site in webwar1.war is not coming up. I simply see a white page in the browser.
So, either the jboss-web.xml in WEB-INF in the webwar1.war file is not being connected to the defined in server.xml or something else is going wrong here. My other standalone WAR installations and the shared JARs sites all see their respective descriptors as marked in their jboss-web.xml and have the same content as this deployment.
So, I'm just trying to figure out what I need to do to get this last EAR configuration to work.
The way I am trying now seems like each WAR would try to use the JAR files it contains, but I want to have one set of shared JAR files for the whole EAR and then each WAR file in the ear use those JARS.
I want to be able to have webwar1.war, webwar2.war, etc under this one EAR configuration so I have moved the lib folder out of webwar1.war/WEB-INF/lib and into railo.ear/lib
I would love to set it up this way, but I can't even get one WAR with its own JAR files to load up right when inside the EAR. I have tried this new configuration and get the same blank white page in the browser.
Any ideas?
JBoss gives me no errors. Another odd thing is that I don't get an error from Apache like I do when I try to visit a site that is improperly configured and did not start up. And if I visit a site that is not set up as a host in JBoss and I am redirected via jk_mod to JBoss, I see the JBoss default page. I am not seeing this default page when I visit the virtual host associated with this webwar1.war in the railo.ear, so JBoss must know that it's supposed to do something with the domain / virtual host or else it would show me that default JBoss page. Instead I see a blank white one.
I should also mention that this works on JBoss 5.1. The railo.ear configured the exact same way latches onto the virtual host and works properly.
Help? Thanks!!!!
Sounds like a complicated job; the folks on the railo-users mailing list might be able to help : http://groups.google.com/group/railo
Railo also has a professional services team who are ace : http://www.getrailo.com/index.cfm/contact-us/