-
1. Re: Jboss as 7 virtual host
rhusar Apr 2, 2014 7:14 AM (in response to sam.gu)Not sure what is the question, the process seems fine.
For every translation from a domain name to an IP adress you will need to perform a DNS lookup from the DNS server. You need to add that DNS entry possibly to your intranet DNS server or to a TLD and publicly available DNS server. (Editing the local hosts file will not affect other clients trying to access myapp -- I hope that's clear.)
-
2. Re: Jboss as 7 virtual host
sam.gu Apr 3, 2014 1:06 AM (in response to rhusar)I means,in addition to the DNS look up, whether there is anohter method to realize browse my app using port directly,not ip:port/myapp ?
-
3. Re: Jboss as 7 virtual host
sam.gu Apr 3, 2014 8:34 PM (in response to rhusar)The major cause is that myapp's return code is 500 error when myapp is out of memory,my app's address is http://192.168.1.3/myapp.But then,the http://192.168.1.3 is ok, this address without /myapp return the welcome jboss html file.
So,i want to realize browse my app using ip:port,not including /myapp.
-
4. Re: Re: Jboss as 7 virtual host
rhusar Apr 4, 2014 10:18 AM (in response to sam.gu)1 of 1 people found this helpfulThe major cause is that myapp's return code is 500 error when myapp is out of memory,my app's address is http://192.168.1.3/myapp.But then,the http://192.168.1.3 is ok, this address without /myapp return the welcome jboss html file.
You seem to be confusing lots of things into one, OOMs/DNS/context path.
If you want to deploy the application and make it available at host[:port]/ instead of host[:port]/myapp you can do this 2 ways:
Add jboss-web.xml file to WEB-INF directory and use context-root element:
<?xml version="1.0" encoding="UTF-8"?> <jboss-web version="8.0" xmlns="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 http://www.jboss.org/j2ee/schema/jboss-web_8_0.xsd"> <context-root>/</context-root> </jboss-web>
This is JBoss specific.
Also you can use the EE way and bundle the WAR into an EAR in application.xml:
<?xml version="1.0" encoding="UTF-8"?> <application xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/application_7.xsd" version="7"> <display-name>example</display-name> <module> <web> <web-uri>example.war</web-uri> <context-root>/</context-root> </web> </module> <library-directory>lib</library-directory> </application>
To realize this via maven, use build step such as:
<build> <finalName>example</finalName> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.1</version> <configuration> <source>1.7</source> <target>1.7</target> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-ear-plugin</artifactId> <version>2.9</version> <configuration> <version>7</version> <defaultLibBundleDir>lib</defaultLibBundleDir> <modules> <webModule> <groupId>com.example</groupId> <artifactId>example-web</artifactId> <contextRoot>/</contextRoot> </webModule> </modules> </configuration> </plugin> </plugins> </build>
-
5. Re: Re: Jboss as 7 virtual host
sam.gu Apr 8, 2014 5:54 AM (in response to rhusar)Thanks for your reply. Now i have put WAR into an EAR in application.xml,but there is a error when the jboss startup. the error is below:
16:56:59,061 INFO [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/]] (ServerService Thread Pool -- 67) No Spring WebApplicationInitializer types detected on classpath
16:56:59,537 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-8) JBAS010409: 解除数据源 [java:jboss/datasources/ExampleDS] 的绑定
16:56:59,545 INFO [org.apache.coyote.http11] (MSC service thread 1-3) JBWEB003075: Coyote HTTP/1.1 pausing on: http-/0.0.0.0:80
16:56:59,559 INFO [org.apache.coyote.http11] (MSC service thread 1-3) JBWEB003077: Coyote HTTP/1.1 stopping on : http-/0.0.0.0:80
Coudle you please tell me what can i do??
-
6. Re: Re: Jboss as 7 virtual host
rhusar Apr 8, 2014 6:20 AM (in response to sam.gu)Thanks for your reply. Now i have put WAR into an EAR in application.xml,but there is a error when the jboss startup. the error is below:
If the problem is bundling into EAR, use the first approach using jboss-web.xml.
-
7. Re: Re: Jboss as 7 virtual host
sam.gu Apr 10, 2014 8:39 PM (in response to rhusar)The jboss-web.xml is need the DNS support?
-
8. Re: Re: Jboss as 7 virtual host
rhusar Apr 11, 2014 4:31 AM (in response to sam.gu)Sam 顾 wrote:
The jboss-web.xml is need the DNS support?
Nothing to do with the dns, just the context so that you will be able to access http://example.com instead of http://example.com/myappcontext.