Created
November 20, 2011 18:53
-
-
Save mbogoevici/1380689 to your computer and use it in GitHub Desktop.
Ear with two wars deployment error
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<beans xmlns="http://www.springframework.org/schema/beans" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:javaee="http://www.springframework.org/schema/jee" | |
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.0.xsd"> | |
<!--<javaee:jndi-lookup jndi-name="java:jboss/datasources/ExampleDS" id="dataSource" />--> | |
</beans> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<beans xmlns="http://www.springframework.org/schema/beans" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:javaee="http://www.springframework.org/schema/jee" | |
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.0.xsd"> | |
<!--<javaee:jndi-lookup jndi-name="java:jboss/datasources/ExampleDS" id="dataSource" />--> | |
</beans> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version='1.0' encoding='UTF-8'?> | |
<faces-config xmlns="http://java.sun.com/xml/ns/javaee" version="2.0"> | |
</faces-config> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<body> | |
<h2>Hello World!</h2> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<body> | |
<h2>Hello World!</h2> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package test; | |
import javax.naming.InitialContext; | |
import javax.naming.NamingException; | |
import javax.servlet.ServletContextEvent; | |
import javax.servlet.ServletContextListener; | |
import javax.servlet.ServletRequestEvent; | |
import javax.servlet.ServletRequestListener; | |
/** | |
* @author Marius Bogoevici | |
*/ | |
public class Listener implements ServletContextListener, ServletRequestListener{ | |
public void contextInitialized(ServletContextEvent sce) { | |
try { | |
final Object lookup = new InitialContext().lookup("java:jboss/datasources/ExampleDS"); | |
System.out.println(lookup); | |
} catch (NamingException e) { | |
throw new RuntimeException(e); | |
} | |
} | |
public void requestDestroyed(ServletRequestEvent sre) { | |
//To change body of implemented methods use File | Settings | File Templates. | |
} | |
public void requestInitialized(ServletRequestEvent sre) { | |
//To change body of implemented methods use File | Settings | File Templates. | |
} | |
public void contextDestroyed(ServletContextEvent sce) { | |
//To change body of implemented methods use File | Settings | File Templates. | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package test; | |
import javax.naming.InitialContext; | |
import javax.naming.NamingException; | |
import javax.servlet.ServletContextEvent; | |
import javax.servlet.ServletContextListener; | |
/** | |
* @author Marius Bogoevici | |
*/ | |
public class Listener2 implements ServletContextListener{ | |
public void contextInitialized(ServletContextEvent sce) { | |
try { | |
final Object lookup = new InitialContext().lookup("java:jboss/datasources/ExampleDS"); | |
System.out.println(lookup); | |
} catch (NamingException e) { | |
throw new RuntimeException(e); | |
} | |
} | |
public void contextDestroyed(ServletContextEvent sce) { | |
//To change body of implemented methods use File | Settings | File Templates. | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
will add sources |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<project xmlns="http://maven.apache.org/POM/4.0.0" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<parent> | |
<artifactId>testEar</artifactId> | |
<groupId>testEar</groupId> | |
<version>1.0</version> | |
</parent> | |
<modelVersion>4.0.0</modelVersion> | |
<artifactId>earModule</artifactId> | |
<packaging>ear</packaging> | |
<dependencies> | |
<dependency> | |
<groupId>testEar</groupId> | |
<artifactId>war1</artifactId> | |
<version>${project.version}</version> | |
<type>war</type> | |
</dependency> | |
<dependency> | |
<groupId>testEar</groupId> | |
<artifactId>war2</artifactId> | |
<version>${project.version}</version> | |
<type>war</type> | |
</dependency> | |
</dependencies> | |
<build> | |
<plugins> | |
<plugin> | |
<artifactId>maven-ear-plugin</artifactId> | |
<configuration> | |
<modules> | |
<webModule> | |
<groupId>testEar</groupId> | |
<artifactId>war1</artifactId> | |
</webModule> | |
<webModule> | |
<groupId>testEar</groupId> | |
<artifactId>war2</artifactId> | |
</webModule> | |
</modules> | |
</configuration> | |
</plugin> | |
</plugins> | |
</build> | |
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<project xmlns="http://maven.apache.org/POM/4.0.0" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<packaging>pom</packaging> | |
<modules> | |
<module>war1</module> | |
<module>war2</module> | |
<module>earModule</module> | |
</modules> | |
<groupId>testEar</groupId> | |
<artifactId>testEar</artifactId> | |
<version>1.0</version> | |
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | |
<parent> | |
<artifactId>testEar</artifactId> | |
<groupId>testEar</groupId> | |
<version>1.0</version> | |
</parent> | |
<modelVersion>4.0.0</modelVersion> | |
<artifactId>war1</artifactId> | |
<packaging>war</packaging> | |
<name>war1 Maven Webapp</name> | |
<url>http://maven.apache.org</url> | |
<dependencies> | |
<dependency> | |
<groupId>org.jboss.spec.javax.servlet</groupId> | |
<artifactId>jboss-servlet-api_3.0_spec</artifactId> | |
<version>1.0.0.Final</version> | |
<scope>provided</scope> | |
</dependency> | |
</dependencies> | |
<build> | |
<finalName>war1</finalName> | |
</build> | |
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | |
<parent> | |
<artifactId>testEar</artifactId> | |
<groupId>testEar</groupId> | |
<version>1.0</version> | |
</parent> | |
<modelVersion>4.0.0</modelVersion> | |
<artifactId>war2</artifactId> | |
<packaging>war</packaging> | |
<name>war2 Maven Webapp</name> | |
<url>http://maven.apache.org</url> | |
<dependencies> | |
<dependency> | |
<groupId>org.jboss.spec.javax.servlet</groupId> | |
<artifactId>jboss-servlet-api_3.0_spec</artifactId> | |
<version>1.0.0.Final</version> | |
<scope>provided</scope> | |
</dependency> | |
</dependencies> | |
<build> | |
<finalName>war2</finalName> | |
</build> | |
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE web-app PUBLIC | |
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" | |
"http://java.sun.com/dtd/web-app_2_3.dtd" > | |
<web-app> | |
<display-name>Archetype Created Web Application</display-name> | |
<context-param> | |
<param-name>javax.faces.CONFIG_FILES</param-name> | |
<param-value>/WEB-INF/faces-config.xml</param-value> | |
</context-param> | |
<context-param> | |
<param-name>org.richfaces.resourceMapping.enabled</param-name> | |
<param-value>true</param-value> | |
</context-param> | |
<context-param> | |
<param-name>javax.faces.STATE_SAVING_METHOD</param-name> | |
<param-value>server</param-value> | |
</context-param> | |
<context-param> | |
<param-name>org.richfaces.SKIN</param-name> | |
<param-value>wine</param-value> | |
</context-param> | |
<listener> | |
<listener-class>test.Listener</listener-class> | |
</listener> | |
<!--<listener>--> | |
<!--<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>--> | |
<!--</listener>--> | |
<servlet> | |
<servlet-name>Faces Servlet</servlet-name> | |
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class> | |
<load-on-startup>1</load-on-startup> | |
</servlet> | |
<servlet-mapping> | |
<servlet-name>Faces Servlet</servlet-name> | |
<url-pattern>/faces/*</url-pattern> | |
</servlet-mapping> | |
<servlet-mapping> | |
<servlet-name>Faces Servlet</servlet-name> | |
<url-pattern>*.jsf</url-pattern> | |
</servlet-mapping> | |
<servlet-mapping> | |
<servlet-name>Faces Servlet</servlet-name> | |
<url-pattern>*.xhtml</url-pattern> | |
</servlet-mapping> | |
<welcome-file-list> | |
<welcome-file>index.xhtml</welcome-file> | |
</welcome-file-list> | |
</web-app> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE web-app PUBLIC | |
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" | |
"http://java.sun.com/dtd/web-app_2_3.dtd" > | |
<web-app> | |
<display-name>Archetype Created Web Application</display-name> | |
<listener> | |
<listener-class>test.Listener2</listener-class> | |
</listener> | |
<!--<listener>--> | |
<!--<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>--> | |
<!--</listener>--> | |
</web-app> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment