Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » BLOB Handling in DBWS generated webservice
BLOB Handling in DBWS generated webservice [message #1021858] Wed, 20 March 2013 20:09
Jay Royse is currently offline Jay Royse
Messages: 3
Registered: February 2013
Junior Member
Hi, I am attempting to build a simple WS to CRUD one Oracle DB table. I am using the DBWS utility to build the WS. I have generated the WAR file successfully, and deployed to Glassfish 3.1.2. Eclipselink version = 2.3.2.v20111125-r10461. Oracle = 11.2.0.3.0
The Oracle table includes a BLOB field and I get errors when sending the BLOB data through the web service. If I remove the BLOB field from the request then everything works perfectly. I believe there is an issue somewhere in my mapping files. Here are the fields for the column in error.
eclipselink-dbws-ox.xml:
<attribute-mapping xsi:type="xml-direct-mapping">
               <attribute-name>image</attribute-name>
               <field name="image/text()" xsi:type="node">
                  <schema-type>{removedlinkduetopostingrule}base64Binary</schema-type>
               </field>
               <converter xsi:type="serialized-object-converter"/>
               <attribute-classification>[B</attribute-classification>
               <null-policy xsi:type="null-policy">
                  <xsi-nil-represents-null>true</xsi-nil-represents-null>
                  <null-representation-for-xml>XSI_NIL</null-representation-for-xml>
               </null-policy>
            </attribute-mapping>




eclipselink-dbws-or.xml:
 <attribute-mapping xsi:type="direct-mapping">
               <attribute-name>image</attribute-name>
               <field table="SURPLUS_ASSET" name="IMAGE" sql-typecode="2004" xsi:type="column"/>
               <attribute-classification>[B</attribute-classification>
            </attribute-mapping>


eclipselink-dbws-schema.xsd:
<xsd:element name="image" type="xsd:base64Binary" minOccurs="0" nillable="true"/>

i get an error
I've tried changing the [B mapping to
1.java.sql.Blob prodices java.lang.ArrayIndexOutOfBoundsException
2. org.apache.commons.codec.binary.Base64 produces java.lang.ArrayIndexOutOfBoundsException

the sample data Im sending in is as follows
 <urn1:image>34</urn1:image>


Any ideas on why this error is occuring? Thanks in advance

[#|2013-03-20T15:26:46.542-0500|SEVERE|glassfish3.1.2|com.sun.xml.ws.server.SyncProviderInvokerTube|_ThreadID=133;_ThreadName=Thread-2;|SOAPMessage request format error - java.lang.ArrayIndexOutOfBoundsException: 2
javax.xml.ws.soap.SOAPFaultException: SOAPMessage request format error - java.lang.ArrayIndexOutOfBoundsException: 2
	at org.eclipse.persistence.internal.dbws.ProviderHelper.invoke(ProviderHelper.java:561)
	at _dbws.DBWSProvider.invoke(DBWSProvider.java:58)
	at _dbws.DBWSProvider.invoke(DBWSProvider.java:22)
	at org.glassfish.webservices.InstanceResolverImpl$1.invokeProvider(InstanceResolverImpl.java:148)
	at com.sun.xml.ws.server.InvokerTube$2.invokeProvider(InvokerTube.java:159)
	at com.sun.xml.ws.server.provider.SyncProviderInvokerTube.processRequest(SyncProviderInvokerTube.java:83)
	at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:961)
	at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:910)
	at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:873)
	at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:775)
	at com.sun.xml.ws.api.pipe.helper.AbstractTubeImpl.process(AbstractTubeImpl.java:116)
	at org.glassfish.webservices.MonitoringPipe.process(MonitoringPipe.java:142)
	at com.sun.xml.ws.api.pipe.helper.PipeAdapter.processRequest(PipeAdapter.java:119)
	at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:961)
	at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:910)
	at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:873)
	at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:775)
	at com.sun.xml.ws.api.pipe.helper.AbstractTubeImpl.process(AbstractTubeImpl.java:116)
	at com.sun.enterprise.security.webservices.CommonServerSecurityPipe.processRequest(CommonServerSecurityPipe.java:212)
	at com.sun.enterprise.security.webservices.CommonServerSecurityPipe.process(CommonServerSecurityPipe.java:144)
	at com.sun.xml.ws.api.pipe.helper.PipeAdapter.processRequest(PipeAdapter.java:119)
	at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:961)
	at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:910)
	at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:873)
	at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:775)
	at com.sun.xml.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:386)
	at com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:640)
	at com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:263)
	at com.sun.xml.ws.transport.http.servlet.ServletAdapter.handle(ServletAdapter.java:163)
	at org.glassfish.webservices.JAXWSServlet.doPost(JAXWSServlet.java:145)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:688)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:770)
	at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1550)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:281)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
	at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
	at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:331)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
	at com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)
	at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
	at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)
	at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:757)
	at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1056)
	at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:229)
	at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
	at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
	at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
	at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
	at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
	at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
	at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
	at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
	at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
	at java.lang.Thread.run(Thread.java:722)

[Updated on: Wed, 20 March 2013 20:29]

Report message to a moderator

Previous Topic:[RESOLVED] EclipseLink on Tomcat7 (Dev. in Netbeans)
Next Topic:JPA-RS: @OneToOne relationship problem
Goto Forum:
  


Current Time: Sun Oct 26 00:21:00 GMT 2014

Powered by FUDForum. Page generated in 0.01700 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software