我的服务发布的时候总是出现莫名其妙的错误,我google了半天,都没有想要的东东
哪位能帮我解决一下,先谢过!
下面是出错的信息:
AXIS error
Sorry, something seems to have gone wrong... here are the details:
Fault - ; nested exception is:
WSDLException: faultCode=OTHER_ERROR: Can't find prefix for 'http
://sql.java'. Namespace prefixes must be set on the Definition object u
sing the addNamespace(...) method.:
AxisFault
faultCode: {
http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: WSDLException: faultCode=OTHER_ERROR: Can't find prefix f
or '
http://sql.java'. Namespace prefixes must be set on the Defini
tion object using the addNamespace(...) method.:
faultActor:
faultNode:
faultDetail:
下面是发布的服务,
我发布服务的时候
如果在方法printTable()中加入参数Connection
则会出现上面的错误
如果不加任何的参数,则不会出现任何的错误,能够成功发布
不知道什么原因
import java.sql.*;
import org.objectweb.jotm.*;
import org.objectweb.transaction.jta.TMService;
public class TestReturn
{
//function getConnection
public Connection getConnection() throws Exception
{
Connection conn = null;
try
{
Class.forName("org.gjt.mm.mysql.Driver").newInstance();
conn=java.sql.DriverManager.getConnection("jdbc:mysql://192.168.20.46:330
6/javatest","jeffshia","jeffshia2002");
}
catch (Exception e)
{
e.printStackTrace();
}
return conn;
}
public String printTable(Connection conn)
{
//Connection conn = null;
String res="";
try
{
Statement stmt = conn.createStatement();
ResultSet rset = stmt.executeQuery("select id, foo from testdata");
int numcols = rset.getMetaData().getColumnCount();
for (int i = 1; i <= numcols; i++)
{
System.out.print("\t" + rset.getMetaData().getColumnName(i));
}
while (rset.next())
{
for (int i = 1; i <= numcols; i++)
{
//System.out.print("\t" + rset.getString(i));
res+=rset.getString(i)+" ";
}
}
}
catch (Exception e)
{
e.printStackTrace();
}
return res;
}
/*
public static void main(String args[])throws Exception
{
TestReturn tr = new TestReturn();
Connection conn = tr.getConnection();
System.out.println(tr.printTable(conn));
}
*/
}
--
FROM 166.111.102.*