axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ravivarma (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (AXIS2-5609) [ERROR] org.apache.axis2.AxisFault: Mapping qname not fond for the package: oracle.sql
Date Fri, 11 Oct 2013 05:54:42 GMT

    [ https://issues.apache.org/jira/browse/AXIS2-5609?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13792370#comment-13792370
] 

Ravivarma edited comment on AXIS2-5609 at 10/11/13 5:52 AM:
------------------------------------------------------------

Hi Sagara,

I used standard java types as you said. But the issue still remains same.
Can you plz share any working code to consume the blob object. Here is the code I written.


Image pojo class:

package com.apps.emp;

import java.sql.Blob;

public class ImageData {
	private int id;
	private Blob photo;
	private String name;
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public Blob getPhoto() {
		return photo;
	}
	public void setPhoto(Blob photo) {
		this.photo = photo;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
}

DB service class :

public ImageData getImage(int id) {
        Connection conn = (Connection) MessageContext.getCurrentMessageContext().getProperty(DBServiceLifeCycle.DB_CONNECTION);
        if(conn !=null) {
            String SQL = "SELECT ID, PHOTO_NAME, PHOTO FROM RAVI.IMAGES WHERE ID=?";
            try {
                PreparedStatement statement = conn.prepareStatement(SQL);
                statement.setInt(1, id);
                ResultSet result = statement.executeQuery();
                if (result.next()) {
                	ImageData imagedata = new ImageData();
                	
                	imagedata.setId((int)result.getInt("ID"));
                	imagedata.setName(result.getString("PHOTO_NAME"));
                	imagedata.setPhoto(result.getBlob("PHOTO"));             
                	               
                    return imagedata;
                }
            } catch (SQLException e) {
                e.printStackTrace();
            }
        }
        return null;
    }

Solution is much critical for my task. Thanks in advance. 


was (Author: ravivarma434):
Hi Sagara,

I used standard java times as you said. But the issue still remains same.
Can you plz share any working code to consume the blob object. Here is the code I written.


Image pojo class:

package com.apps.emp;

import java.sql.Blob;

public class ImageData {
	private int id;
	private Blob photo;
	private String name;
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public Blob getPhoto() {
		return photo;
	}
	public void setPhoto(Blob photo) {
		this.photo = photo;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
}

DB service class :

public ImageData getImage(int id) {
        Connection conn = (Connection) MessageContext.getCurrentMessageContext().getProperty(DBServiceLifeCycle.DB_CONNECTION);
        if(conn !=null) {
            String SQL = "SELECT ID, PHOTO_NAME, PHOTO FROM RAVI.IMAGES WHERE ID=?";
            try {
                PreparedStatement statement = conn.prepareStatement(SQL);
                statement.setInt(1, id);
                ResultSet result = statement.executeQuery();
                if (result.next()) {
                	ImageData imagedata = new ImageData();
                	
                	imagedata.setId((int)result.getInt("ID"));
                	imagedata.setName(result.getString("PHOTO_NAME"));
                	imagedata.setPhoto(result.getBlob("PHOTO"));             
                	               
                    return imagedata;
                }
            } catch (SQLException e) {
                e.printStackTrace();
            }
        }
        return null;
    }

Solution is much critical for my task. Thanks in advance. 

> [ERROR] org.apache.axis2.AxisFault: Mapping qname not fond for the package: oracle.sql
> --------------------------------------------------------------------------------------
>
>                 Key: AXIS2-5609
>                 URL: https://issues.apache.org/jira/browse/AXIS2-5609
>             Project: Axis2
>          Issue Type: Bug
>          Components: databinding, wsdl
>    Affects Versions: 1.6.2
>         Environment: Tomcat 7.0.42, Axis2 1.6.2, JDK 1.6, Oracle 11g
>            Reporter: Ravivarma
>            Priority: Critical
>
> I implemented a SOAP service using Axis2 webservices which talks with the database and
retrieve the values. I have used JDBC PreparedStatement, POJO java classes to generate the
service. And list of fields in the table are name, id, designation, email, image. I inserted
the values in the table. WSDL generated perfectly and able to see the values when I hit the
service without of image field value (image =null). When I add the BLOB object to image in
the table, then its giving databinding error as shown below.
> [ERROR] org.apache.axis2.AxisFault: Mapping qname not fond for the package: oracle.sql
> java.lang.RuntimeException: org.apache.axis2.AxisFault: Mapping qname not fond for the
package: oracle.sql
> 	at org.apache.axis2.databinding.utils.BeanUtil.getPropertyQnameList(BeanUtil.java:264)
> 	at org.apache.axis2.databinding.utils.BeanUtil.getPropertyQnameList(BeanUtil.java:117)
> 	at org.apache.axis2.databinding.utils.BeanUtil.getPropertyQnameList(BeanUtil.java:117)
> 	at org.apache.axis2.databinding.utils.BeanUtil.getPullParser(BeanUtil.java:72)
> 	at org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl.processProperties(ADBXMLStreamReaderImpl.java:993)
> 	at org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl.next(ADBXMLStreamReaderImpl.java:850)
> 	at org.apache.axis2.util.StreamWrapper.next(StreamWrapper.java:71)
> 	at org.apache.axiom.om.impl.builder.StAXOMBuilder.parserNext(StAXOMBuilder.java:668)
> 	at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:214)
> 	at org.apache.axiom.om.impl.llom.OMSerializableImpl.build(OMSerializableImpl.java:75)
> 	at org.apache.axiom.om.impl.llom.OMElementImpl.build(OMElementImpl.java:776)
> 	at org.apache.axiom.om.impl.llom.OMElementImpl.detach(OMElementImpl.java:754)
> 	at org.apache.axiom.om.impl.llom.OMElementImpl.addChild(OMElementImpl.java:316)
> 	at org.apache.axiom.om.impl.llom.OMElementImpl.addChild(OMElementImpl.java:237)
> 	at org.apache.axis2.rpc.receivers.RPCUtil.processResponse(RPCUtil.java:105)
> 	at org.apache.axis2.rpc.receivers.RPCUtil.processResponseAsDocLitWrapped(RPCUtil.java:456)
> 	at org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogic(RPCMessageReceiver.java:155)
> 	at org.apache.axis2.receivers.AbstractInOutMessageReceiver.invokeBusinessLogic(AbstractInOutMessageReceiver.java:40)
> 	at org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:114)
> 	at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:181)
> 	at org.apache.axis2.transport.http.util.RESTUtil.invokeAxisEngine(RESTUtil.java:144)
> 	at org.apache.axis2.transport.http.util.RESTUtil.processURLRequest(RESTUtil.java:139)
> 	at org.apache.axis2.transport.http.AxisServlet$RestRequestProcessor.processURLRequest(AxisServlet.java:837)
> 	at org.apache.axis2.transport.http.AxisServlet.doGet(AxisServlet.java:273)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
> 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
> 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
> 	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
> 	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
> 	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
> 	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
> 	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
> 	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
> 	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
> 	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
> 	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
> 	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
> 	at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1852)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
> 	at java.lang.Thread.run(Thread.java:662)
> Caused by: org.apache.axis2.AxisFault: Mapping qname not fond for the package: oracle.sql
> 	at org.apache.axis2.databinding.utils.BeanUtil.getPropertyQnameList(BeanUtil.java:131)
> 	... 41 more
> ============================================================================
> Below insert statement is working fine:
> insert into EMPINFO (EMP_NAME, EMP_ID, DESIGNATION, EMAIL_ID, IMAGE) values ('Ravi',1205,'Lead','ravivarma434@gmail.com',NULL);
> Below insert statement giving binding error:
> insert into EMPINFO (EMP_NAME, EMP_ID, DESIGNATION, EMAIL_ID, IMAGE) values ('Ravi',1205,'Lead','ravivarma434@gmail.com',to_blob(rawtohex('C:/Users/ravi.gandla/Desktop/EmpolyeeData/ravi.jpg')));
> ====================================================================
> Java code part of the service is here:
> public EmpData getEmpData(int empid) {
>         Connection conn = (Connection) MessageContext.getCurrentMessageContext().getProperty(DBServiceLifeCycle.DB_CONNECTION);
>         if(conn !=null) {
>             String SQL = "SELECT EMP_NAME, EMP_ID, DESIGNATION,EMAIL_ID, IMAGE FROM EMPINFO
WHERE EMP_ID=?";
>             try {
>                 PreparedStatement statement = conn.prepareStatement(SQL);
>                 statement.setInt(1, empid);
>                 ResultSet result = statement.executeQuery();
>                 if (result.next()) {
>                 	EmpData empdata = new EmpData();
>                 	empdata.setEmpname(result.getString("EMP_NAME"));
>                 	empdata.setEmpid((int)result.getInt("EMP_ID"));
>                 	empdata.setDesignation(result.getString("DESIGNATION"));
>                 	empdata.setImage(result.getBlob("EMP_IMAGE"));             
>                 	               
>                     return empdata;
>                 }
>             } catch (SQLException e) {
>                 e.printStackTrace();
>             }
>         }
>         return null;
>     }



--
This message was sent by Atlassian JIRA
(v6.1#6144)

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


Mime
View raw message