You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by watermelonjam <da...@linux.ca> on 2011/12/05 19:37:40 UTC

Re: JPA EntityManager not properly injected for annotation-based config

Thanks for your reply.  Here's the spring context config:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:context="http://www.springframework.org/schema/context"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:util="http://www.springframework.org/schema/util"
	xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
						http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
						http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx.xsd
						http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util.xsd">

	<context:annotation-config />

	<context:component-scan base-package="org.example" />

	<tx:annotation-driven transaction-manager="transactionManager" />

	<bean id="transactionManager"
class="org.springframework.orm.jpa.JpaTransactionManager">
		<property name="entityManagerFactory" ref="entityManagerFactory" />
	</bean>

	<bean id="transactionTemplate"
class="org.springframework.transaction.support.TransactionTemplate">
		<property name="transactionManager" ref="transactionManager" />
	</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="dataSource" ref="dataSource" />
		<property name="jpaVendorAdapter" ref="jpaAdapter" />
		<property name="persistenceUnitName" value="example" />
	</bean>

	<bean id="jpaAdapter"
class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
		<property name="showSql" value="true" />
		<property name="generateDdl" value="true" />
		<property name="databasePlatform"
value="org.hibernate.dialect.HSQLDialect" />
	</bean>

	<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close" scope="singleton">
		<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>

Using proxy-target-class="true" seems to work on my trivial example, but I
suspect it may cause issues with a WSDL-first JAX-WS web service.  I'll work
on extending the example to verify.


--
View this message in context: http://servicemix.396122.n5.nabble.com/JPA-EntityManager-not-properly-injected-for-annotation-based-config-tp5014530p5049727.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Re: cxf-provider with SSL encryption

Posted by Freeman Fang <ff...@fusesource.com>.
Hi,

We have a testcase which demonstrate how to configure cxf bc provider  
with SSL, take a look at[1], also the configuration file used for this  
testcase[2],[3]
[1]https://svn.apache.org/repos/asf/servicemix/components/trunk/bindings/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/ws/security/CxfBcProviderHttpsTest.java
[2]https://svn.apache.org/repos/asf/servicemix/components/trunk/bindings/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/ws/security/provider.xml
[3]https://svn.apache.org/repos/asf/servicemix/components/trunk/bindings/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/ws/security/provider/WibbleClient.xml

Freeman
On 2011-12-9, at 下午9:25, Rafal Janik wrote:

> Hi
>
>
>
> I'm a little bit confused with configuring cxf-provider with SSL  
> encryption.
> In my servicemix there is a very simple proxy :
>
> <cxfbc:consumer wsdl="classpath:MyService.wsdl"
>                    targetEndpoint="HealthIndicatorImplPort"
>                    targetService="mynamespace:MyService"
>                     
> targetInterface="mynamespace:HealthIndicatorImplPort"
>                    endpoint="HealthIndicatorImplPortEndpoint"
>                    service="mynamespace:MyService"
>                    locationURI="http://0.0.0.0:8190/robust/ 
> MyService/">
>
>
> </cxfbc:consumer>
>
>
> <cxfbc:provider wsdl="classpath:MyService.wsdl"
>                    locationURI="https://my.service.com/MyService"
>                     
> interfaceName="mynamespace:HealthIndicatorImplPort2"
>                    service="mynamespace:MyService"
>                    endpoint="HealthIndicatorImplPort">
>
> </cxfbc:provider>
>
> The ws mentioned in cxf:bcprovider has changed and now it just  
> support SSL encryption.
> The cert was imported into created jks file.
>
> I want to leave the cxf-consumer without ssl and accept the cert  
> just for provider - I don't want the smx client see any changes in  
> API.
>
> Where and how I should configure the provider? With busCfg or in  
> cxf.xml? And how?  I've read many examples, blogs documentations but  
> it isn't working for me - probably I'm doing something wrong or I  
> don't understand how it should work...
>
>
> Please help me :)
>
> Thanks in advance.
>
>
> regards
>
>
> rafal
>
>
>
>
>
>
>
>
>
>

---------------------------------------------
Freeman Fang

FuseSource
Email:ffang@fusesource.com
Web: fusesource.com
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com










Re: cxf-provider with SSL encryption

Posted by Rafal Janik <ra...@softwaremind.pl>.
sorry for the previous mail, wrong topic,

cxf-provider with SSL encryption

Posted by Rafal Janik <ra...@softwaremind.pl>.
Hi



I'm a little bit confused with configuring cxf-provider with SSL encryption.
In my servicemix there is a very simple proxy :

<cxfbc:consumer wsdl="classpath:MyService.wsdl"
                     targetEndpoint="HealthIndicatorImplPort"
                     targetService="mynamespace:MyService"
                     targetInterface="mynamespace:HealthIndicatorImplPort"
                     endpoint="HealthIndicatorImplPortEndpoint"
                     service="mynamespace:MyService"
                     locationURI="http://0.0.0.0:8190/robust/MyService/">


</cxfbc:consumer>


<cxfbc:provider wsdl="classpath:MyService.wsdl"
                     locationURI="https://my.service.com/MyService"
                     interfaceName="mynamespace:HealthIndicatorImplPort2"
                     service="mynamespace:MyService"
                     endpoint="HealthIndicatorImplPort">

</cxfbc:provider>

The ws mentioned in cxf:bcprovider has changed and now it just support 
SSL encryption.
The cert was imported into created jks file.

I want to leave the cxf-consumer without ssl and accept the cert just 
for provider - I don't want the smx client see any changes in API.

Where and how I should configure the provider? With busCfg or in 
cxf.xml? And how?  I've read many examples, blogs documentations but it 
isn't working for me - probably I'm doing something wrong or I don't 
understand how it should work...


Please help me :)

Thanks in advance.


regards


rafal











Re: JPA EntityManager not properly injected for annotation-based config

Posted by Ioannis Canellos <io...@gmail.com>.
If this works for you, but you can't use it because of conflicts with other
things you need.
The use complie time weaving of the spring-aspects, when you are building
this artifact.

-- 
*Ioannis Canellos*
*
FuseSource <http://fusesource.com>

**
Blog: http://iocanel.blogspot.com
**
Apache Karaf <http://karaf.apache.org/> Committer & PMC
Apache Camel <http://camel.apache.org/> Committer
Apache ServiceMix <http://servicemix.apache.org/>  Committer
Apache Gora <http://incubator.apache.org/gora/> Committer
Apache DirectMemory <http://incubator.apache.org/directmemory/> Committer
*