Netbeans - Error con Web Services

   
Vista:

Error con Web Services

Publicado por Aroldo (1 intervención) el 11/10/2016 18:05:04
Que tal amigos, estoy trabajando un web services y al momento de hacer el build no me da error pero al probar un metodo me sale este error:

WS00041: Service invocation threw an exception with message : null; Refer to the server log for more details
Exceptions details : java.lang.NullPointerException

javax.servlet.ServletException: java.lang.NullPointerException at org.glassfish.webservices.monitoring.WebServiceTesterServlet.doPost(WebServiceTesterServlet.java:342) at org.glassfish.webservices.monitoring.WebServiceTesterServlet.invoke(WebServiceTesterServlet.java:106) at org.glassfish.webservices.JAXWSServlet.doPost(JAXWSServlet.java:157) at javax.servlet.http.HttpServlet.service(HttpServlet.java:707) at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1682) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:318) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:160) at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:734) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:673) at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:174) at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:416) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:283) at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:459) at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:167) at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:206) at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:180) at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:235) at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119) at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:283) at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:200) at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:132) at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:111) at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77) at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:536) at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112) at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:117) at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:56) at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:137) at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:591) at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:571) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.NullPointerException at org.glassfish.webservices.monitoring.WebServiceTesterServlet.doPost(WebServiceTesterServlet.java:313) ... 32 more.

Mi codigo lo tengo asi:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package com.ws.webservices;
 
import java.sql.Statement;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import javax.jws.WebService;
import javax.jws.WebMethod;
import javax.jws.WebParam;
 
@WebService(serviceName = "SABWebService")
public class SABWebService {
    /**
     * Web service operation
     */
    @WebMethod(operationName = "proceso06")
    public classProceso06 proceso06(@WebParam(name = "p1") String p1, @WebParam(name = "p2") String p2, @WebParam(name = "p3") String p3, @WebParam(name = "p4") String p4) {
 
        String conexionDB="jdbc:sqlserver://sqllocal:1433; databaseName=DBTEST; user=sa; password=miclave";
        Connection conexion = null;
        Statement stmt = null;
        ResultSet rs = null;
        classProceso06 proceso06 = null;
 
        try{
            Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
            conexion = DriverManager.getConnection(conexionDB);
            String SQL = "SELECT SA.SERIAL, A.DESCRIPCION, SA.DESRCIPCION"
                                                            + "FROM [IF].IF_AGENTES A INNER JOIN [IF].IF_SUB_AGENTES SA ON SA.AGENTEID = A.AGENTEID"
                                                            + "WHERE SA.COD_USUARIO = '" + p1 + "' AND SA.CLAVE = '" + p2 + "' AND SA.IMEI = '" + p3 + "'";
            stmt = conexion.createStatement();
            rs = stmt.executeQuery(SQL);
 
            if (rs.next()){
                proceso06 = new classProceso06();
                proceso06.setimpresora("impresora");
                proceso06.setagente("agente");
                proceso06.setsagente("subagente");
                return proceso06;
            }
        } catch (Exception e){e.toString();}
        return null;
    }
}
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

Error con Web Services

Publicado por Lorena (1 intervención) el 24/08/2017 06:14:37
A mi me ocurre exactamente lo mismo. Es el mismo error. Auxilio por favor
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar