BAEL-8874 Merge ejb projects

-Merged ejb and spring-ejb modules into spring-ejb
This commit is contained in:
Dhawal Kapil 2018-11-13 19:45:52 +05:30
parent aa99f4afa8
commit 93f505f9a9
63 changed files with 91 additions and 372 deletions

View File

@ -1,6 +0,0 @@
## Relevant articles:
- [Guide to EJB Set-up](http://www.baeldung.com/ejb-intro)
- [Java EE Session Beans](http://www.baeldung.com/ejb-session-beans)
- [Introduction to EJB JNDI Lookup on WildFly Application Server](http://www.baeldung.com/wildfly-ejb-jndi)
- [A Guide to Message Driven Beans in EJB](http://www.baeldung.com/ejb-message-driven-beans)

View File

@ -1,26 +0,0 @@
<?xml version="1.0"?>
<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">
<modelVersion>4.0.0</modelVersion>
<artifactId>ejb-client</artifactId>
<description>EJB3 Client Maven</description>
<parent>
<groupId>com.baeldung.ejb</groupId>
<artifactId>ejb</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<dependencies>
<dependency>
<groupId>org.wildfly</groupId>
<artifactId>wildfly-ejb-client-bom</artifactId>
<type>pom</type>
</dependency>
<dependency>
<groupId>com.baeldung.ejb</groupId>
<artifactId>ejb-remote</artifactId>
<type>ejb</type>
</dependency>
</dependencies>
</project>

View File

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ejb-jar 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/ejb-jar_3_2.xsd"
version="3.2">
<module-name>remote</module-name>
</ejb-jar>

View File

@ -1,83 +0,0 @@
<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>
<artifactId>ejb-session-beans</artifactId>
<parent>
<groupId>com.baeldung.ejb</groupId>
<artifactId>ejb</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.jboss.arquillian</groupId>
<artifactId>arquillian-bom</artifactId>
<version>${arquillian-bom.version}</version>
<scope>import</scope>
<type>pom</type>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.junit</groupId>
<artifactId>arquillian-junit-container</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<profiles>
<profile>
<id>arquillian-glassfish-embedded</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<dependencies>
<dependency>
<groupId>org.jboss.arquillian.container</groupId>
<artifactId>arquillian-glassfish-embedded-3.1</artifactId>
<version>${arquillian-glassfish-embedded-3.1.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.glassfish.main.extras</groupId>
<artifactId>glassfish-embedded-all</artifactId>
<version>${glassfish-embedded-all.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
</profile>
</profiles>
<build>
<plugins>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>${maven-war-plugin.version}</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
</plugins>
</build>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<arquillian-bom.version>1.1.13.Final</arquillian-bom.version>
<shrinkwrap-resolver-impl-maven.version>2.2.6</shrinkwrap-resolver-impl-maven.version>
<arquillian-junit-container.version>1.1.12.Final</arquillian-junit-container.version>
<arquillian-glassfish-embedded-3.1.version>1.0.0.Final</arquillian-glassfish-embedded-3.1.version>
<junit.version>4.12</junit.version>
<javaee-api.version>7.0</javaee-api.version>
<arquillian-glassfish-embedded-3.1.version>1.0.0.CR4</arquillian-glassfish-embedded-3.1.version>
<glassfish-embedded-all.version>3.1.2</glassfish-embedded-all.version>
</properties>
</project>

View File

@ -1,97 +0,0 @@
<?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>
<groupId>com.baeldung.ejb</groupId>
<artifactId>ejb</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>ejb</name>
<description>EJB Tutorial</description>
<parent>
<groupId>com.baeldung</groupId>
<artifactId>parent-modules</artifactId>
<version>1.0.0-SNAPSHOT</version>
</parent>
<modules>
<module>ejb-remote</module>
<module>ejb-session-beans</module>
</modules>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.baeldung.ejb</groupId>
<artifactId>ejb-remote</artifactId>
<version>${ejb-remote.version}</version>
<type>ejb</type>
</dependency>
<dependency>
<groupId>com.baeldung.ejb</groupId>
<artifactId>ejb-session-beans</artifactId>
<version>${ejb-session-beans.version}</version>
<type>ejb</type>
</dependency>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>${javaee-api.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.wildfly</groupId>
<artifactId>wildfly-ejb-client-bom</artifactId>
<version>${wildfly-ejb-client-bom.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-ejb-plugin</artifactId>
<version>${maven-ejb-plugin.version}</version>
<configuration>
<ejbVersion>${ejbVersion}</ejbVersion>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
<repositories>
<repository>
<id>jboss-public-repository-group</id>
<name>JBoss Public Maven Repository Group</name>
<url>http://repository.jboss.org/nexus/content/groups/public/</url>
<layout>default</layout>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</snapshots>
</repository>
</repositories>
<properties>
<dubbo.version>2.5.7</dubbo.version>
<zookeeper.version>3.4.11</zookeeper.version>
<zkclient.version>0.10</zkclient.version>
<surefire.version>2.19.1</surefire.version>
<ejb-remote.version>1.0-SNAPSHOT</ejb-remote.version>
<ejb-session-beans.version>1.0-SNAPSHOT</ejb-session-beans.version>
<javaee-api.version>7.0</javaee-api.version>
<maven-ejb-plugin.version>2.4</maven-ejb-plugin.version>
<ejbVersion>3.2</ejbVersion>
<wildfly-ejb-client-bom.version>10.1.0.Final</wildfly-ejb-client-bom.version>
</properties>
</project>

View File

@ -1,13 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
</pattern>
</encoder>
</appender>
<root level="INFO">
<appender-ref ref="STDOUT" />
</root>
</configuration>

View File

@ -1,13 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
</pattern>
</encoder>
</appender>
<root level="INFO">
<appender-ref ref="STDOUT" />
</root>
</configuration>

View File

@ -1,4 +1,8 @@
### Relevant Articles
- [Guide to EJB Set-up](http://www.baeldung.com/ejb-intro)
- [Java EE Session Beans](http://www.baeldung.com/ejb-session-beans)
- [Introduction to EJB JNDI Lookup on WildFly Application Server](http://www.baeldung.com/wildfly-ejb-jndi)
- [A Guide to Message Driven Beans in EJB](http://www.baeldung.com/ejb-message-driven-beans)
- [Integration Guide for Spring and EJB](http://www.baeldung.com/spring-ejb)
- [Singleton Session Bean in Java EE](http://www.baeldung.com/java-ee-singleton-session-bean)

View File

@ -3,21 +3,31 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.baeldung.singletonsession</groupId>
<artifactId>ejb-beans</artifactId>
<version>1.0.0-SNAPSHOT</version>
<name>EJB Beans</name>
<name>spring-ejb-beans</name>
<parent>
<groupId>com.baeldung.spring.ejb</groupId>
<artifactId>spring-ejb</artifactId>
<version>1.0.1</version>
<version>1.0.0-SNAPSHOT</version>
</parent>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.jboss.arquillian</groupId>
<artifactId>arquillian-bom</artifactId>
<version>${arquillian-bom.version}</version>
<scope>import</scope>
<type>pom</type>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<!-- https://mvnrepository.com/artifact/javax/javaee-api -->
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>${javaee.version}</version>
<scope>provided</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.openejb/tomee-embedded -->
@ -26,10 +36,49 @@
<artifactId>tomee-embedded</artifactId>
<version>${tomee-embedded.version}</version>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.junit</groupId>
<artifactId>arquillian-junit-container</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<profiles>
<profile>
<id>arquillian-glassfish-embedded</id>
<dependencies>
<dependency>
<groupId>org.jboss.arquillian.container</groupId>
<artifactId>arquillian-glassfish-embedded-3.1</artifactId>
<version>${arquillian-glassfish-embedded-3.1.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.glassfish.main.extras</groupId>
<artifactId>glassfish-embedded-all</artifactId>
<version>${glassfish-embedded-all.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
</profile>
</profiles>
<build>
<plugins>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>${maven-war-plugin.version}</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
</plugins>
</build>
<properties>
<arquillian-bom.version>1.1.13.Final</arquillian-bom.version>
<tomee-embedded.version>1.7.5</tomee-embedded.version>
<glassfish-embedded-all.version>3.1.2</glassfish-embedded-all.version>
<arquillian-glassfish-embedded-3.1.version>1.0.0.CR4</arquillian-glassfish-embedded-3.1.version>
</properties>
</project>

View File

@ -1,4 +1,4 @@
package com.baeldung.ejb.test.stateful;
package com.baeldung.ejb.stateful;
import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;

View File

@ -1,4 +1,4 @@
package com.baeldung.ejb.test.stateless;
package com.baeldung.ejb.stateless;
import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;

View File

@ -4,7 +4,6 @@ import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertNotNull;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import javax.ejb.embeddable.EJBContainer;
@ -22,7 +21,6 @@ public class CountryStateCacheBeanUnitTest {
@Before
public void init() {
ejbContainer = EJBContainer.createEJBContainer();
context = ejbContainer.getContext();
}

View File

@ -1,75 +0,0 @@
<?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>
<artifactId>ejb-remote-for-spring</artifactId>
<packaging>ejb</packaging>
<parent>
<groupId>com.baeldung.spring.ejb</groupId>
<artifactId>spring-ejb</artifactId>
<version>1.0.1</version>
</parent>
<dependencies>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>${assertj.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<profiles>
<!-- mvn clean package cargo:run -Pwildfly-standalone -->
<profile>
<id>wildfly-standalone</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<version>${cargo-maven2-plugin.version}</version>
<configuration>
<container>
<containerId>wildfly10x</containerId>
<zipUrlInstaller>
<url>http://download.jboss.org/wildfly/12.0.0.Final/wildfly-12.0.0.Final.zip</url>
</zipUrlInstaller>
</container>
<configuration>
<properties>
<cargo.hostname>127.0.0.1</cargo.hostname>
<cargo.jboss.configuration>standalone-full</cargo.jboss.configuration>
<cargo.jboss.management-http.port>9990</cargo.jboss.management-http.port>
<cargo.servlet.users>testUser:admin1234!</cargo.servlet.users>
</properties>
</configuration>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<properties>
<assertj.version>3.9.0</assertj.version>
<cargo-maven2-plugin.version>1.6.1</cargo-maven2-plugin.version>
</properties>
</project>

View File

@ -1,13 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
</pattern>
</encoder>
</appender>
<root level="INFO">
<appender-ref ref="STDOUT" />
</root>
</configuration>

View File

@ -4,7 +4,6 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.baeldung.spring.ejb</groupId>
<artifactId>spring-ejb</artifactId>
<version>1.0.1</version>
<packaging>pom</packaging>
<name>spring-ejb</name>
<description>Spring EJB Tutorial</description>
@ -36,8 +35,8 @@
<dependencies>
<dependency>
<groupId>com.baeldung.spring.ejb</groupId>
<artifactId>ejb-remote-for-spring</artifactId>
<version>${ejb-remote-for-spring.version}</version>
<artifactId>spring-ejb-remote</artifactId>
<version>${spring-ejb-remote.version}</version>
<type>ejb</type>
</dependency>
<dependency>
@ -71,13 +70,14 @@
</build>
<modules>
<module>ejb-remote-for-spring</module>
<module>spring-ejb-remote</module>
<module>ejb-beans</module>
<module>spring-ejb-client</module>
<module>wildfly</module>
</modules>
<properties>
<ejb-remote-for-spring.version>1.0.1</ejb-remote-for-spring.version>
<spring-ejb-remote.version>1.0.0-SNAPSHOT</spring-ejb-remote.version>
<javaee.version>8.0</javaee.version>
<wildfly-ejb.version>12.0.0.Final</wildfly-ejb.version>
<maven-ejb-plugin.version>2.4</maven-ejb-plugin.version>

View File

@ -12,7 +12,7 @@
<parent>
<groupId>com.baeldung.spring.ejb</groupId>
<artifactId>spring-ejb</artifactId>
<version>1.0.1</version>
<version>1.0.0-SNAPSHOT</version>
</parent>
<dependencyManagement>
@ -36,14 +36,12 @@
<dependency>
<groupId>org.wildfly</groupId>
<artifactId>wildfly-ejb-client-bom</artifactId>
<version>${wildfly-ejb.version}</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>com.baeldung.spring.ejb</groupId>
<artifactId>ejb-remote-for-spring</artifactId>
<version>${ejb-remote-for-spring.version}</version>
<artifactId>spring-ejb-remote</artifactId>
<type>ejb</type>
</dependency>
@ -70,9 +68,4 @@
</plugins>
</build>
<properties>
<ejb-remote-for-spring.version>1.0.1</ejb-remote-for-spring.version>
<wildfly-ejb.version>12.0.0.Final</wildfly-ejb.version>
</properties>
</project>

View File

@ -41,7 +41,7 @@ public class EJBClient {
// Since we haven't deployed the application as a .ear, the app name for
// us will be an empty string
final String appName = "";
final String moduleName = "remote";
final String moduleName = "spring-ejb-remote";
final String distinctName = "";
final String beanName = "HelloWorld";
final String viewClassName = HelloWorld.class.getName();

View File

@ -21,7 +21,7 @@ public class TextApplication {
private static TextProcessorRemote lookupTextProcessorBean(String namespace) throws NamingException {
Context ctx = createInitialContext();
final String appName = "";
final String moduleName = "EJBModule";
final String moduleName = "spring-ejb-remote";
final String distinctName = "";
final String beanName = TextProcessorBean.class.getSimpleName();
final String viewClassName = TextProcessorRemote.class.getName();

View File

@ -37,7 +37,7 @@ public class SpringEjbClientApplication {
@SuppressWarnings("rawtypes")
private String getFullName(Class classType) {
String moduleName = "ejb-remote-for-spring/";
String moduleName = "spring-ejb-remote/";
String beanName = classType.getSimpleName();
String viewClassName = classType.getName();

View File

@ -2,13 +2,13 @@
<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>
<artifactId>ejb-remote</artifactId>
<artifactId>spring-ejb-remote</artifactId>
<packaging>ejb</packaging>
<parent>
<groupId>com.baeldung.ejb</groupId>
<artifactId>ejb</artifactId>
<version>1.0-SNAPSHOT</version>
<groupId>com.baeldung.spring.ejb</groupId>
<artifactId>spring-ejb</artifactId>
<version>1.0.0-SNAPSHOT</version>
</parent>
<dependencies>
@ -17,14 +17,21 @@
<artifactId>javaee-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>${assertj.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<profiles>
<!-- mvn clean package cargo:run -->
<!-- mvn clean package cargo:run -Pwildfly-standalone -->
<profile>
<id>wildfly-standalone</id>
<activation>
<activeByDefault>true</activeByDefault>
<activeByDefault>false</activeByDefault>
</activation>
<build>
<plugins>
@ -38,13 +45,14 @@
<container>
<containerId>wildfly10x</containerId>
<zipUrlInstaller>
<url>http://download.jboss.org/wildfly/10.1.0.Final/wildfly-10.1.0.Final.zip</url>
<url>http://download.jboss.org/wildfly/12.0.0.Final/wildfly-12.0.0.Final.zip</url>
</zipUrlInstaller>
</container>
<configuration>
<properties>
<cargo.hostname>127.0.0.1</cargo.hostname>
<cargo.jboss.configuration>standalone-full</cargo.jboss.configuration>
<cargo.jboss.management-http.port>9990</cargo.jboss.management-http.port>
<cargo.servlet.users>testUser:admin1234!</cargo.servlet.users>
</properties>
@ -82,7 +90,7 @@
</profiles>
<properties>
<javaee-api.version>7.0</javaee-api.version>
<assertj.version>3.9.0</assertj.version>
<cargo-maven2-plugin.version>1.6.1</cargo-maven2-plugin.version>
<wildfly-maven-plugin.version>1.1.0.Alpha5</wildfly-maven-plugin.version>
</properties>

View File

@ -2,6 +2,6 @@
<ejb-jar 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/ejb-jar_3_2.xsd"
version="3.2">
<module-name>ejb-remote-for-spring</module-name>
<module-name>spring-ejb-remote</module-name>
</ejb-jar>

View File

@ -2,15 +2,15 @@
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>
<groupId>com.baeldung.wildfly</groupId>
<artifactId>wildfly</artifactId>
<artifactId>wildfly-example</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<name>wildfly</name>
<name>wildfly-example</name>
<parent>
<groupId>com.baeldung.ejb</groupId>
<artifactId>ejb</artifactId>
<version>1.0-SNAPSHOT</version>
<groupId>com.baeldung.spring.ejb</groupId>
<artifactId>spring-ejb</artifactId>
<version>1.0.0-SNAPSHOT</version>
</parent>
<modules>