You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicemix.apache.org by ff...@apache.org on 2010/01/29 11:12:32 UTC
svn commit: r904447 - in /servicemix/smx4/features/trunk: ./ assembly/
assembly/src/main/descriptors/ assembly/src/main/filtered-resources/
examples/ examples/jpa-osgi/ examples/jpa-osgi/client/
examples/jpa-osgi/client/src/ examples/jpa-osgi/client/sr...
Author: ffang
Date: Fri Jan 29 10:12:23 2010
New Revision: 904447
URL: http://svn.apache.org/viewvc?rev=904447&view=rev
Log:
[SMX4-472] add JPA/Hibernate example in SMX4
Added:
servicemix/smx4/features/trunk/examples/jpa-osgi/
servicemix/smx4/features/trunk/examples/jpa-osgi/README.txt (with props)
servicemix/smx4/features/trunk/examples/jpa-osgi/client/
servicemix/smx4/features/trunk/examples/jpa-osgi/client.html (with props)
servicemix/smx4/features/trunk/examples/jpa-osgi/client/pom.xml (with props)
servicemix/smx4/features/trunk/examples/jpa-osgi/client/src/
servicemix/smx4/features/trunk/examples/jpa-osgi/client/src/main/
servicemix/smx4/features/trunk/examples/jpa-osgi/client/src/main/java/
servicemix/smx4/features/trunk/examples/jpa-osgi/client/src/main/java/org/
servicemix/smx4/features/trunk/examples/jpa-osgi/client/src/main/java/org/apache/
servicemix/smx4/features/trunk/examples/jpa-osgi/client/src/main/java/org/apache/servicemix/
servicemix/smx4/features/trunk/examples/jpa-osgi/client/src/main/java/org/apache/servicemix/samples/
servicemix/smx4/features/trunk/examples/jpa-osgi/client/src/main/java/org/apache/servicemix/samples/wsdl_first/
servicemix/smx4/features/trunk/examples/jpa-osgi/client/src/main/java/org/apache/servicemix/samples/wsdl_first/Client.java (with props)
servicemix/smx4/features/trunk/examples/jpa-osgi/client/src/main/resources/
servicemix/smx4/features/trunk/examples/jpa-osgi/client/src/main/resources/org/
servicemix/smx4/features/trunk/examples/jpa-osgi/client/src/main/resources/org/apache/
servicemix/smx4/features/trunk/examples/jpa-osgi/client/src/main/resources/org/apache/servicemix/
servicemix/smx4/features/trunk/examples/jpa-osgi/client/src/main/resources/org/apache/servicemix/samples/
servicemix/smx4/features/trunk/examples/jpa-osgi/client/src/main/resources/org/apache/servicemix/samples/wsdl_first/
servicemix/smx4/features/trunk/examples/jpa-osgi/client/src/main/resources/org/apache/servicemix/samples/wsdl_first/request.xml (with props)
servicemix/smx4/features/trunk/examples/jpa-osgi/pom.xml (with props)
servicemix/smx4/features/trunk/examples/jpa-osgi/wsdl-first-cxfbc-bundle/
servicemix/smx4/features/trunk/examples/jpa-osgi/wsdl-first-cxfbc-bundle/pom.xml (with props)
servicemix/smx4/features/trunk/examples/jpa-osgi/wsdl-first-cxfbc-bundle/src/
servicemix/smx4/features/trunk/examples/jpa-osgi/wsdl-first-cxfbc-bundle/src/main/
servicemix/smx4/features/trunk/examples/jpa-osgi/wsdl-first-cxfbc-bundle/src/main/resources/
servicemix/smx4/features/trunk/examples/jpa-osgi/wsdl-first-cxfbc-bundle/src/main/resources/META-INF/
servicemix/smx4/features/trunk/examples/jpa-osgi/wsdl-first-cxfbc-bundle/src/main/resources/META-INF/spring/
servicemix/smx4/features/trunk/examples/jpa-osgi/wsdl-first-cxfbc-bundle/src/main/resources/META-INF/spring/beans.xml (with props)
servicemix/smx4/features/trunk/examples/jpa-osgi/wsdl-first-cxfbc-bundle/src/main/resources/person.wsdl (with props)
servicemix/smx4/features/trunk/examples/jpa-osgi/wsdl-first-cxfse-bundle/
servicemix/smx4/features/trunk/examples/jpa-osgi/wsdl-first-cxfse-bundle/pom.xml (with props)
servicemix/smx4/features/trunk/examples/jpa-osgi/wsdl-first-cxfse-bundle/src/
servicemix/smx4/features/trunk/examples/jpa-osgi/wsdl-first-cxfse-bundle/src/main/
servicemix/smx4/features/trunk/examples/jpa-osgi/wsdl-first-cxfse-bundle/src/main/java/
servicemix/smx4/features/trunk/examples/jpa-osgi/wsdl-first-cxfse-bundle/src/main/java/org/
servicemix/smx4/features/trunk/examples/jpa-osgi/wsdl-first-cxfse-bundle/src/main/java/org/apache/
servicemix/smx4/features/trunk/examples/jpa-osgi/wsdl-first-cxfse-bundle/src/main/java/org/apache/servicemix/
servicemix/smx4/features/trunk/examples/jpa-osgi/wsdl-first-cxfse-bundle/src/main/java/org/apache/servicemix/samples/
servicemix/smx4/features/trunk/examples/jpa-osgi/wsdl-first-cxfse-bundle/src/main/java/org/apache/servicemix/samples/wsdl_first/
servicemix/smx4/features/trunk/examples/jpa-osgi/wsdl-first-cxfse-bundle/src/main/java/org/apache/servicemix/samples/wsdl_first/PersonEntity.java
servicemix/smx4/features/trunk/examples/jpa-osgi/wsdl-first-cxfse-bundle/src/main/java/org/apache/servicemix/samples/wsdl_first/PersonImpl.java (with props)
servicemix/smx4/features/trunk/examples/jpa-osgi/wsdl-first-cxfse-bundle/src/main/resources/
servicemix/smx4/features/trunk/examples/jpa-osgi/wsdl-first-cxfse-bundle/src/main/resources/META-INF/
servicemix/smx4/features/trunk/examples/jpa-osgi/wsdl-first-cxfse-bundle/src/main/resources/META-INF/persistence.xml
servicemix/smx4/features/trunk/examples/jpa-osgi/wsdl-first-cxfse-bundle/src/main/resources/META-INF/spring/
servicemix/smx4/features/trunk/examples/jpa-osgi/wsdl-first-cxfse-bundle/src/main/resources/META-INF/spring/beans.xml (with props)
servicemix/smx4/features/trunk/examples/jpa-osgi/wsdl-first-cxfse-bundle/src/main/resources/person.wsdl (with props)
Modified:
servicemix/smx4/features/trunk/assembly/pom.xml
servicemix/smx4/features/trunk/assembly/src/main/descriptors/unix-bin.xml
servicemix/smx4/features/trunk/assembly/src/main/descriptors/windows-bin.xml
servicemix/smx4/features/trunk/assembly/src/main/filtered-resources/features.xml
servicemix/smx4/features/trunk/assembly/src/main/filtered-resources/pom.xml
servicemix/smx4/features/trunk/examples/pom.xml
servicemix/smx4/features/trunk/pom.xml
Modified: servicemix/smx4/features/trunk/assembly/pom.xml
URL: http://svn.apache.org/viewvc/servicemix/smx4/features/trunk/assembly/pom.xml?rev=904447&r1=904446&r2=904447&view=diff
==============================================================================
--- servicemix/smx4/features/trunk/assembly/pom.xml (original)
+++ servicemix/smx4/features/trunk/assembly/pom.xml Fri Jan 29 10:12:23 2010
@@ -79,6 +79,11 @@
<version>${servicemix.specs.version}</version>
</dependency>
<dependency>
+ <groupId>org.apache.servicemix.specs</groupId>
+ <artifactId>org.apache.servicemix.specs.java-persistence-api-1.1.1</artifactId>
+ <version>${servicemix.specs.version}</version>
+ </dependency>
+ <dependency>
<groupId>org.apache.geronimo.components</groupId>
<artifactId>geronimo-connector</artifactId>
<version>${geronimo.connector.version}</version>
@@ -150,12 +155,17 @@
<artifactId>org.apache.servicemix.bundles.jdt-core</artifactId>
<version>${jdt.core.version}</version>
</dependency>
- <dependency>
+ <dependency>
<groupId>org.apache.servicemix.bundles</groupId>
<artifactId>org.apache.servicemix.bundles.commons-codec</artifactId>
<version>${commons-codec.version}</version>
</dependency>
- <dependency>
+ <dependency>
+ <groupId>org.apache.servicemix.bundles</groupId>
+ <artifactId>org.apache.servicemix.bundles.commons-dbcp</artifactId>
+ <version>${commons-dbcp.version}</version>
+ </dependency>
+ <dependency>
<groupId>org.apache.servicemix.bundles</groupId>
<artifactId>org.apache.servicemix.bundles.commons-net</artifactId>
<version>${commons.net.version}</version>
@@ -587,6 +597,16 @@
<version>${spring.version}</version>
</dependency>
<dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-jdbc</artifactId>
+ <version>${spring.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-orm</artifactId>
+ <version>${spring.version}</version>
+ </dependency>
+ <dependency>
<groupId>org.ops4j.pax.web</groupId>
<artifactId>pax-web-api</artifactId>
<version>${pax.web.version}</version>
@@ -893,12 +913,66 @@
</exclusion>
</exclusions>
</dependency>
- <dependency>
+ <dependency>
<groupId>org.apache.servicemix.bundles</groupId>
<artifactId>org.apache.servicemix.bundles.jaxp-ri</artifactId>
<version>${jaxp.ri.version}</version>
</dependency>
-
+ <dependency>
+ <groupId>hsqldb</groupId>
+ <artifactId>hsqldb</artifactId>
+ <version>${hsqldb.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.servicemix.bundles</groupId>
+ <artifactId>org.apache.servicemix.bundles.dom4j</artifactId>
+ <version>${dom4j.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.antlr</groupId>
+ <artifactId>com.springsource.antlr</artifactId>
+ <version>${antlr.springsource.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jgroups</groupId>
+ <artifactId>com.springsource.org.jgroups</artifactId>
+ <version>${jgroups.springsource.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.objectweb.asm</groupId>
+ <artifactId>com.springsource.org.objectweb.asm</artifactId>
+ <version>${asm.springsource.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>net.sourceforge.cglib</groupId>
+ <artifactId>com.springsource.net.sf.cglib</artifactId>
+ <version>${cglib.springsource.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.javassist</groupId>
+ <artifactId>com.springsource.javassist</artifactId>
+ <version>${javassist.springsource.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>com.springsource.org.hibernate.annotations.common</artifactId>
+ <version>${hibernate.annotations.common.springsource.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>com.springsource.org.hibernate.annotations</artifactId>
+ <version>${hibernate.annotations.springsource.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>com.springsource.org.hibernate.ejb</artifactId>
+ <version>${hibernate.ejb.springsource.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>com.springsource.org.hibernate</artifactId>
+ <version>${hibernate.springsource.version}</version>
+ </dependency>
</dependencies>
<repositories>
<repository>
@@ -983,7 +1057,8 @@
<feature>web</feature>
<feature>cxf-nmr</feature>
<feature>cxf-osgi</feature>
- <feature>camel-activemq</feature>
+ <feature>camel-activemq</feature>
+ <feature>jpa-hibernate</feature>
<!-- ServiceMix components -->
<feature>servicemix-cxf-bc</feature>
<feature>servicemix-file</feature>
Modified: servicemix/smx4/features/trunk/assembly/src/main/descriptors/unix-bin.xml
URL: http://svn.apache.org/viewvc/servicemix/smx4/features/trunk/assembly/src/main/descriptors/unix-bin.xml?rev=904447&r1=904446&r2=904447&view=diff
==============================================================================
--- servicemix/smx4/features/trunk/assembly/src/main/descriptors/unix-bin.xml (original)
+++ servicemix/smx4/features/trunk/assembly/src/main/descriptors/unix-bin.xml Fri Jan 29 10:12:23 2010
@@ -251,7 +251,12 @@
<filtered>true</filtered>
<lineEnding>unix</lineEnding>
</file>
-
+ <file>
+ <source>${basedir}/../examples/jpa-osgi/README.txt</source>
+ <outputDirectory>/examples/jpa-osgi</outputDirectory>
+ <filtered>true</filtered>
+ <lineEnding>unix</lineEnding>
+ </file>
<file>
<source>${basedir}/../examples/cxf-camel-nmr/README.txt</source>
<outputDirectory>/examples/cxf-camel-nmr</outputDirectory>
@@ -360,6 +365,15 @@
<include>org.apache.servicemix.specs:org.apache.servicemix.specs.stax-api-1.0</include>
</includes>
</dependencySet>
+ <dependencySet>
+ <outputDirectory>/system</outputDirectory>
+ <unpack>false</unpack>
+ <useProjectArtifact>false</useProjectArtifact>
+ <outputFileNameMapping>hsqldb/${artifact.artifactId}/${artifact.baseVersion}/${artifact.artifactId}-${artifact.baseVersion}${dashClassifier?}.${artifact.extension}</outputFileNameMapping>
+ <includes>
+ <include>hsqldb:hsqldb</include>
+ </includes>
+ </dependencySet>
</dependencySets>
Modified: servicemix/smx4/features/trunk/assembly/src/main/descriptors/windows-bin.xml
URL: http://svn.apache.org/viewvc/servicemix/smx4/features/trunk/assembly/src/main/descriptors/windows-bin.xml?rev=904447&r1=904446&r2=904447&view=diff
==============================================================================
--- servicemix/smx4/features/trunk/assembly/src/main/descriptors/windows-bin.xml (original)
+++ servicemix/smx4/features/trunk/assembly/src/main/descriptors/windows-bin.xml Fri Jan 29 10:12:23 2010
@@ -239,7 +239,12 @@
<filtered>true</filtered>
<lineEnding>dos</lineEnding>
</file>
-
+ <file>
+ <source>${basedir}/../examples/jpa-osgi/README.txt</source>
+ <outputDirectory>/examples/jpa-osgi</outputDirectory>
+ <filtered>true</filtered>
+ <lineEnding>dos</lineEnding>
+ </file>
<file>
<source>${basedir}/../examples/cxf-camel-nmr/README.txt</source>
<outputDirectory>/examples/cxf-camel-nmr</outputDirectory>
@@ -349,7 +354,15 @@
<include>org.apache.servicemix.specs:org.apache.servicemix.specs.stax-api-1.0</include>
</includes>
</dependencySet>
-
+ <dependencySet>
+ <outputDirectory>/system</outputDirectory>
+ <unpack>false</unpack>
+ <useProjectArtifact>false</useProjectArtifact>
+ <outputFileNameMapping>hsqldb/${artifact.artifactId}/${artifact.baseVersion}/${artifact.artifactId}-${artifact.baseVersion}${dashClassifier?}.${artifact.extension}</outputFileNameMapping>
+ <includes>
+ <include>hsqldb:hsqldb</include>
+ </includes>
+ </dependencySet>
</dependencySets>
</assembly>
Modified: servicemix/smx4/features/trunk/assembly/src/main/filtered-resources/features.xml
URL: http://svn.apache.org/viewvc/servicemix/smx4/features/trunk/assembly/src/main/filtered-resources/features.xml?rev=904447&r1=904446&r2=904447&view=diff
==============================================================================
--- servicemix/smx4/features/trunk/assembly/src/main/filtered-resources/features.xml (original)
+++ servicemix/smx4/features/trunk/assembly/src/main/filtered-resources/features.xml Fri Jan 29 10:12:23 2010
@@ -160,6 +160,29 @@
<feature>cxf-osgi</feature>
<bundle>mvn:org.apache.servicemix.examples/cxf-ws-security-osgi/${version}</bundle>
</feature>
+ <feature name="jpa-hibernate" version="${version}">
+ <bundle>mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.java-persistence-api-1.1.1/${servicemix.specs.version}</bundle>
+ <bundle>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.commons-dbcp/${commons-dbcp.version}</bundle>
+ <bundle>mvn:org.springframework/spring-jdbc/${spring.version}</bundle>
+ <bundle>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.dom4j/${dom4j.version}</bundle>
+ <bundle>mvn:org.antlr/com.springsource.antlr/${antlr.springsource.version}</bundle>
+ <bundle>mvn:org.jgroups/com.springsource.org.jgroups/${jgroups.springsource.version}</bundle>
+ <bundle>mvn:org.objectweb.asm/com.springsource.org.objectweb.asm/${asm.springsource.version}</bundle>
+ <bundle>mvn:net.sourceforge.cglib/com.springsource.net.sf.cglib/${cglib.springsource.version}</bundle>
+ <bundle>mvn:org.jboss.javassist/com.springsource.javassist/${javassist.springsource.version}</bundle>
+ <bundle>mvn:org.hibernate/com.springsource.org.hibernate.annotations.common/${hibernate.annotations.common.springsource.version}</bundle>
+ <bundle>mvn:org.hibernate/com.springsource.org.hibernate.annotations/${hibernate.annotations.springsource.version}</bundle>
+ <bundle>mvn:org.hibernate/com.springsource.org.hibernate.ejb/${hibernate.ejb.springsource.version}</bundle>
+ <bundle>mvn:org.hibernate/com.springsource.org.hibernate/${hibernate.springsource.version}</bundle>
+ <bundle>mvn:org.springframework/spring-orm/${spring.version}</bundle>
+ </feature>
+ <feature name="examples-jpa-osgi" version="${version}">
+ <feature version="${version}">jpa-hibernate</feature>
+ <bundle>wrap:mvn:hsqldb/hsqldb/${hsqldb.version}</bundle>
+ <bundle>mvn:org.apache.servicemix.examples.jpa-osgi/wsdl-first-cxfbc-bundle/${version}</bundle>
+ <bundle>mvn:org.apache.servicemix.examples.jpa-osgi/wsdl-first-cxfse-bundle/${version}</bundle>
+ </feature>
+
<!--
-
- JBI Components
Modified: servicemix/smx4/features/trunk/assembly/src/main/filtered-resources/pom.xml
URL: http://svn.apache.org/viewvc/servicemix/smx4/features/trunk/assembly/src/main/filtered-resources/pom.xml?rev=904447&r1=904446&r2=904447&view=diff
==============================================================================
--- servicemix/smx4/features/trunk/assembly/src/main/filtered-resources/pom.xml (original)
+++ servicemix/smx4/features/trunk/assembly/src/main/filtered-resources/pom.xml Fri Jan 29 10:12:23 2010
@@ -46,6 +46,7 @@
<module>cxf-jaxrs</module>
<module>cxf-wsdl-first-osgi-package</module>
<module>cxf-ws-security-osgi</module>
+ <module>jpa-osgi</module>
</modules>
</project>
Added: servicemix/smx4/features/trunk/examples/jpa-osgi/README.txt
URL: http://svn.apache.org/viewvc/servicemix/smx4/features/trunk/examples/jpa-osgi/README.txt?rev=904447&view=auto
==============================================================================
--- servicemix/smx4/features/trunk/examples/jpa-osgi/README.txt (added)
+++ servicemix/smx4/features/trunk/examples/jpa-osgi/README.txt Fri Jan 29 10:12:23 2010
@@ -0,0 +1,314 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+JPA OSGi Bundles Example
+===============================
+
+Purpose
+-------
+Demostrate how to use JPA/hibernate with SMX4.
+
+This example is based on cxf-wsdl-first-osgi-package example, and
+in cxf se endpoint bundle, use JPA hibernate implementation to persist
+and retrieve PersonEntity.
+
+
+Explanation
+-----------
+The CXF service engine and CXF binding component are used to expose the
+web service. Each one is packaged in as an OSGi bundle, as follows:
+
+1. CXF service engine (see the wsdl-first-cxfse-bundle directory):
+
+ - Contains a copy of the service WSDL file, person.wsdl, in the
+ src/main/resources directory.
+
+ - The service implementation file, PersonImpl.java, in the
+ src/main/java/org/apache/servicemix/samples/wsdl_first directory.
+ It contains JAX-WS annotations that specify which web service
+ it implements:
+
+ @WebService(serviceName = "PersonService",
+ targetNamespace = "http://servicemix.apache.org/samples/wsdl-first",
+ endpointInterface = "org.apache.servicemix.samples.wsdl_first.Person")
+
+ In the constructor of PersonImpl, use JPA to persist two PersonEntity with
+ injected EntityManagerFactory.
+ And in the getPerson method, also use JPA to query PersonEntity with personId
+ from database.
+
+ - A configuration file, beans.xml, located in the src/main/resources/
+ META-INF/spring directory, which configures the CXF endpoint:
+
+ <cxfse:endpoint>
+ <cxfse:pojo>
+ <bean class="org.apache.servicemix.samples.wsdl_first.PersonImpl">
+ <constructor-arg>
+ <ref bean="entityManagerFactory"/>
+ </constructor-arg>
+ </bean>
+ </cxfse:pojo>
+ </cxfse:endpoint>
+ <bean class="org.apache.servicemix.common.osgi.EndpointExporter" />
+ also configure JPA entityManagerFacotry in this file
+ <bean id="transactionTemplate" class="org.springframework.transaction.support.TransactionTemplate">
+ <property name="transactionManager">
+ <bean class="org.springframework.orm.jpa.JpaTransactionManager">
+ <property name="entityManagerFactory" ref="entityManagerFactory"/>
+ </bean>
+ </property>
+ </bean>
+
+ <bean id="jpaTemplate" class="org.springframework.orm.jpa.JpaTemplate">
+ <property name="entityManagerFactory" ref="entityManagerFactory"/>
+ </bean>
+
+ <bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
+ <property name="persistenceUnitName" value="smx4"/>
+ <property name="jpaVendorAdapter" ref="jpaAdapter"/>
+ <property name="dataSource" ref="dataSource" />
+ </bean>
+
+ <bean id="jpaAdapter"
+ class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
+ <property name="databasePlatform" value="org.hibernate.dialect.HSQLDialect" />
+ </bean>
+
+ <!-- DataSource Definition -->
+ <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
+ <property name="driverClassName" value="org.hsqldb.jdbcDriver" />
+ <property name="url" value="jdbc:hsqldb:mem:smx4_jpa" />
+ <property name="username" value="sa" />
+ <property name="password" value="" />
+ </bean>
+
+ And there's a JPA required persistence.xml in src/main/resources/META-INF/ folder
+ <persistence xmlns="http://java.sun.com/xml/ns/persistence"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0">
+
+ <persistence-unit name="smx4" transaction-type="RESOURCE_LOCAL">
+ <class>org.apache.servicemix.samples.wsdl_first.PersonEntity</class>
+
+ <!-- Hibernate -->
+ <properties>
+ <property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>
+ <property name="hibernate.hbm2ddl.auto" value="create"/>
+ </properties>
+
+ </persistence-unit>
+ </persistence>
+
+2. CXF binding component (see the wsdl-first-cxfbc-bundle directory):
+
+ - Contains a copy of the service WSDL file, person.wsdl, in the
+ src/main/resources directory.
+
+ - A configuration file, beans.xml, located in the src/main/resources/
+ META-INF/spring directory, which specifies a CXF consumer that will
+ accept incoming calls for that web service and pass them to the NMR:
+
+ <cxfbc:consumer wsdl="classpath:person.wsdl"
+ targetService="person:PersonService"
+ targetInterface="person:Person"/>
+
+ <bean class="org.apache.servicemix.common.osgi.EndpointExporter" />
+
+
+Prerequisites for Running the Example
+-------------------------------------
+1. You must have the following installed on your machine:
+
+ - JDK 1.5 or higher
+
+ - Maven 2.0.9 or higher
+
+ For more information, see the README in the top-level examples
+ directory.
+
+2. Start ServiceMix by running the following command:
+
+ <servicemix_home>/bin/servicemix (on UNIX)
+ <servicemix_home>\bin\servicemix (on Windows)
+
+
+Building and Running the Example
+--------------------------------
+To build and run the example, complete the following steps:
+
+1. Build the example by opening a command prompt, changing directory
+ to examples/jpa-osgi (this example) and entering
+ the following Maven command:
+
+ mvn install
+
+ If all of the required OSGi bundles are available in your local
+ Maven repository, the example will build very quickly. Otherwise
+ it may take some time for Maven to download everything it needs.
+
+ The mvn install command builds the example deployment bundle and
+ copies it to your local Maven repository and to the target directory
+ of this example.
+
+2. Install the example by entering the following command in
+ the ServiceMix console:
+
+ features:install examples-jpa-osgi
+
+ It makes use of the ServiceMix features facility. For more
+ information about the features facility, see the README.txt file
+ in the examples parent directory.
+ The examples-jpa-osgi example mainly include jpa-hibernate feature,
+ which include necessary bundles to use JPA/hibernate in SMX4.
+
+You can browse the WSDL at:
+
+ http://localhost:8092/PersonService?wsdl
+
+Note, if you use Safari, right click the window and select
+'Show Source'.
+
+
+Running a Client
+----------------
+To run the web client:
+
+1. Open the client.html, which is located in the same directory as
+ this README file, in your favorite browser.
+
+2. Click the Send button to send a request.
+
+ Once the request has been successfully sent, a response similar
+ to the following should appear in the right-hand panel of the
+ web page:
+
+ STATUS: 200
+ <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
+ <soap:Body><GetPersonResponse xmlns="http://servicemix.apache.org/
+ samples/wsdl-first/types"><personId>ffang</personId>
+ <ssn>000-000-0000</ssn><name>Freeman Fang</name></GetPersonResponse>
+ </soap:Body>
+ </soap:Envelope>
+
+ As in the database we only save two pre-stored PersonEntity with personId ffang and gnodet,
+ so if change personId in the web to others, users will get fault response like
+ STATUS: 500
+ <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
+ <soap:Body><soap:Fault><faultcode>soap:Server</faultcode><faultstring>No entity found for query</faultstring><detail><fault>No entity found for query</fault></detail></soap:Fault>
+ </soap:Body>
+ </soap:Envelope>
+
+To run the java code client:
+
+1. Change to the <servicemix_home>/examples/jpa-osgi/
+ client directory.
+
+2. Run the following command:
+
+ mvn compile exec:java
+
+ If the client request is successful, a response similar to the
+ following should appear in the ServiceMix console:
+
+ <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
+ <soap:Body><GetPersonResponse xmlns="http://servicemix.apache.org/
+ samples/wsdl-first/types"><personId>ffang</personId>
+ <ssn>000-000-0000</ssn><name>Freeman Fang</name></GetPersonResponse>
+ </soap:Body>
+ </soap:Envelope>
+
+
+Stopping and Uninstalling the Example
+-------------------------------------
+To stop the example, you must first know the bundle ID that ServiceMix
+has assigned to it. To get the bundle ID, enter the following command
+in the ServiceMix console:
+
+ osgi:list
+
+At the end of the listing, you should see an entry similar to the
+following:
+
+ [180] [Active ] [ ] [ 60] ServiceMix :: Samples :: JPA OSGI :: CXF BC BUNDLE (4.2.0)
+ [181] [Active ] [ ] [ 60] ServiceMix :: Samples :: JPA OSGI :: CXF SE BUNDLE (4.2.0)
+
+
+In this case, the bundle IDs are 180 and 181.
+
+To stop the example, enter the following command in the ServiceMix
+console:
+
+ osgi:stop <bundle_id>
+
+For example:
+
+ osgi:stop 180
+ osgi:stop 181
+
+To uninstall the example, enter one of the following commands in
+the ServiceMix console:
+
+ features:uninstall examples-jpa-osgi
+
+or
+
+ osgi:uninstall <bundle_id>
+
+
+Viewing the Log Entries
+-----------------------
+You can view the entries in the log file in the data/log
+directory of your ServiceMix installation, or by typing
+the following command in the ServiceMix console:
+
+ log:display
+
+
+Changing the Example
+--------------------
+If you want to change the code or configuration, just use 'mvn install'
+to rebuild the OSGi bundles and deploy as before.
+
+
+More Information
+----------------
+For more information, see:
+
+ http://cwiki.apache.org/SMX4/creating-an-osgi-bundle-for-deploying-jbi-endpoints.html
+
+Notes:
+1. As some springsource hibernate bundles are fragment, which is not supported by felix, so
+must use equinox as underlying framework. Users can edit $SMX_HOME/etc/config.properties to
+specify the framework if the distribution kit not use equinox as default one.
+
+2. Users can see some exception from karaf.log like
+15:00:58,805 | WARN | xtenderThread-62 | InputStreamZippedJarVisitor | ging.InputStreamZippedJarVisitor 41 | Unable to find file (ignored): bundleresource://188.fwk5604828/
+java.lang.NullPointerException: in is null
+ at java.util.zip.ZipInputStream.<init>(ZipInputStream.java:55)
+ at java.util.jar.JarInputStream.<init>(JarInputStream.java:57)
+ at java.util.jar.JarInputStream.<init>(JarInputStream.java:43)
+ at org.hibernate.ejb.packaging.InputStreamZippedJarVisitor.doProcessElements(InputStreamZippedJarVisitor.java:37)
+ at org.hibernate.ejb.packaging.AbstractJarVisitor.getMatchingEntries(AbstractJarVisitor.java:139)
+ at org.hibernate.ejb.Ejb3Configuration.addScannedEntries(Ejb3Configuration.java:287)
+ at org.hibernate.ejb.Ejb3Configuration.scanForClasses(Ejb3Configuration.java:614)
+ at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:360)
+ at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:131)
+ at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:224)
+ at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:291)
+
+This is known hibernate issue tracked by [1], it's something about hibernate trying to retrieve Entity class inside bundle with jar entry vistor but hit invalid resource path(bundle root path on equinox which is not a real resource path in this case), the exception is a little bit noisy but totally harmless.
+
+[1]http://opensource.atlassian.com/projects/hibernate/browse/HHH-4194
Propchange: servicemix/smx4/features/trunk/examples/jpa-osgi/README.txt
------------------------------------------------------------------------------
svn:executable = *
Added: servicemix/smx4/features/trunk/examples/jpa-osgi/client.html
URL: http://svn.apache.org/viewvc/servicemix/smx4/features/trunk/examples/jpa-osgi/client.html?rev=904447&view=auto
==============================================================================
--- servicemix/smx4/features/trunk/examples/jpa-osgi/client.html (added)
+++ servicemix/smx4/features/trunk/examples/jpa-osgi/client.html Fri Jan 29 10:12:23 2010
@@ -0,0 +1,135 @@
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+<!-- $Rev: 783247 $ $Date: 2009-06-10 16:08:08 +0800 (ä¸, 10 6 2009) $ -->
+<html>
+<head>
+<title>ServiceMix JPA-OSGI Example</title>
+<script type="text/javascript">
+var urlToOpen = "http://localhost:8092/PersonService/"; //default URL to open
+
+function getHTTPObject() {
+ var xmlhttp = false;
+
+ /* Compilation conditionnelle d'IE */
+ /*@cc_on
+ @if (@_jscript_version >= 5)
+ try {
+ xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
+ } catch (e) {
+ try {
+ xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
+ } catch (E) {
+ xmlhttp = false;
+ }
+ }
+ @else
+ xmlhttp = false;
+ @end @*/
+
+ /* on essaie de créer l'objet si ce n'est pas déjà fait */
+ if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
+ try {
+ xmlhttp = new XMLHttpRequest();
+ } catch (e) {
+ xmlhttp = false;
+ }
+ }
+
+ if (xmlhttp) {
+ /* on définit ce qui doit se passer quand la page répondra */
+ xmlhttp.onreadystatechange=function() {
+ if (xmlhttp.readyState == 4) { /* 4 : état "complete" */
+ var response = document.getElementById("response");
+ var responseStatus = "";
+ try {
+ responseStatus = xmlhttp.status + "";
+ } catch (e) {
+ responseStatus = "ERROR WHILE RETRIEVING STATUS; MAYBE UNABLE TO CONNECT.";
+ }
+ response.value = "STATUS: " + responseStatus + "\n" + xmlhttp.responseText;
+ }
+ }
+ }
+ return xmlhttp;
+}
+
+function send() {
+ if ((document.getElementById("urlToOpen").value != urlToOpen) && (document.getElementById("urlToOpen").value != "")) {
+ //use user entry only if it at least can be okay
+ urlToOpen = document.getElementById("urlToOpen").value;
+ }
+ var xmlhttp = getHTTPObject();
+ if (!xmlhttp) {
+ alert('cound not create XMLHttpRequest object');
+ return;
+ }
+ var request = document.getElementById("request");
+ var response = document.getElementById("response");
+ try {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead UniversalBrowserWrite");
+ } catch (e) {
+ }
+ try {
+ xmlhttp.open("POST", urlToOpen, true);
+ } catch (e) {
+ alert('error opening');
+ }
+ xmlhttp.send(request.value);
+}
+
+</script>
+</head>
+
+<body>
+
+<h1>ServiceMix JPA-OSGI Example</h1>
+
+<p>Welcome to the JPA-OSGI example for ServiceMix</p>
+
+<p>Perform a POST into the HTTP binding. This requires JavaScript.</p>
+<p>Target: <input type="text" size="50" id="urlToOpen" value=""><script type="text/javascript">document.getElementById("urlToOpen").value = urlToOpen;</script>.</p>
+
+<table>
+ <tr>
+ <td>
+ <textarea id="request" style="width:600px;height:400px" onKeyUp="send();"><?xml version="1.0" encoding="UTF-8"?>
+<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
+ xmlns:tns="http://servicemix.apache.org/samples/wsdl-first/types">
+ <env:Body>
+ <tns:GetPerson>
+ <tns:personId>ffang</tns:personId>
+ </tns:GetPerson>
+ </env:Body>
+</env:Envelope>
+
+ </textarea>
+ </td>
+ <td>
+ <textarea id="response" style="width:600px;height:400px">
+ </textarea>
+ </td>
+ </tr>
+ <tr>
+ <td colspan=2>
+ <input type="button" value="Send" onClick="send();"/>
+ </td>
+ </tr>
+</table>
+</body>
+</html>
Propchange: servicemix/smx4/features/trunk/examples/jpa-osgi/client.html
------------------------------------------------------------------------------
svn:executable = *
Added: servicemix/smx4/features/trunk/examples/jpa-osgi/client/pom.xml
URL: http://svn.apache.org/viewvc/servicemix/smx4/features/trunk/examples/jpa-osgi/client/pom.xml?rev=904447&view=auto
==============================================================================
--- servicemix/smx4/features/trunk/examples/jpa-osgi/client/pom.xml (added)
+++ servicemix/smx4/features/trunk/examples/jpa-osgi/client/pom.xml Fri Jan 29 10:12:23 2010
@@ -0,0 +1,61 @@
+<?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/maven-v4_0_0.xsd">
+
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.servicemix.examples</groupId>
+ <artifactId>jpa-osgi</artifactId>
+ <version>4.1.0-SNAPSHOT</version>
+ </parent>
+
+ <groupId>org.apache.servicemix.examples.jpa-osgi</groupId>
+ <artifactId>wsdl-first-client</artifactId>
+ <name>ServiceMix :: Samples :: WSDL first :: Client</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.servicemix</groupId>
+ <artifactId>servicemix-utils</artifactId>
+ <version>${servicemix-utils.version}</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>exec-maven-plugin</artifactId>
+ <configuration>
+ <mainClass>org.apache.servicemix.samples.wsdl_first.Client</mainClass>
+ <includePluginDependencies>false</includePluginDependencies>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Propchange: servicemix/smx4/features/trunk/examples/jpa-osgi/client/pom.xml
------------------------------------------------------------------------------
svn:executable = *
Added: servicemix/smx4/features/trunk/examples/jpa-osgi/client/src/main/java/org/apache/servicemix/samples/wsdl_first/Client.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/features/trunk/examples/jpa-osgi/client/src/main/java/org/apache/servicemix/samples/wsdl_first/Client.java?rev=904447&view=auto
==============================================================================
--- servicemix/smx4/features/trunk/examples/jpa-osgi/client/src/main/java/org/apache/servicemix/samples/wsdl_first/Client.java (added)
+++ servicemix/smx4/features/trunk/examples/jpa-osgi/client/src/main/java/org/apache/servicemix/samples/wsdl_first/Client.java Fri Jan 29 10:12:23 2010
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicemix.samples.wsdl_first;
+
+import java.io.ByteArrayOutputStream;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.URL;
+import java.net.URLConnection;
+
+import org.apache.servicemix.util.FileUtil;
+
+public class Client{
+ public static void main(String[] args) {
+ try {
+ new Client().sendRequest();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ public void sendRequest() throws Exception {
+ URLConnection connection = new URL("http://localhost:8092/PersonService/")
+ .openConnection();
+ connection.setDoInput(true);
+ connection.setDoOutput(true);
+ OutputStream os = connection.getOutputStream();
+ // Post the request file.
+ InputStream fis = getClass().getClassLoader().getResourceAsStream("org/apache/servicemix/samples/wsdl_first/request.xml");
+ FileUtil.copyInputStream(fis, os);
+ // Read the response.
+ InputStream is = connection.getInputStream();
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ FileUtil.copyInputStream(is, baos);
+ System.out.println("the response is =====>");
+ System.out.println(baos.toString());
+ }
+
+}
Propchange: servicemix/smx4/features/trunk/examples/jpa-osgi/client/src/main/java/org/apache/servicemix/samples/wsdl_first/Client.java
------------------------------------------------------------------------------
svn:executable = *
Added: servicemix/smx4/features/trunk/examples/jpa-osgi/client/src/main/resources/org/apache/servicemix/samples/wsdl_first/request.xml
URL: http://svn.apache.org/viewvc/servicemix/smx4/features/trunk/examples/jpa-osgi/client/src/main/resources/org/apache/servicemix/samples/wsdl_first/request.xml?rev=904447&view=auto
==============================================================================
--- servicemix/smx4/features/trunk/examples/jpa-osgi/client/src/main/resources/org/apache/servicemix/samples/wsdl_first/request.xml (added)
+++ servicemix/smx4/features/trunk/examples/jpa-osgi/client/src/main/resources/org/apache/servicemix/samples/wsdl_first/request.xml Fri Jan 29 10:12:23 2010
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
+ xmlns:tns="http://servicemix.apache.org/samples/wsdl-first/types">
+ <env:Body>
+ <tns:GetPerson>
+ <tns:personId>ffang</tns:personId>
+ </tns:GetPerson>
+ </env:Body>
+</env:Envelope>
Propchange: servicemix/smx4/features/trunk/examples/jpa-osgi/client/src/main/resources/org/apache/servicemix/samples/wsdl_first/request.xml
------------------------------------------------------------------------------
svn:executable = *
Added: servicemix/smx4/features/trunk/examples/jpa-osgi/pom.xml
URL: http://svn.apache.org/viewvc/servicemix/smx4/features/trunk/examples/jpa-osgi/pom.xml?rev=904447&view=auto
==============================================================================
--- servicemix/smx4/features/trunk/examples/jpa-osgi/pom.xml (added)
+++ servicemix/smx4/features/trunk/examples/jpa-osgi/pom.xml Fri Jan 29 10:12:23 2010
@@ -0,0 +1,90 @@
+<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">
+
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.servicemix.examples</groupId>
+ <artifactId>examples</artifactId>
+ <version>4.1.0-SNAPSHOT</version>
+ </parent>
+
+ <groupId>org.apache.servicemix.examples</groupId>
+ <artifactId>jpa-osgi</artifactId>
+ <name>ServiceMix :: Samples :: JPA Osgi</name>
+ <packaging>pom</packaging>
+
+ <!-- Add ServiceMix repositories for snaphots and releases -->
+ <pluginRepositories>
+ <pluginRepository>
+ <id>apache.snapshots</id>
+ <name>Apache Snapshots Repository</name>
+ <url>http://repository.apache.org/content/groups/snapshots-group</url>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ </pluginRepository>
+ <pluginRepository>
+ <id>apache.incubating</id>
+ <name>Apache Incubating Repository</name>
+ <url>http://people.apache.org/repo/m2-incubating-repository</url>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ </pluginRepository>
+ </pluginRepositories>
+ <repositories>
+ <repository>
+ <id>apache.snapshots</id>
+ <name>Apache Snapshots Repository</name>
+ <url>http://repository.apache.org/content/groups/snapshots-group</url>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ </repository>
+ <repository>
+ <id>apache.incubating</id>
+ <name>Apache Incubating Repository</name>
+ <url>http://people.apache.org/repo/m2-incubating-repository</url>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ </repository>
+ </repositories>
+
+ <modules>
+ <module>wsdl-first-cxfse-bundle</module>
+ <module>wsdl-first-cxfbc-bundle</module>
+ <module>client</module>
+ </modules>
+
+</project>
Propchange: servicemix/smx4/features/trunk/examples/jpa-osgi/pom.xml
------------------------------------------------------------------------------
svn:executable = *
Added: servicemix/smx4/features/trunk/examples/jpa-osgi/wsdl-first-cxfbc-bundle/pom.xml
URL: http://svn.apache.org/viewvc/servicemix/smx4/features/trunk/examples/jpa-osgi/wsdl-first-cxfbc-bundle/pom.xml?rev=904447&view=auto
==============================================================================
--- servicemix/smx4/features/trunk/examples/jpa-osgi/wsdl-first-cxfbc-bundle/pom.xml (added)
+++ servicemix/smx4/features/trunk/examples/jpa-osgi/wsdl-first-cxfbc-bundle/pom.xml Fri Jan 29 10:12:23 2010
@@ -0,0 +1,81 @@
+<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">
+
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.servicemix.examples</groupId>
+ <artifactId>jpa-osgi</artifactId>
+ <version>4.1.0-SNAPSHOT</version>
+ </parent>
+
+ <groupId>org.apache.servicemix.examples.jpa-osgi</groupId>
+ <artifactId>wsdl-first-cxfbc-bundle</artifactId>
+ <packaging>bundle</packaging>
+ <name>ServiceMix :: Samples :: JPA OSGI :: CXF BC BUNDLE</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-rt-frontend-jaxws</artifactId>
+ <version>${cxf.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-ws-metadata_2.0_spec</artifactId>
+ <version>${geronimo.wsmetadata.version}</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <configuration>
+ <instructions>
+ <Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName>
+ <Import-Package>
+ javax.jws,
+ javax.wsdl,
+ javax.xml.bind,
+ javax.xml.bind.annotation,
+ javax.xml.namespace,
+ javax.xml.soap,
+ javax.xml.ws,
+ META-INF.cxf,
+ org.apache.cxf.bus,
+ org.apache.cxf.bus.spring,
+ org.apache.cxf.bus.resource,
+ org.apache.cxf.configuration.spring,
+ org.apache.cxf.resource,
+ org.apache.servicemix.cxfbc,
+ org.springframework.beans.factory.config,
+ org.apache.servicemix.common.osgi
+ </Import-Package>
+ <Require-Bundle>org.apache.cxf.bundle</Require-Bundle>
+ </instructions>
+ </configuration>
+ </plugin>
+
+ </plugins>
+ </build>
+</project>
Propchange: servicemix/smx4/features/trunk/examples/jpa-osgi/wsdl-first-cxfbc-bundle/pom.xml
------------------------------------------------------------------------------
svn:executable = *
Added: servicemix/smx4/features/trunk/examples/jpa-osgi/wsdl-first-cxfbc-bundle/src/main/resources/META-INF/spring/beans.xml
URL: http://svn.apache.org/viewvc/servicemix/smx4/features/trunk/examples/jpa-osgi/wsdl-first-cxfbc-bundle/src/main/resources/META-INF/spring/beans.xml?rev=904447&view=auto
==============================================================================
--- servicemix/smx4/features/trunk/examples/jpa-osgi/wsdl-first-cxfbc-bundle/src/main/resources/META-INF/spring/beans.xml (added)
+++ servicemix/smx4/features/trunk/examples/jpa-osgi/wsdl-first-cxfbc-bundle/src/main/resources/META-INF/spring/beans.xml Fri Jan 29 10:12:23 2010
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:cxfbc="http://servicemix.apache.org/cxfbc/1.0"
+ xmlns:person="http://servicemix.apache.org/samples/wsdl-first"
+ xsi:schemaLocation="
+ http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+ http://servicemix.apache.org/cxfbc/1.0 http://servicemix.apache.org/cxfbc/1.0/servicemix-cxf-bc.xsd">
+
+ <cxfbc:consumer wsdl="classpath:person.wsdl"
+ targetService="person:PersonService"
+ targetInterface="person:Person"/>
+ <bean class="org.apache.servicemix.common.osgi.EndpointExporter" />
+
+</beans>
Propchange: servicemix/smx4/features/trunk/examples/jpa-osgi/wsdl-first-cxfbc-bundle/src/main/resources/META-INF/spring/beans.xml
------------------------------------------------------------------------------
svn:executable = *
Added: servicemix/smx4/features/trunk/examples/jpa-osgi/wsdl-first-cxfbc-bundle/src/main/resources/person.wsdl
URL: http://svn.apache.org/viewvc/servicemix/smx4/features/trunk/examples/jpa-osgi/wsdl-first-cxfbc-bundle/src/main/resources/person.wsdl?rev=904447&view=auto
==============================================================================
--- servicemix/smx4/features/trunk/examples/jpa-osgi/wsdl-first-cxfbc-bundle/src/main/resources/person.wsdl (added)
+++ servicemix/smx4/features/trunk/examples/jpa-osgi/wsdl-first-cxfbc-bundle/src/main/resources/person.wsdl Fri Jan 29 10:12:23 2010
@@ -0,0 +1,98 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+<!-- $Rev: 783247 $ $Date: 2009-06-10 16:08:08 +0800 (ä¸, 10 6 2009) $ -->
+<wsdl:definitions name="wsdl-first"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:tns="http://servicemix.apache.org/samples/wsdl-first"
+ xmlns:typens="http://servicemix.apache.org/samples/wsdl-first/types"
+ targetNamespace="http://servicemix.apache.org/samples/wsdl-first">
+
+ <wsdl:types>
+ <xsd:schema targetNamespace="http://servicemix.apache.org/samples/wsdl-first/types"
+ elementFormDefault="qualified">
+ <xsd:element name="GetPerson">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="personId" type="xsd:string"/>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="GetPersonResponse">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="personId" type="xsd:string"/>
+ <xsd:element name="ssn" type="xsd:string"/>
+ <xsd:element name="name" type="xsd:string"/>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="UnknownPersonFault">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="personId" type="xsd:string"/>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ </wsdl:types>
+
+ <wsdl:message name="GetPersonRequest">
+ <wsdl:part name="payload" element="typens:GetPerson"/>
+ </wsdl:message>
+ <wsdl:message name="GetPersonResponse">
+ <wsdl:part name="payload" element="typens:GetPersonResponse"/>
+ </wsdl:message>
+ <wsdl:message name="UnknownPersonFault">
+ <wsdl:part name="payload" element="typens:UnknownPersonFault"/>
+ </wsdl:message>
+
+ <wsdl:portType name="Person">
+ <wsdl:operation name="GetPerson">
+ <wsdl:input message="tns:GetPersonRequest"/>
+ <wsdl:output message="tns:GetPersonResponse"/>
+ <wsdl:fault name="UnknownPerson" message="tns:UnknownPersonFault"/>
+ </wsdl:operation>
+ </wsdl:portType>
+
+ <wsdl:binding name="PersonSOAPBinding" type="tns:Person">
+ <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
+ <wsdl:operation name="GetPerson">
+ <wsdl:input>
+ <soap:body use="literal" />
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal" />
+ </wsdl:output>
+ <wsdl:fault name="UnknownPerson">
+ <soap:fault use="literal" name="UnknownPerson" />
+ </wsdl:fault>
+ </wsdl:operation>
+ </wsdl:binding>
+
+ <wsdl:service name="PersonService">
+ <wsdl:port binding="tns:PersonSOAPBinding" name="soap">
+ <soap:address location="http://localhost:8092/PersonService/" />
+ </wsdl:port>
+ </wsdl:service>
+
+</wsdl:definitions>
Propchange: servicemix/smx4/features/trunk/examples/jpa-osgi/wsdl-first-cxfbc-bundle/src/main/resources/person.wsdl
------------------------------------------------------------------------------
svn:executable = *
Added: servicemix/smx4/features/trunk/examples/jpa-osgi/wsdl-first-cxfse-bundle/pom.xml
URL: http://svn.apache.org/viewvc/servicemix/smx4/features/trunk/examples/jpa-osgi/wsdl-first-cxfse-bundle/pom.xml?rev=904447&view=auto
==============================================================================
--- servicemix/smx4/features/trunk/examples/jpa-osgi/wsdl-first-cxfse-bundle/pom.xml (added)
+++ servicemix/smx4/features/trunk/examples/jpa-osgi/wsdl-first-cxfse-bundle/pom.xml Fri Jan 29 10:12:23 2010
@@ -0,0 +1,136 @@
+<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">
+
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.servicemix.examples</groupId>
+ <artifactId>jpa-osgi</artifactId>
+ <version>4.1.0-SNAPSHOT</version>
+ </parent>
+
+ <groupId>org.apache.servicemix.examples.jpa-osgi</groupId>
+ <artifactId>wsdl-first-cxfse-bundle</artifactId>
+ <packaging>bundle</packaging>
+ <name>ServiceMix :: Samples :: JPA OSGI :: CXF SE BUNDLE</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-rt-frontend-jaxws</artifactId>
+ <version>${cxf.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-ws-metadata_2.0_spec</artifactId>
+ <version>${geronimo.wsmetadata.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-entitymanager</artifactId>
+ <version>3.4.0.GA</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-codegen-plugin</artifactId>
+ <version>${cxf.version}</version>
+ <executions>
+ <execution>
+ <phase>generate-sources</phase>
+ <configuration>
+ <sourceRoot>${basedir}/target/jaxws</sourceRoot>
+ <wsdlOptions>
+ <wsdlOption>
+ <wsdl>${basedir}/src/main/resources/person.wsdl</wsdl>
+ <extraargs>
+ <extraarg>-verbose</extraarg>
+ </extraargs>
+ </wsdlOption>
+
+ </wsdlOptions>
+
+ </configuration>
+ <goals>
+ <goal>wsdl2java</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <configuration>
+ <instructions>
+ <Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName>
+ <Import-Package>
+ javax.jws,
+ javax.wsdl,
+ javax.xml.bind,
+ javax.xml.bind.annotation,
+ javax.xml.namespace,
+ javax.xml.soap,
+ javax.xml.ws,
+ javax.persistence,
+ META-INF.cxf,
+ org.apache.cxf.bus,
+ org.apache.cxf.bus.spring,
+ org.apache.cxf.bus.resource,
+ org.apache.cxf.configuration.spring,
+ org.apache.cxf.resource,
+ org.apache.servicemix.cxfse,
+ org.springframework.beans.factory.config,
+ org.apache.servicemix.common.osgi,
+ org.hsqldb,
+ org.hsqldb.util,
+ org.hsqldb.jdbc,
+ org.hibernate.ejb,
+ org.hibernate.proxy,
+ org.hibernate.hql.ast,
+ javassist.util.proxy,
+ org.apache.commons.dbcp,
+ org.springframework.orm.jpa,
+ org.springframework.orm.jpa.vendor,
+ org.springframework.transaction.support,
+ org.apache.camel.spring.util
+ </Import-Package>
+ <Require-Bundle>org.apache.cxf.bundle</Require-Bundle>
+ <Export-Package>
+ org.apache.servicemix.samples.wsdl_first,
+ org.apache.servicemix.samples.wsdl_first.types
+ </Export-Package>
+ </instructions>
+ </configuration>
+ </plugin>
+
+ </plugins>
+ </build>
+</project>
Propchange: servicemix/smx4/features/trunk/examples/jpa-osgi/wsdl-first-cxfse-bundle/pom.xml
------------------------------------------------------------------------------
svn:executable = *
Added: servicemix/smx4/features/trunk/examples/jpa-osgi/wsdl-first-cxfse-bundle/src/main/java/org/apache/servicemix/samples/wsdl_first/PersonEntity.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/features/trunk/examples/jpa-osgi/wsdl-first-cxfse-bundle/src/main/java/org/apache/servicemix/samples/wsdl_first/PersonEntity.java?rev=904447&view=auto
==============================================================================
--- servicemix/smx4/features/trunk/examples/jpa-osgi/wsdl-first-cxfse-bundle/src/main/java/org/apache/servicemix/samples/wsdl_first/PersonEntity.java (added)
+++ servicemix/smx4/features/trunk/examples/jpa-osgi/wsdl-first-cxfse-bundle/src/main/java/org/apache/servicemix/samples/wsdl_first/PersonEntity.java Fri Jan 29 10:12:23 2010
@@ -0,0 +1,62 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicemix.samples.wsdl_first;
+
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+
+/**
+ * An example entity bean which can be persistent in database
+ *
+ */
+@Entity(name = "person")
+public class PersonEntity {
+ private String personId;
+ private String ssn;
+ private String name;
+
+ public String toString() {
+ return "Person[personId: " + personId + " name: " + name + " ssn: " + ssn + "]";
+ }
+
+ @Id
+ public String getPersonId() {
+ return personId;
+ }
+
+ public void setPersonId(String personId) {
+ this.personId = personId;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getSsn() {
+ return ssn;
+ }
+
+ public void setSsn(String ssn) {
+ this.ssn = ssn;
+ }
+
+}
Added: servicemix/smx4/features/trunk/examples/jpa-osgi/wsdl-first-cxfse-bundle/src/main/java/org/apache/servicemix/samples/wsdl_first/PersonImpl.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/features/trunk/examples/jpa-osgi/wsdl-first-cxfse-bundle/src/main/java/org/apache/servicemix/samples/wsdl_first/PersonImpl.java?rev=904447&view=auto
==============================================================================
--- servicemix/smx4/features/trunk/examples/jpa-osgi/wsdl-first-cxfse-bundle/src/main/java/org/apache/servicemix/samples/wsdl_first/PersonImpl.java (added)
+++ servicemix/smx4/features/trunk/examples/jpa-osgi/wsdl-first-cxfse-bundle/src/main/java/org/apache/servicemix/samples/wsdl_first/PersonImpl.java Fri Jan 29 10:12:23 2010
@@ -0,0 +1,72 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicemix.samples.wsdl_first;
+
+import javax.jws.WebService;
+import javax.persistence.EntityManager;
+import javax.persistence.EntityManagerFactory;
+import javax.persistence.Query;
+import javax.xml.ws.Holder;
+
+import org.apache.servicemix.samples.wsdl_first.types.GetPerson;
+import org.apache.servicemix.samples.wsdl_first.types.GetPersonResponse;
+
+@WebService(serviceName = "PersonService", targetNamespace = "http://servicemix.apache.org/samples/wsdl-first", endpointInterface = "org.apache.servicemix.samples.wsdl_first.Person")
+public class PersonImpl implements Person {
+
+ private EntityManagerFactory entityManagerFactory;
+
+ public PersonImpl(EntityManagerFactory entityManagerFactory) {
+ this.entityManagerFactory = entityManagerFactory;
+ EntityManager entityManager = (EntityManager) entityManagerFactory.createEntityManager();
+ entityManager.getTransaction().begin();
+ PersonEntity personEntity = new PersonEntity();
+ personEntity.setPersonId("ffang");
+ personEntity.setSsn("000-000-0000");
+ personEntity.setName("Freeman Fang");
+ entityManager.persist(personEntity);
+ PersonEntity personEntity2 = new PersonEntity();
+ personEntity2.setPersonId("gnodet");
+ personEntity2.setSsn("111-111-1111");
+ personEntity2.setName("Guillaume Nodet");
+ entityManager.persist(personEntity2);
+ entityManager.getTransaction().commit();
+ entityManager.close();
+ }
+
+ public void getPerson(Holder<String> personId, Holder<String> ssn, Holder<String> name)
+ throws UnknownPersonFault
+ {
+ if (personId.value == null || personId.value.length() == 0) {
+ org.apache.servicemix.samples.wsdl_first.types.UnknownPersonFault fault = new org.apache.servicemix.samples.wsdl_first.types.UnknownPersonFault();
+ fault.setPersonId(personId.value);
+ throw new UnknownPersonFault(null, fault);
+ }
+ EntityManager entityManager = (EntityManager) entityManagerFactory.createEntityManager();
+ Query q = entityManager.createQuery("select p from person p where p.personId = :name");
+ q.setParameter("name", personId.value);
+ PersonEntity p = (PersonEntity)q.getSingleResult();
+ entityManager.close();
+ ssn.value = p.getSsn();
+ name.value = p.getName();
+ }
+
+ public void setEntityManagerFactory(EntityManagerFactory emf) {
+ entityManagerFactory = emf;
+ }
+
+}
Propchange: servicemix/smx4/features/trunk/examples/jpa-osgi/wsdl-first-cxfse-bundle/src/main/java/org/apache/servicemix/samples/wsdl_first/PersonImpl.java
------------------------------------------------------------------------------
svn:executable = *
Added: servicemix/smx4/features/trunk/examples/jpa-osgi/wsdl-first-cxfse-bundle/src/main/resources/META-INF/persistence.xml
URL: http://svn.apache.org/viewvc/servicemix/smx4/features/trunk/examples/jpa-osgi/wsdl-first-cxfse-bundle/src/main/resources/META-INF/persistence.xml?rev=904447&view=auto
==============================================================================
--- servicemix/smx4/features/trunk/examples/jpa-osgi/wsdl-first-cxfse-bundle/src/main/resources/META-INF/persistence.xml (added)
+++ servicemix/smx4/features/trunk/examples/jpa-osgi/wsdl-first-cxfse-bundle/src/main/resources/META-INF/persistence.xml Fri Jan 29 10:12:23 2010
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+ <!--
+ Copyright 2006 The Apache Software Foundation. Licensed under the
+ Apache License, Version 2.0 (the "License"); you may not use this file
+ except in compliance with the License. You may obtain a copy of the
+ License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
+ by applicable law or agreed to in writing, software distributed under
+ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+ CONDITIONS OF ANY KIND, either express or implied. See the License for
+ the specific language governing permissions and limitations under the
+ License.
+ -->
+<persistence xmlns="http://java.sun.com/xml/ns/persistence"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0">
+
+ <persistence-unit name="smx4" transaction-type="RESOURCE_LOCAL">
+ <class>org.apache.servicemix.samples.wsdl_first.PersonEntity</class>
+
+ <!-- Hibernate -->
+ <properties>
+ <property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>
+ <property name="hibernate.hbm2ddl.auto" value="create"/>
+ </properties>
+
+ </persistence-unit>
+</persistence>
Added: servicemix/smx4/features/trunk/examples/jpa-osgi/wsdl-first-cxfse-bundle/src/main/resources/META-INF/spring/beans.xml
URL: http://svn.apache.org/viewvc/servicemix/smx4/features/trunk/examples/jpa-osgi/wsdl-first-cxfse-bundle/src/main/resources/META-INF/spring/beans.xml?rev=904447&view=auto
==============================================================================
--- servicemix/smx4/features/trunk/examples/jpa-osgi/wsdl-first-cxfse-bundle/src/main/resources/META-INF/spring/beans.xml (added)
+++ servicemix/smx4/features/trunk/examples/jpa-osgi/wsdl-first-cxfse-bundle/src/main/resources/META-INF/spring/beans.xml Fri Jan 29 10:12:23 2010
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:cxfse="http://servicemix.apache.org/cxfse/1.0"
+ xsi:schemaLocation="
+ http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+ http://servicemix.apache.org/cxfse/1.0 http://servicemix.apache.org/cxfse/1.0/servicemix-cxf-se.xsd">
+
+
+ <cxfse:endpoint>
+ <cxfse:pojo>
+ <bean class="org.apache.servicemix.samples.wsdl_first.PersonImpl">
+ <constructor-arg>
+ <ref bean="entityManagerFactory"/>
+ </constructor-arg>
+ </bean>
+ </cxfse:pojo>
+ </cxfse:endpoint>
+
+ <bean class="org.apache.servicemix.common.osgi.EndpointExporter" />
+
+
+ <bean id="transactionTemplate" class="org.springframework.transaction.support.TransactionTemplate">
+ <property name="transactionManager">
+ <bean class="org.springframework.orm.jpa.JpaTransactionManager">
+ <property name="entityManagerFactory" ref="entityManagerFactory"/>
+ </bean>
+ </property>
+ </bean>
+
+ <bean id="jpaTemplate" class="org.springframework.orm.jpa.JpaTemplate">
+ <property name="entityManagerFactory" ref="entityManagerFactory"/>
+ </bean>
+
+ <bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
+ <property name="persistenceUnitName" value="smx4"/>
+ <property name="jpaVendorAdapter" ref="jpaAdapter"/>
+ <property name="dataSource" ref="dataSource" />
+ </bean>
+
+ <bean id="jpaAdapter"
+ class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
+ <property name="databasePlatform" value="org.hibernate.dialect.HSQLDialect" />
+ </bean>
+
+ <!-- DataSource Definition -->
+ <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
+ <property name="driverClassName" value="org.hsqldb.jdbcDriver" />
+ <property name="url" value="jdbc:hsqldb:mem:smx4_jpa" />
+ <property name="username" value="sa" />
+ <property name="password" value="" />
+ </bean>
+
+</beans>
Propchange: servicemix/smx4/features/trunk/examples/jpa-osgi/wsdl-first-cxfse-bundle/src/main/resources/META-INF/spring/beans.xml
------------------------------------------------------------------------------
svn:executable = *
Added: servicemix/smx4/features/trunk/examples/jpa-osgi/wsdl-first-cxfse-bundle/src/main/resources/person.wsdl
URL: http://svn.apache.org/viewvc/servicemix/smx4/features/trunk/examples/jpa-osgi/wsdl-first-cxfse-bundle/src/main/resources/person.wsdl?rev=904447&view=auto
==============================================================================
--- servicemix/smx4/features/trunk/examples/jpa-osgi/wsdl-first-cxfse-bundle/src/main/resources/person.wsdl (added)
+++ servicemix/smx4/features/trunk/examples/jpa-osgi/wsdl-first-cxfse-bundle/src/main/resources/person.wsdl Fri Jan 29 10:12:23 2010
@@ -0,0 +1,98 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+<!-- $Rev: 783247 $ $Date: 2009-06-10 16:08:08 +0800 (ä¸, 10 6 2009) $ -->
+<wsdl:definitions name="wsdl-first"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:tns="http://servicemix.apache.org/samples/wsdl-first"
+ xmlns:typens="http://servicemix.apache.org/samples/wsdl-first/types"
+ targetNamespace="http://servicemix.apache.org/samples/wsdl-first">
+
+ <wsdl:types>
+ <xsd:schema targetNamespace="http://servicemix.apache.org/samples/wsdl-first/types"
+ elementFormDefault="qualified">
+ <xsd:element name="GetPerson">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="personId" type="xsd:string"/>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="GetPersonResponse">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="personId" type="xsd:string"/>
+ <xsd:element name="ssn" type="xsd:string"/>
+ <xsd:element name="name" type="xsd:string"/>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="UnknownPersonFault">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="personId" type="xsd:string"/>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ </wsdl:types>
+
+ <wsdl:message name="GetPersonRequest">
+ <wsdl:part name="payload" element="typens:GetPerson"/>
+ </wsdl:message>
+ <wsdl:message name="GetPersonResponse">
+ <wsdl:part name="payload" element="typens:GetPersonResponse"/>
+ </wsdl:message>
+ <wsdl:message name="UnknownPersonFault">
+ <wsdl:part name="payload" element="typens:UnknownPersonFault"/>
+ </wsdl:message>
+
+ <wsdl:portType name="Person">
+ <wsdl:operation name="GetPerson">
+ <wsdl:input message="tns:GetPersonRequest"/>
+ <wsdl:output message="tns:GetPersonResponse"/>
+ <wsdl:fault name="UnknownPerson" message="tns:UnknownPersonFault"/>
+ </wsdl:operation>
+ </wsdl:portType>
+
+ <wsdl:binding name="PersonSOAPBinding" type="tns:Person">
+ <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
+ <wsdl:operation name="GetPerson">
+ <wsdl:input>
+ <soap:body use="literal" />
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal" />
+ </wsdl:output>
+ <wsdl:fault name="UnknownPerson">
+ <soap:fault use="literal" name="UnknownPerson" />
+ </wsdl:fault>
+ </wsdl:operation>
+ </wsdl:binding>
+
+ <wsdl:service name="PersonService">
+ <wsdl:port binding="tns:PersonSOAPBinding" name="soap">
+ <soap:address location="http://localhost:8092/PersonService/" />
+ </wsdl:port>
+ </wsdl:service>
+
+</wsdl:definitions>
Propchange: servicemix/smx4/features/trunk/examples/jpa-osgi/wsdl-first-cxfse-bundle/src/main/resources/person.wsdl
------------------------------------------------------------------------------
svn:executable = *
Modified: servicemix/smx4/features/trunk/examples/pom.xml
URL: http://svn.apache.org/viewvc/servicemix/smx4/features/trunk/examples/pom.xml?rev=904447&r1=904446&r2=904447&view=diff
==============================================================================
--- servicemix/smx4/features/trunk/examples/pom.xml (original)
+++ servicemix/smx4/features/trunk/examples/pom.xml Fri Jan 29 10:12:23 2010
@@ -48,6 +48,7 @@
<module>cxf-ws-addressing</module>
<module>cxf-wsdl-first-osgi-package</module>
<module>cxf-ws-security-osgi</module>
+ <module>jpa-osgi</module>
<module>itests</module>
</modules>
Modified: servicemix/smx4/features/trunk/pom.xml
URL: http://svn.apache.org/viewvc/servicemix/smx4/features/trunk/pom.xml?rev=904447&r1=904446&r2=904447&view=diff
==============================================================================
--- servicemix/smx4/features/trunk/pom.xml (original)
+++ servicemix/smx4/features/trunk/pom.xml Fri Jan 29 10:12:23 2010
@@ -88,10 +88,10 @@
<commons.vfs.version>1.0_1</commons.vfs.version>
<commons.jexl.version>1.1_1</commons.jexl.version>
<cxf.version>2.2.5</cxf.version>
- <dom4j.version>1.6_1</dom4j.version>
+ <dom4j.version>1.6.1_2</dom4j.version>
<drools.version>4.0.7_4</drools.version>
<depends.maven.plugin.version>1.2</depends.maven.plugin.version>
- <equinox.version>3.5.0.v20090520</equinox.version>
+ <equinox.version>3.5.1.v20090827</equinox.version>
<fastinfoset.version>1.2.2_1</fastinfoset.version>
<features.maven.plugin.version>1.1</features.maven.plugin.version>
<felix.bundlerepository.version>1.2.0</felix.bundlerepository.version>
@@ -244,6 +244,18 @@
<osgi.jmx.version>4.2.0.200907080519</osgi.jmx.version>
<sshd.version>0.2.0</sshd.version>
<sonar.skippedModules>examples</sonar.skippedModules>
+
+ <!--below bundles is used for jpa-hibernate feature-->
+ <hsqldb.version>1.8.0.7</hsqldb.version>
+ <antlr.springsource.version>2.7.7</antlr.springsource.version>
+ <jgroups.springsource.version>2.5.1</jgroups.springsource.version>
+ <asm.springsource.version>1.5.3</asm.springsource.version>
+ <cglib.springsource.version>2.2.0</cglib.springsource.version>
+ <javassist.springsource.version>3.9.0.GA</javassist.springsource.version>
+ <hibernate.annotations.common.springsource.version>3.3.0.GA</hibernate.annotations.common.springsource.version>
+ <hibernate.annotations.springsource.version>3.4.0.GA</hibernate.annotations.springsource.version>
+ <hibernate.ejb.springsource.version>3.4.0.GA</hibernate.ejb.springsource.version>
+ <hibernate.springsource.version>3.3.2.GA</hibernate.springsource.version>
</properties>
<repositories>
@@ -356,6 +368,28 @@
<enabled>false</enabled>
</snapshots>
</repository>
+ <repository>
+ <id>springsource.release</id>
+ <name>springsource release Repository</name>
+ <url>http://repository.springsource.com/maven/bundles/release</url>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ </repository>
+ <repository>
+ <id>springsource.external</id>
+ <name>springsource external Repository</name>
+ <url>http://repository.springsource.com/maven/bundles/external</url>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ </repository>
</repositories>
<pluginRepositories>