0 Replies Latest reply on Jun 6, 2014 3:41 AM by wuqian2huangchangsong

    Visit wildfly  webservice has a warning

    wuqian2huangchangsong

      I create an EJB project,and add the annotation “@Webservice” "@WebMethod",than deploy it to the wildfly

      the wildfly log:

      15:27:08,289 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-3) JBAS017535: Unregistered web context: /UserBean
      15:27:08,295 INFO  [org.jboss.as.webservices] (MSC service thread 1-4) JBAS015540: Stopping service jboss.ws.endpoint."UserBean.jar".UserDAOBean
      15:27:08,297 INFO  [org.jboss.as.jpa] (ServerService Thread Pool -- 54) JBAS011410: Stopping Persistence Unit (phase 2 of 2) Service 'UserBean.jar#UserBean'
      15:27:08,298 INFO  [org.jboss.weld.deployer] (MSC service thread 1-6) JBAS016009: Stopping weld service for deployment UserBean.jar
      15:27:08,312 INFO  [org.jboss.as.jpa] (ServerService Thread Pool -- 54) JBAS011410: Stopping Persistence Unit (phase 1 of 2) Service 'UserBean.jar#UserBean'
      15:27:08,315 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-2) JBAS015877: Stopped deployment UserBean.jar (runtime-name: UserBean.jar) in 30ms
      15:27:08,389 INFO  [org.jboss.as.server] (management-handler-thread - 7) JBAS018558: Undeployed "UserBean.jar" (runtime-name: "UserBean.jar")
      15:27:08,418 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-1) JBAS015876: Starting deployment of "UserBean.jar" (runtime-name: "UserBean.jar")
      15:27:08,428 INFO  [org.jboss.as.jpa] (MSC service thread 1-5) JBAS011401: Read persistence.xml for UserBean
      15:27:08,444 INFO  [org.jboss.as.jpa] (ServerService Thread Pool -- 54) JBAS011409: Starting Persistence Unit (phase 1 of 2) Service 'UserBean.jar#UserBean'
      15:27:08,445 INFO  [org.hibernate.jpa.internal.util.LogHelper] (ServerService Thread Pool -- 54) HHH000204: Processing PersistenceUnitInfo [
          name: UserBean
          ...]
      15:27:08,456 INFO  [org.jboss.weld.deployer] (MSC service thread 1-4) JBAS016002: Processing weld deployment UserBean.jar
      15:27:08,459 INFO  [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-4) JNDI bindings for session bean named UserDAOBean in deployment unit deployment "UserBean.jar" are as follows:
      
          java:global/UserBean/UserDAOBean!com.imagin.entity.UserDAO
          java:app/UserBean/UserDAOBean!com.imagin.entity.UserDAO
          java:module/UserDAOBean!com.imagin.entity.UserDAO
          java:jboss/exported/UserBean/UserDAOBean!com.imagin.entity.UserDAO
      
      15:27:08,494 INFO  [org.jboss.weld.deployer] (MSC service thread 1-2) JBAS016005: Starting Services for CDI deployment: UserBean.jar
      15:27:08,497 INFO  [org.jboss.ws.cxf.metadata] (MSC service thread 1-2) JBWS024061: Adding service endpoint metadata: id=UserDAOBean
       address=http://localhost:8080/UserBean/UserDAOBean
       implementor=com.imagin.entity.UserDAOBean
       serviceName={http://entity.imagin.com/}UserDAOBeanService
       portName={http://entity.imagin.com/}UserDAOBeanPort
       annotationWsdlLocation=null
       wsdlLocationOverride=null
       mtomEnabled=false
      15:27:08,512 INFO  [org.apache.cxf.service.factory.ReflectionServiceFactoryBean] (MSC service thread 1-2) Creating Service {http://entity.imagin.com/}UserDAOBeanService from class com.imagin.entity.UserDAO
      15:27:08,548 INFO  [org.apache.cxf.endpoint.ServerImpl] (MSC service thread 1-2) Setting the server's publish address to be http://localhost:8080/UserBean/UserDAOBean
      15:27:08,587 INFO  [org.jboss.ws.cxf.deployment] (MSC service thread 1-2) JBWS024074: WSDL published to: file:/home/imagin/wildfly-8.0.0.Final/standalone/data/wsdl/UserBean.jar/UserDAOBeanService.wsdl
      15:27:08,590 INFO  [org.jboss.as.webservices] (MSC service thread 1-4) JBAS015539: Starting service jboss.ws.endpoint."UserBean.jar".UserDAOBean
      15:27:08,591 INFO  [org.jboss.weld.deployer] (MSC service thread 1-1) JBAS016008: Starting weld service for deployment UserBean.jar
      15:27:08,599 INFO  [org.jboss.as.jpa] (ServerService Thread Pool -- 54) JBAS011409: Starting Persistence Unit (phase 2 of 2) Service 'UserBean.jar#UserBean'
      15:27:08,619 INFO  [org.hibernate.dialect.Dialect] (ServerService Thread Pool -- 54) HHH000400: Using dialect: org.hibernate.dialect.PostgreSQL9Dialect
      15:27:08,619 INFO  [org.hibernate.engine.jdbc.internal.LobCreatorBuilder] (ServerService Thread Pool -- 54) HHH000424: Disabling contextual LOB creation as createClob() method threw error : java.lang.reflect.InvocationTargetException
      15:27:08,623 INFO  [org.hibernate.hql.internal.ast.ASTQueryTranslatorFactory] (ServerService Thread Pool -- 54) HHH000397: Using ASTQueryTranslatorFactory
      15:27:08,640 INFO  [org.hibernate.tool.hbm2ddl.SchemaUpdate] (ServerService Thread Pool -- 54) HHH000228: Running hbm2ddl schema update
      15:27:08,640 INFO  [org.hibernate.tool.hbm2ddl.SchemaUpdate] (ServerService Thread Pool -- 54) HHH000102: Fetching database metadata
      15:27:08,641 INFO  [org.hibernate.tool.hbm2ddl.SchemaUpdate] (ServerService Thread Pool -- 54) HHH000396: Updating schema
      15:27:08,663 INFO  [org.hibernate.tool.hbm2ddl.TableMetadata] (ServerService Thread Pool -- 54) HHH000261: Table found: public.imagin_user
      15:27:08,664 INFO  [org.hibernate.tool.hbm2ddl.TableMetadata] (ServerService Thread Pool -- 54) HHH000037: Columns: [userpwd, username, lasttimedate, useremail, userid, codenum, lastip]
      15:27:08,664 INFO  [org.hibernate.tool.hbm2ddl.TableMetadata] (ServerService Thread Pool -- 54) HHH000108: Foreign keys: []
      15:27:08,664 INFO  [org.hibernate.tool.hbm2ddl.TableMetadata] (ServerService Thread Pool -- 54) HHH000126: Indexes: [imagin_user_pkey, uk_pvftlispet6ftmhm0d7gt8ocj, uk_7vcqmn1u1c0d3g23q3elce17w]
      15:27:08,665 INFO  [org.hibernate.tool.hbm2ddl.SchemaUpdate] (ServerService Thread Pool -- 54) HHH000232: Schema update complete
      15:27:08,918 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-1) JBAS017534: Registered web context: /UserBean
      15:27:09,078 INFO  [org.jboss.as.server] (management-handler-thread - 8) JBAS018559: Deployed "UserBean.jar" (runtime-name : "UserBean.jar")
      
      

       

      than I create a java client

      public static void main(String[] args) throws MalformedURLException {
              // TODO Auto-generated method stub
              QName qName = new QName("http://entity.imagin.com/","UserDAOBeanService");
              URL url = new URL("http://192.168.1.160:8080/UserBean/UserDAOBean");
              Service service = Service.create(url, qName);
              UserDAO dao = service.getPort(UserDAO.class);
              //User u = new User("wj", "wj55555", "15216175551@163.com");
              //dao.addUser(u);
              String name = "hcs";
              User user = dao.getUserByName(name);
              if(user.getUserName().equals("name")){
                  System.out.println("there is not a user named:"+name);
              }
              else{
                  System.out.println(user.toString());
              }
              
              //System.out.println(dao.getAllUser().size());
              Object[] users = dao.getAllUser();
              
              System.out.println(users.length);
              for (int i = 0; i < users.length; i++) {
                  System.out.println(users[i].toString());
              }
              
      
          }
      

      That is my service log,when I visit it;

      15:39:14,284 WARNING [org.apache.cxf.phase.PhaseInterceptorChain] (default task-15) Interceptor for {http://entity.imagin.com/}UserDAOBeanService has thrown exception, unwinding now: java.lang.NullPointerException
          at org.apache.cxf.service.factory.SimpleMethodDispatcher.getMethod(SimpleMethodDispatcher.java:97)
          at org.jboss.wsf.stack.cxf.JBossWSInvoker.invoke(JBossWSInvoker.java:129)
          at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:57)
          at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [rt.jar:1.7.0_25]
          at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) [rt.jar:1.7.0_25]
          at java.util.concurrent.FutureTask.run(FutureTask.java:166) [rt.jar:1.7.0_25]
          at org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37)
          at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:106)
          at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:272)
          at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
          at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:239)
          at org.jboss.wsf.stack.cxf.RequestHandlerImpl.handleHttpRequest(RequestHandlerImpl.java:92)
          at org.jboss.wsf.stack.cxf.transport.ServletHelper.callRequestHandler(ServletHelper.java:143)
          at org.jboss.wsf.stack.cxf.CXFServletExt.invoke(CXFServletExt.java:87)
          at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:286)
          at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doGet(AbstractHTTPServlet.java:211)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:687) [jboss-servlet-api_3.1_spec-1.0.0.Final.jar:1.0.0.Final]
          at org.jboss.wsf.stack.cxf.CXFServletExt.service(CXFServletExt.java:135)
          at org.jboss.wsf.spi.deployment.WSFServlet.service(WSFServlet.java:140) [jbossws-spi-2.2.2.Final.jar:2.2.2.Final]
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) [jboss-servlet-api_3.1_spec-1.0.0.Final.jar:1.0.0.Final]
          at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85)
          at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:61)
          at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
          at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
          at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25)
          at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:113)
          at io.undertow.security.handlers.AuthenticationCallHandler.handleRequest(AuthenticationCallHandler.java:52)
          at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:45)
          at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:61)
          at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:70)
          at io.undertow.security.handlers.SecurityInitialHandler.handleRequest(SecurityInitialHandler.java:76)
          at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25)
          at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
          at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25)
          at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25)
          at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:240)
          at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:227)
          at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:73)
          at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:146)
          at io.undertow.server.Connectors.executeRootHandler(Connectors.java:168)
          at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:687)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_25]
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_25]
          at java.lang.Thread.run(Thread.java:724) [rt.jar:1.7.0_25]
      


      I can get the result,in the my computer(server computer).And it bring the warning at the same time.

      And I can't get the result, in other computers.because of "connect refuse" .

      Sorry for my English.

      Thanks, first!