Skip to content
This repository has been archived by the owner on Nov 27, 2019. It is now read-only.

abcd #1

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ What is it?

This is a sample Maven 3 project to help you get your foot in the door developing with Spring on JBoss Enterprise Application Platform 6 or JBoss AS 7.1, deployable on OpenShift (PaaS by Red Hat).

This project is setup to allow you to create a compliant Spring 3.1 application using Spring MVC, JPA 2.0 and Bean Validation 1.0. It includes a persistence unit and some sample persistence and transaction code to introduce you to database access in enterprise Java.
This project is setup to allow you to create a compliant Spring 3.2 application using Spring MVC, JPA 2.0 and Bean Validation 1.0. It includes a persistence unit and some sample persistence and transaction code to introduce you to database access in enterprise Java.

Quickstart
----------

1) Create an account at http://openshift.redhat.com/ and follow the Getting Started guide to install the OpenShift command line tools.
1) Create an account at https://www.openshift.com and follow the Getting Started guide to install the OpenShift command line tools.

2) Create a JBoss Enterprise Application Platform 6 app:

rhc app create -a spring -t jbosseap-6.0
rhc app create spring jbosseap-6

3) Add this upstream repo:

Expand Down Expand Up @@ -45,9 +45,9 @@ The example uses a H2 database configured and deployed by the application. You c

rhc cartridge add -a spring -c mysql-5.1

2) Edit `src/main/resources/META-INF/persistence.xml` to use the appropriate datasource (java:jboss/datasources/MysqlDS or java:jboss/datasources/PostgreSQLDS):
2) Edit `src/main/webapp/WEB-INF/jboss-web.xml` to use the appropriate datasource (java:jboss/datasources/MysqlDS or java:jboss/datasources/PostgreSQLDS):

<jta-data-source>java:jboss/datasources/MysqlDS</jta-data-source>
<jndi-name>java:jboss/datasources/MysqlDS</jndi-name>

3) Commit and push your changes:

Expand Down
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<properties>
<!-- Spring version -->
<version.spring>3.1.1.RELEASE</version.spring>
<version.spring>3.2.8.RELEASE</version.spring>

<!-- Spring Third Party dependencies -->
<version.aopalliance>1.0</version.aopalliance>
Expand Down Expand Up @@ -185,10 +185,10 @@
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
</dependency>
<dependency>
<!-- dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-asm</artifactId>
</dependency>
</dependency-->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/META-INF/persistence.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
data source, this example data source is just for development and testing! -->
<!-- The datasource is deployed as WEB-INF/spring-quickstart-ds.xml, you
can find it in the source at src/main/webapp/WEB-INF/spring-quickstart-ds.xml -->
<jta-data-source>java:jboss/datasources/ExampleDS</jta-data-source>
<jta-data-source>java:comp/env/jdbc/ExampleDS</jta-data-source>
<properties>
<property name="jboss.entity.manager.factory.jndi.name" value="java:jboss/spring-quickstart/persistence" />
<!-- Properties for Hibernate -->
Expand Down
9 changes: 9 additions & 0 deletions src/main/webapp/WEB-INF/jboss-web.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<jboss-web>
<resource-ref>
<res-ref-name>jdbc/ExampleDS</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
<jndi-name>java:jboss/datasources/ExampleDS</jndi-name>
</resource-ref>
</jboss-web>
7 changes: 6 additions & 1 deletion src/main/webapp/WEB-INF/web.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
classpath:/META-INF/spring/infrastructure.xml</param-value>
</context-param>

<context-param>
<param-name>org.jboss.as.jaxrs.disableSpringIntegration</param-name>
<param-value>true</param-value>
</context-param>

<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
Expand All @@ -31,4 +36,4 @@
<servlet-name>jboss-as-kitchensink</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
</web-app>
</web-app>