Results 1 to 18 of 18
Thread: Problem is Web service reference
- 12-22-2010, 12:06 AM #1
Member
- Join Date
- Nov 2009
- Posts
- 20
- Rep Power
- 0
Problem is Web service reference
Hi,
I've narrowed down the problem to the getRecord() of the ClientBean below. Specifically, when I reference the Web service- Service Endpoint Object (SEI)CustomerPurchaseOrderService it gives me an error stating-
java.lang.NoClassDefFoundError: Could not initialize class com.sun.xml.ws.api.streaming.XMLStreamReaderFactor y
index.jsp
ClientBean-Java Code:<%-- Document : index Created on : Dec 21, 2010, 12:18:49 PM Author : 1088809 --%> <%@page contentType="text/html" pageEncoding="UTF-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>MyJSP</title> </head> <jsp:useBean id="eb" scope="request" class="learn.ClientBean" /> <jsp:setProperty name="eb" property="fname" param="f" /> <jsp:setProperty name="eb" property="lname" param="l" /> <jsp:setProperty name="eb" property="email" param="e" /> <jsp:getProperty name="eb" property="record" /> <body bgcolor="#000000" text="#ffffff"> <h1>Subscription Form</h1> <form action="index.jsp" method="GET" > <table width="30%" border="0" cellpadding="4"> <tr> <td>First Name: </td> <td><input type="text" id="f" name="f" size="15" value="${eb.fname}"/></td> </tr> <tr> <tr> <td>Last Name: </td> <td><input type="text" id="l" name="l" size="15" value="${eb.lname}"/></td> </tr> <tr> <td>Email:</td> <td><input type="text" id="e" name="e" size="15" value="${eb.email}"/></td> </tr> <tr> <td colspan="2"><div align="center"> <input name="Submit" type="Submit" value="Subscibe"/> </div></td> </tr> </table> <table width="30%" border="0" cellpadding="4"> <tr> <td> <% out.println(eb.getRecord());%> </td> </tr> </table> </form> </body> </html>
WS code-Java Code:package learn; import java.io.Serializable; public class ClientBean implements Serializable { CustomerPurchaseOrder proxy; private String _fname; private String _lname; private String _email; private String _record; public ClientBean() { }//end constructor public void setFname(String fname) { _fname = fname; } public String getFname() { return _fname; } public void setLname(String lname) { _lname = lname; } public String getLname() { return _lname; } public void setEmail(String Email) { _email = Email; } public String getEmail() { return _email; } public String getRecord() { WS service = new WS(); _record = service.createMember(_fname, _lname, _email); return _record; } }//end class
Java Code:package learn; public class WS { private CustomerPurchaseOrder proxy; private String _record; //CustomerPurchaseOrderService service = new CustomerPurchaseOrderService(); public WS() { CustomerPurchaseOrderService service = new CustomerPurchaseOrderService(); proxy = service.getCustomerPurchaseOrderPort(); }//end constructor public String createMember(String fn, String ln, String em) { _record = proxy.createMember(fn, ln, em); return _record; } }
- 12-22-2010, 08:46 AM #2
Moderator
- Join Date
- Apr 2009
- Posts
- 10,438
- Rep Power
- 16
What's the full error with stack trace?
- 12-22-2010, 09:15 AM #3
Member
- Join Date
- Nov 2009
- Posts
- 20
- Rep Power
- 0
Excuse my inexperience but where do I find the full error with stack trace?
- 12-22-2010, 09:53 AM #4
Moderator
- Join Date
- Apr 2009
- Posts
- 10,438
- Rep Power
- 16
Log files somewhere?
I don't know how you;re running this, or on what, so I can't say.
- 12-22-2010, 10:23 AM #5
Member
- Join Date
- Nov 2009
- Posts
- 20
- Rep Power
- 0
I found this in the output window.
Dec 21, 2010 6:00:29 PM : Retrieving Location: http://vle6.capella.edu:9038/WSPurch...erService?wsdl
Retrieved : http://vle6.capella.edu:9038/WSPurch...erService?wsdl
Saved at: C:\Documents and Settings\1088809\Desktop\ClientMember\src\conf\xml-resources\web-service-references\CustomerPurchaseOrderService\wsdl\vle6. capella.edu_9038\WSPurchaseOrder\CustomerPurchaseO rderService.wsdl
Retrieving Location: http://vle6.capella.edu:9038/WSPurch...rService?xsd=1
Found in document: http://vle6.capella.edu:9038/WSPurch...erService?wsdl
Retrieved : http://vle6.capella.edu:9038/WSPurch...rService?xsd=1
Saved at: C:\Documents and Settings\1088809\Desktop\ClientMember\src\conf\xml-resources\web-service-references\CustomerPurchaseOrderService\wsdl\vle6. capella.edu_9038\WSPurchaseOrder\CustomerPurchaseO rderService.xsd_1.xsd
- 12-22-2010, 10:25 AM #6
Moderator
- Join Date
- Apr 2009
- Posts
- 10,438
- Rep Power
- 16
Which is just some logging statements.
Where did you see the exception?
- 12-22-2010, 10:29 AM #7
Member
- Join Date
- Nov 2009
- Posts
- 20
- Rep Power
- 0
I saw the exception when I run the file in netbeans. The Glassfish v3 error report returns
type Exception report
message
descriptionThe server encountered an internal error () that prevented it from fulfilling this request.
exception
java.lang.NoClassDefFoundError: Could not initialize class com.sun.xml.ws.api.streaming.XMLStreamReaderFactor y
note The full stack traces of the exception and its root causes are available in the GlassFish v3 logs.
--------------------------------------------------------------------------------
- 12-22-2010, 10:30 AM #8
Moderator
- Join Date
- Apr 2009
- Posts
- 10,438
- Rep Power
- 16
Did you find the Glassfish v3 logs?
Or is that what you posted earlier?
- 12-22-2010, 10:31 AM #9
Member
- Join Date
- Nov 2009
- Posts
- 20
- Rep Power
- 0
No. this is what I already posted.
- 12-22-2010, 10:44 AM #10
Moderator
- Join Date
- Apr 2009
- Posts
- 10,438
- Rep Power
- 16
Then presumably there's either a setting for Glassfish to log things properly (which I know nothing about), or there is another log file somewhere.
- 12-22-2010, 10:50 AM #11
Member
- Join Date
- Nov 2009
- Posts
- 20
- Rep Power
- 0
I'll keep looking. I would really like to connect with my Web service.
Thanks for your help.
mark
- 12-22-2010, 10:55 AM #12
Moderator
- Join Date
- Apr 2009
- Posts
- 10,438
- Rep Power
- 16
It is likely you're missing a jar file in your apps classpath, but without the full stack trace it's hard to tell what jar file.
Have you treid writing a simple Java app that only connects to that web service?
Not a web app or anything.
Then you should be able to see any connection errors properly.
- 12-22-2010, 11:11 AM #13
Member
- Join Date
- Nov 2009
- Posts
- 20
- Rep Power
- 0
Yes. I have a desktop app that references the Web service. It does work already so the Web services are fine.
mark
- 12-22-2010, 11:12 AM #14
Moderator
- Join Date
- Apr 2009
- Posts
- 10,438
- Rep Power
- 16
At least that narrows it down.
Try sticking System.out.println() statements in and see what's going on.
- 12-22-2010, 11:22 AM #15
Member
- Join Date
- Nov 2009
- Posts
- 20
- Rep Power
- 0
My jsp page is now-
I addedJava Code:<%-- Document : index Created on : Dec 21, 2010, 12:18:49 PM Author : 1088809 --%> <%@page contentType="text/html" pageEncoding="UTF-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>MyJSP</title> </head> <jsp:useBean id="eb" scope="request" class="learn.ClientBean" /> <jsp:setProperty name="eb" property="fname" param="f" /> <jsp:setProperty name="eb" property="lname" param="l" /> <jsp:setProperty name="eb" property="email" param="e" /> <jsp:getProperty name="eb" property="record" /> <body bgcolor="#000000" text="#ffffff"> <h1>Subscription Form</h1> <form action="index.jsp" method="GET" > <table width="30%" border="0" cellpadding="4"> <tr> <td>First Name: </td> <td><input type="text" id="f" name="f" size="15" value="${eb.fname}"/></td> </tr> <tr> <tr> <td>Last Name: </td> <td><input type="text" id="l" name="l" size="15" value="${eb.lname}"/></td> </tr> <tr> <td>Email:</td> <td><input type="text" id="e" name="e" size="15" value="${eb.email}"/></td> </tr> <tr> <td colspan="2"><div align="center"> <input name="Submit" type="Submit" value="Subscibe" onClick="retrieveRecord()"/> </div></td> </tr> </table> <table width="30%" border="0" cellpadding="4"> <tr> <td> <%! String theRecord; String retrieveRecord() { theRecord = "Welcome "; return theRecord; } %> </td> <td> <%= System.out.println((retrieveRecord() + " " + eb.getRecord()))%> </td> </tr> </table> </form> </body> </html>
in the index.jsp page. the error is now-Java Code:<td> <%= System.out.println((retrieveRecord() + " " + eb.getRecord()))%> </td>
org.apache.jasper.JasperException: PWC6033: Error in Javac compilation for JSP
PWC6197: An error occurred at line: 70 in the jsp file: /index.jsp
PWC6199: Generated servlet error:
string:///index_jsp.java:136: 'void' type not allowed here
- 12-22-2010, 12:22 PM #16
Moderator
- Join Date
- Apr 2009
- Posts
- 10,438
- Rep Power
- 16
What line is line 70?
You really need to provide us this information.
And that looks like a flaky way of doing things to me.
- 12-22-2010, 01:48 PM #17
Member
- Join Date
- Nov 2009
- Posts
- 20
- Rep Power
- 0
My jsp page is now-
The error statesJava Code:<%-- Document : index Created on : Dec 21, 2010, 12:18:49 PM Author : 1088809 --%> <%@page contentType="text/html" pageEncoding="UTF-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>MyJSP</title> </head> <jsp:useBean id="eb" scope="request" class="learn.ClientBean" /> <jsp:setProperty name="eb" property="fname" param="f" /> <jsp:setProperty name="eb" property="lname" param="l" /> <jsp:setProperty name="eb" property="email" param="e" /> <body bgcolor="#000000" text="#ffffff"> <h1>Subscription Form</h1> <form action="index.jsp" method="GET" > <table width="30%" border="0" cellpadding="4"> <tr> <td>First Name: </td> <td><input type="text" id="f" name="f" size="15" value="${eb.fname}"/></td> </tr> <tr> <tr> <td>Last Name: </td> <td><input type="text" id="l" name="l" size="15" value="${eb.lname}"/></td> </tr> <tr> <td>Email:</td> <td><input type="text" id="e" name="e" size="15" value="${eb.email}"/></td> </tr> <tr> <td colspan="2"><div align="center"> <input name="Submit" type="Submit" value="Subscibe"/> </div></td> </tr> </table> <table width="30%" border="0" cellpadding="4"> <tr> <td> </td> <td> <%= System.out.println( eb.getRecord())%> </td> </tr> </table> </form> </body> </html>
java.lang.NoClassDefFoundError: Could not initialize class com.sun.xml.ws.api.streaming.XMLStreamReaderFactor y
The ClientBean-
The WS class-Java Code:package learn; import java.io.Serializable; public class ClientBean implements Serializable { CustomerPurchaseOrder proxy; private String _fname; private String _lname; private String _email; private String _record; public ClientBean() { }//end constructor public void setFname(String fname) { _fname = fname; } public String getFname() { return _fname; } public void setLname(String lname) { _lname = lname; } public String getLname() { return _lname; } public void setEmail(String Email) { _email = Email; } public String getEmail() { return _email; } public String getRecord() { WS service = new WS(); _record = service.createMember(_fname, _lname, _email); return _record; } }//end class
Java Code:package learn; public class WS { private CustomerPurchaseOrder proxy; private String _record; public WS() { CustomerPurchaseOrderService service = new CustomerPurchaseOrderService(); proxy = service.getCustomerPurchaseOrderPort(); }//end constructor public String createMember(String fn, String ln, String em) { _record = proxy.createMember(fn, ln, em); return _record; } }
- 12-22-2010, 01:50 PM #18
Member
- Join Date
- Nov 2009
- Posts
- 20
- Rep Power
- 0
Similar Threads
-
problem with XMPP service of Google App
By kievari in forum NetworkingReplies: 0Last Post: 08-04-2010, 05:01 PM -
deploy existing web project[class reference problem]
By runfast in forum EclipseReplies: 1Last Post: 10-13-2009, 10:38 AM -
javax.xml.ws.Service problem
By magnum99 in forum Advanced JavaReplies: 0Last Post: 10-08-2009, 06:10 PM -
Problem of Web Service
By nihongbin in forum XMLReplies: 1Last Post: 12-11-2008, 04:20 AM -
Problem while running web service client
By krsv36 in forum Other IDEsReplies: 0Last Post: 05-15-2008, 05:12 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks