SOAP - insertContent - IllegalStateException: Already value

Use this forum to report bugs and to check for bugfixes and new releases of OpenEMM

Moderator: moderator

ashe.mckee
Posts: 1
Joined: Wed Aug 06, 2008 12:25 pm

SOAP - insertContent - IllegalStateException: Already value

Post by ashe.mckee »

Hi there,

I'm getting an error when using insertContent (text or html) via webservices (all other webservice requests work fine).

I'm using PHP to make the request however I've also tried using a simple SOAP client on OS X without any luck (see examples below) - can anybody help?

I'm running OpenEMM version 5.5.0, Java 1.5.0_15 on CentOS 5

Many thanks

Ashe

SOAP REQUEST

Code: Select all

<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
>
-<SOAP-ENV:Body>
-<m:insertContent xmlns:m="urn:agnitas-webservice">
-<in0 xsi:type="xsd:string">openemm_export</in0>
-<in1 xsi:type="xsd:string">pac1f1c</in1>
-<in2 xsi:type="xsd:int">25</in2>
-<in3 xsi:type="xsd:string">emailText</in3>
-<in4 xsi:type="xsd:string">hello world</in4>
-<in5 xsi:type="xsd:int">0</in5>
-<in6 xsi:type="xsd:int">1</in6>
</m:insertContent>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
SOAP REPLY

Code: Select all

<soapenv:Envelope
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
>
-<soapenv:Body>
-<soapenv:Fault>
-<faultcode>soapenv:Server.userException</faultcode>
-<faultstring>java.lang.IllegalStateException: Already value [org.springframework.orm.hibernate3.SessionHolder@e2e276] for key [org.hibernate.impl.SessionFactoryImpl@76458f] bound to thread [resin-tcp-connection-*:8080-1]</faultstring>
-<detail>
-<ns1:hostname>127.0.0.1</ns1:hostname>
</detail>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
wolf.bubenik
Posts: 3
Joined: Thu Sep 25, 2008 1:03 pm

java.lang.IllegalStateException: Already value ...

Post by wolf.bubenik »

I have a similar / same problem using the java web service client.

Caused by: java.lang.IllegalStateException: Already value [org.springframework.orm.hibernate3.SessionHolder@1ba4806] for key [org.hibernate.impl.SessionFactoryImpl@17fc44f] bound to thread [resin-tcp-connection-*:8080-1]
at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222)
at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129)
at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source)
at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
at org.apache.axis.client.Call.invoke(Call.java:2767)
at org.apache.axis.client.Call.invoke(Call.java:2443)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at org.agnitas.webservice.EmmWebServiceBindingStub.insertContent(EmmWebServiceBindingStub.java:419)
at com.aperto.newsletter.OpenEmmNewsletterService.setNewsletterContent(OpenEmmNewsletterService.java:168)

Any suggestions ??
wolf.bubenik
Posts: 3
Joined: Thu Sep 25, 2008 1:03 pm

Post by wolf.bubenik »

This is probably a bug inside Spring reported in http://jira.springframework.org/browse/SPR-3210.

Spring has this bug since version 1.2.5 and openEMM shippes with Spring 1.2.7.

The bug has been fixed with Spring 2.5.1. Thus upgrading openEMM to a actual Spring distribution may solve this issue.
wolf.bubenik
Posts: 3
Joined: Thu Sep 25, 2008 1:03 pm

Post by wolf.bubenik »

I played around with jars - no success:

- Using spring-2.5.3.jar: did not help
- Using mysql-connector-java-5.0.8-bin.jar instead of version 3.x (I use mySQL 5.0.x): did not help

As I see it this brings the bug back to openEMM.

Any other ideas?

Without a fix the web service is almost useless for us.

Thanks
wolf
emmulator
Posts: 26
Joined: Mon Oct 27, 2008 7:44 pm

Post by emmulator »

Is there any word on a fix for this? I've just run into this same issue using a Java client for webservices in the 5.5.1 release of OpenEMM.
emmulator
Posts: 26
Joined: Mon Oct 27, 2008 7:44 pm

Post by emmulator »

I fixed this issue locally by simply removing the calls to TransactionSynchronizationManager in the insertContent method of EmmWebservice.java.

1) They are already using OpenSessionInView for the webservices, so attempting to manually bind a Session to the Thread is redundant.

2) They are unbinding using a different key than the one they bind with.
emmulator
Posts: 26
Joined: Mon Oct 27, 2008 7:44 pm

Post by emmulator »

Sorry, I just noticed that the same fix is also available on the bug tracker.
lelobo
Posts: 2
Joined: Wed Jun 17, 2009 9:19 pm

About InsertContent by PHP

Post by lelobo »

Hello Comunity,

I am developing with PHP Openemm by webservice for send newletters

I am getting a error method InsertContent and others methods are great working.


Request:

require_once 'SOAP/Client.php';
$username = "openemmws";
$password = "openemmws";
$wsdl_url = "openemm.wsdl";
$WSDL = new SOAP_WSDL($wsdl_url);
$client = $WSDL->getProxy();


$mailing_id=77; //Id already exists from data base openemm
$block_name="emailHtml";
$block_content="<html><p>Hello Mundo!</p></html>";
$target_id=0;
$priority=0;
$result = $client->insertContent($username, $password,$mailing_id, $block_name, $block_content, $target_id, $priority);
echo $result;

Reply:

java.lang.IllegalStateException: Already value [org.springframework.orm.hibernate3.SessionHolder@72b4dc] for key [org.hibernate.impl.SessionFactoryImpl@11756a7] bound to thread [resin-tcp-connection-*:8080-23]


I still not understand why it have problem error thoses parameters of InsertContent.

Any have idea to solve it?

Regards,
campariorange
Posts: 5
Joined: Thu Oct 15, 2009 2:02 pm

Post by campariorange »

Post Reply