10/22/2010

glassfish-application.xml and sun-application.xml examples

The following glassfish-application.xml and sun-application.xml have the same content. glassfish-application.xml (the new name for sun-application.xml) is the file for specifying additional application (EAR) configuration in GlassFish 3.1.

sun-application.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sun-application PUBLIC "-//Sun Microsystems, Inc.//DTD GlassFish Application Server 3.0 Java EE Application 6.0//EN" "http://www.sun.com/software/appserver/dtds/sun-application_6_0-0.dtd">
<sun-application>
<web>
<web-uri>hello.war</web-uri>
<context-root>hi</context-root>
</web>
<security-role-mapping>
<role-name>admin</role-name>
<principal-name>js</principal-name>
<group-name>manager</group-name>
</security-role-mapping>
</sun-application>
glassfish-application.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE glassfish-application PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 3.1 Java EE Application 6.0//EN" "http://glassfish.org/dtds/glassfish-application_6_0-1.dtd">
<glassfish-application>
<web>
<web-uri>hello.war</web-uri>
<context-root>hi</context-root>
</web>
<security-role-mapping>
<role-name>admin</role-name>
<principal-name>js</principal-name>
<group-name>manager</group-name>
</security-role-mapping>
</glassfish-application>

glassfish-application-client.xml and sun-application-client.xml examples

The following glassfish-application-client.xml and sun-application-client.xml have the same content. glassfish-application-client.xml (the new name for sun-application-client.xml) is the file for specifying additional application client (application-client.jar) configuration in GlassFish 3.1.

sun-application-client.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sun-application-client PUBLIC "-//Sun Microsystems, Inc.//DTD GlassFish Application Server 3.0 Application Client 6.0//EN" "http://www.sun.com/software/appserver/dtds/sun-application-client_6_0-0.dtd">
<sun-application-client>
<ejb-ref>
<ejb-ref-name>ejb/BarBean</ejb-ref-name>
<jndi-name>java:global/app-name/module-name/FooBean!com.test.xxx.FooRemote</jndi-name>
</ejb-ref>

<resource-ref>
<res-ref-name>queueConnectionFactory</res-ref-name>
<jndi-name>jms/QueueConnectionFactory</jndi-name>
<default-resource-principal>
<name>guest</name>
<password>guest</password>
</default-resource-principal>
</resource-ref>
</sun-application-client>
glassfish-application-client.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE glassfish-application-client PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 3.1 Java EE Application Client 6.0//EN" "http://glassfish.org/dtds/glassfish-application-client_6_0-1.dtd">
<glassfish-application-client>
<ejb-ref>
<ejb-ref-name>ejb/BarBean</ejb-ref-name>
<jndi-name>java:global/app-name/module-name/FooBean!com.test.xxx.FooRemote</jndi-name>
</ejb-ref>

<resource-ref>
<res-ref-name>queueConnectionFactory</res-ref-name>
<jndi-name>jms/QueueConnectionFactory</jndi-name>
<default-resource-principal>
<name>guest</name>
<password>guest</password>
</default-resource-principal>
</resource-ref>
</glassfish-application-client>

glassfish-web.xml and sun-web.xml examples

The following glassfish-web.xml and sun-web.xml have the same content. glassfish-web.xml (the new name for sun-web.xml) is the file for specifying additional web app (WAR) configuration in GlassFish 3.1.

sun-web.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sun-web-app PUBLIC "-//Sun Microsystems, Inc.//DTD GlassFish Application Server 3.0 Servlet 3.0//EN" "http://www.sun.com/software/appserver/dtds/sun-web-app_3_0-0.dtd">
<sun-web-app>
<context-root>different-name</context-root>

<security-role-mapping>
<role-name>admin</role-name>
<principal-name>js</principal-name>
<group-name>manager</group-name>
</security-role-mapping>

<ejb-ref>
<ejb-ref-name>ejb/helloBean</ejb-ref-name>
<jndi-name>HelloBean</jndi-name>
</ejb-ref>

<resource-ref>
<res-ref-name>jdbc/dataSource</res-ref-name>
<jndi-name>jdbc/__default</jndi-name>
<default-resource-principal>
<name>guest</name>
<password>guest</password>
</default-resource-principal>
</resource-ref>
<class-loader delegate="true"/>
</sun-web-app>
glassfish-web.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE glassfish-web-app PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 3.1 Servlet 3.0//EN" "http://glassfish.org/dtds/glassfish-web-app_3_0-1.dtd">
<glassfish-web-app>
<context-root>different-name</context-root>

<security-role-mapping>
<role-name>admin</role-name>
<principal-name>js</principal-name>
<group-name>manager</group-name>
</security-role-mapping>

<ejb-ref>
<ejb-ref-name>ejb/helloBean</ejb-ref-name>
<jndi-name>HelloBean</jndi-name>
</ejb-ref>

<resource-ref>
<res-ref-name>jdbc/dataSource</res-ref-name>
<jndi-name>jdbc/__default</jndi-name>
<default-resource-principal>
<name>myname</name>
<password>password</password>
</default-resource-principal>
</resource-ref>
<class-loader delegate="true"/>
</glassfish-web-app>

glassfish-ejb-jar.xml and sun-ejb-jar.xml examples

The following glassfish-ejb-jar.xml and sun-ejb-jar.xml have the same content. glassfish-ejb-jar.xml (the new name for sun-ejb-jar.xml) is the file for specifying additional EJB jar configuration in GlassFish 3.1.

sun-ejb-jar.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sun-ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 9.0 EJB 3.0//EN" "http://www.sun.com/software/appserver/dtds/sun-ejb-jar_3_0-0.dtd">
<sun-ejb-jar>
<enterprise-beans>
<ejb>
<ejb-name>FooBean</ejb-name>
<jndi-name>FooBean</jndi-name>
<ejb-ref>
<ejb-ref-name>ejb/BarBean</ejb-ref-name>
<jndi-name>java:global/app-name/module-name/FooBean!com.test.xxx.FooRemote</jndi-name>
</ejb-ref>
<ejb-ref>
<ejb-ref-name>ejb/BuzBean</ejb-ref-name>
<jndi-name>corbaname:iiop:otherserver:3700#BuzBean</jndi-name>
</ejb-ref>
<resource-ref>
<res-ref-name>jdbc/employee</res-ref-name>
<jndi-name>jdbc/__default</jndi-name>
</resource-ref>
</ejb>
</enterprise-beans>
</sun-ejb-jar>
glassfish-ejb-jar.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE glassfish-ejb-jar PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 3.1 EJB 3.1//EN" "http://glassfish.org/dtds/glassfish-ejb-jar_3_1-1.dtd">
<glassfish-ejb-jar>
<enterprise-beans>
<ejb>
<ejb-name>FooBean</ejb-name>
<jndi-name>FooBean</jndi-name>
<ejb-ref>
<ejb-ref-name>ejb/BarBean</ejb-ref-name>
<jndi-name>java:global/app-name/module-name/FooBean!com.test.xxx.FooRemote</jndi-name>
</ejb-ref>
<ejb-ref>
<ejb-ref-name>ejb/BuzBean</ejb-ref-name>
<jndi-name>corbaname:iiop:otherserver:3700#BuzBean</jndi-name>
</ejb-ref>
<resource-ref>
<res-ref-name>jdbc/employee</res-ref-name>
<jndi-name>jdbc/__default</jndi-name>
</resource-ref>
</ejb>
</enterprise-beans>
</glassfish-ejb-jar>