Results 1 to 18 of 18
  1. #1
    mmarkym is offline Member
    Join Date
    Nov 2009
    Posts
    20
    Rep Power
    0

    Default 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
    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>
    ClientBean-


    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
    WS code-


    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;
    
            }
    
    
    }

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,008
    Rep Power
    20

    Default

    What's the full error with stack trace?

  3. #3
    mmarkym is offline Member
    Join Date
    Nov 2009
    Posts
    20
    Rep Power
    0

    Default

    Excuse my inexperience but where do I find the full error with stack trace?

  4. #4
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,008
    Rep Power
    20

    Default

    Log files somewhere?
    I don't know how you;re running this, or on what, so I can't say.

  5. #5
    mmarkym is offline Member
    Join Date
    Nov 2009
    Posts
    20
    Rep Power
    0

    Default

    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

  6. #6
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,008
    Rep Power
    20

    Default

    Which is just some logging statements.

    Where did you see the exception?

  7. #7
    mmarkym is offline Member
    Join Date
    Nov 2009
    Posts
    20
    Rep Power
    0

    Default

    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.


    --------------------------------------------------------------------------------

  8. #8
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,008
    Rep Power
    20

    Default

    Did you find the Glassfish v3 logs?
    Or is that what you posted earlier?

  9. #9
    mmarkym is offline Member
    Join Date
    Nov 2009
    Posts
    20
    Rep Power
    0

    Default

    No. this is what I already posted.

  10. #10
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,008
    Rep Power
    20

    Default

    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.

  11. #11
    mmarkym is offline Member
    Join Date
    Nov 2009
    Posts
    20
    Rep Power
    0

    Default

    I'll keep looking. I would really like to connect with my Web service.

    Thanks for your help.

    mark

  12. #12
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,008
    Rep Power
    20

    Default

    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.

  13. #13
    mmarkym is offline Member
    Join Date
    Nov 2009
    Posts
    20
    Rep Power
    0

    Default

    Yes. I have a desktop app that references the Web service. It does work already so the Web services are fine.

    mark

  14. #14
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,008
    Rep Power
    20

    Default

    At least that narrows it down.
    Try sticking System.out.println() statements in and see what's going on.

  15. #15
    mmarkym is offline Member
    Join Date
    Nov 2009
    Posts
    20
    Rep Power
    0

    Default

    My jsp page is now-
    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" 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>
    I added

    Java Code:
    <td>
                      <%= System.out.println((retrieveRecord() +  " " + eb.getRecord()))%>
                  </td>
    in the index.jsp page. the error is now-

    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

  16. #16
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,008
    Rep Power
    20

    Default

    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.

  17. #17
    mmarkym is offline Member
    Join Date
    Nov 2009
    Posts
    20
    Rep Power
    0

    Default

    My jsp page is now-

    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" />
        
    
        <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>
    The error states

    java.lang.NoClassDefFoundError: Could not initialize class com.sun.xml.ws.api.streaming.XMLStreamReaderFactor y

    The ClientBean-


    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
    The WS 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;
    
            }
    }

  18. #18
    mmarkym is offline Member
    Join Date
    Nov 2009
    Posts
    20
    Rep Power
    0

    Default

    I'm trying to access a CustomerPurchaseOrder Web service from class WS.

Similar Threads

  1. problem with XMPP service of Google App
    By kievari in forum Networking
    Replies: 0
    Last Post: 08-04-2010, 05:01 PM
  2. Replies: 1
    Last Post: 10-13-2009, 10:38 AM
  3. javax.xml.ws.Service problem
    By magnum99 in forum Advanced Java
    Replies: 0
    Last Post: 10-08-2009, 06:10 PM
  4. Problem of Web Service
    By nihongbin in forum XML
    Replies: 1
    Last Post: 12-11-2008, 04:20 AM
  5. Problem while running web service client
    By krsv36 in forum Other IDEs
    Replies: 0
    Last Post: 05-15-2008, 05:12 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •