on 11-14-2017 2:48 AM
Hi,
I'm trying to integrate sapjco, I followed the guide:
https://help.hybris.com/6.2.0/hcd/8c4c8fb68669101498abeb351b4a7f5e.html
I have a custom addon where I implemented the rfc call, but when I try to inject JCoManagedConnectionContainer :
@Resource
private JCoManagedConnectionContainer managedConnectionContainer;
I get a "no bean named managedconnectioncontainer defined".
In my custom addon I have the sapcorejco required extension in extensioninfo.xml:
<requires-extension name="sapcorejco"/>
In sapcorejco-spring.xml is defined the bean, I already tried to overwrite that bean definition in myaddon-spring.xml but it didnt work
Hello, and Are you sure that managedConnectionContainer bean exists?
I think the bean that you need is "sapCoreManagedConnectionContainer" Check sapcorejco-spring.xml
<alias alias="sapCoreManagedConnectionContainer" name="sapCoreDefaultManagedConnectionContainer" />
<bean
class="de.hybris.platform.sap.core.jco.connection.impl.DefaultJCoManagedConnectionContainer"
id="sapCoreDefaultManagedConnectionContainer" scope="sapSession"
destroy-method="destroy">
<property name="managedConnectionFactory" ref="sapCoreJCoManagedConnectionFactory" />
</bean>
bye
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Resource private JCoManagedConnectionContainer sapCoreManagedConnectionContainer;
After that the server doesn't startup: Error initializing global application context!... BeanCreationException: Error creating bean name 'mycustomserviceclass' : injection of resource dependencies failed; nested exception is java.lang.NullPointerException...
The only connection between mycustomaddon and sajcorejco is requires-extension name="sapcorejco" I don't know if its enought,
Hi , requires-extension name="sapcorejco" is ok, but the problem is the bean definition of mycustomserviceclass.
Check the bean properties and setters in java file.
But, if you use @Resource in some attribute you mustn't define this attribute in bean configuration (xml file).
If you don't find the way, try to inject sapCoreManagedConnectionContainer without @Resource, with setter and in the bean:
<property name="sapCoreManagedConnectionContainer" ref="sapCoreManagedConnectionContainer" />
Hi Pablo thanks I've already tried your suggestion:
private JCoManagedConnectionContainer managedConnectionContainer;
...
setManagedConnectionContainer(final JCoManagedConnectionContainer managedConnectionContainer)
{
this.managedConnectionContainer = managedConnectionContainer;
}
And in spring xml:
<bean id="italikaReplicationController"
class="de.hybris.platform.italika.controller.ItalikaReplicationController">
<property name="managedConnectionContainer" ref="sapCoreManagedConnectionContainer" />
</bean>
But I still have the same creation bean excetion, nullpointer
You can use sapCoreJCoManagedConnectionFactory bean instead of connectionContainer.
JCoConnection managedConnection = sapCoreJCoManagedConnectionFactory.getManagedConnection("JCoStateless", "Hybris");
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am getting the same issue. Did you managed to find solution for this issue?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear Leonardo, Can you please give below three required extensions
<requires-extension name="sapcorebol"/>
<requires-extension name="sapmodel"/>
<requires-extension name="sapcoreconfiguration"/>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
5 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.