0 Replies Latest reply on Feb 10, 2014 1:17 AM by Farooq Mahmood

    Error if http proxy information is in standalone.xml file.

    Farooq Mahmood Newbie

      Hi,

       

      I am getting problem to run a simple web server. After some investigation I come to know that

      If I remove the proxy information from the standalone.xml file the web site is working fine. Other wise getting ettor .

       

      Standalone.xml

      <system-properties>

              <property name="http.proxyHost" value="proxy.abc.xyz.edu.au"/>

              <property name="http.proxyPort" value="80"/>

              <property name="https.proxyHost" value="proxy.abc.xyz.edu.au"/>

              <property name="https.proxyPort" value="80"/>

              <property name="http.nonProxyHosts" value="localhostu"/>

              <property name="org.jboss.as.logging.per-deployment" value="false"/>

          </system-properties>

       

       

      Exception:

       

      16:51:11,780 DEBUG [org.apache.catalina.core] (http-localhost/127.0.0.1:8080-1) JBWEB001087: Error instantiating servlet class enterprise.hello_webserviceref_client1.TestServlet: java.lang.IllegalStateException: JBAS011048: Failed to construct component instance

        at org.jboss.as.ee.component.BasicComponent.constructComponentInstance(BasicComponent.java:163) [jboss-as-ee-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

        at org.jboss.as.ee.component.BasicComponent.createInstance(BasicComponent.java:85) [jboss-as-ee-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

        at org.jboss.as.web.deployment.component.WebComponentInstantiator$1.<init>(WebComponentInstantiator.java:57) [jboss-as-web-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

        at org.jboss.as.web.deployment.component.WebComponentInstantiator.getReference(WebComponentInstantiator.java:55) [jboss-as-web-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

        at org.jboss.as.web.deployment.WebInjectionContainer.instantiate(WebInjectionContainer.java:101) [jboss-as-web-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

        at org.jboss.as.web.deployment.WebInjectionContainer.newInstance(WebInjectionContainer.java:80) [jboss-as-web-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

        at org.jboss.as.web.deployment.WebInjectionContainer.newInstance(WebInjectionContainer.java:74) [jboss-as-web-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

        at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1154) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]

        at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:950) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]

        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:151) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]

        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:149) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]

        at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:169) [jboss-as-web-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:145) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]

        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:97) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]

        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:102) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]

        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:336) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]

        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]

        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:653) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]

        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:920) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]

        at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_09]

      Caused by: org.jboss.wsf.spi.WSFException: Cannot create service

        at org.jboss.wsf.spi.WSFException.rethrow(WSFException.java:55) [jbossws-spi-2.1.2.Final-redhat-1.jar:2.1.2.Final-redhat-1]

        at org.jboss.wsf.stack.cxf.client.serviceref.AbstractServiceObjectFactoryJAXWS.getObjectInstance(AbstractServiceObjectFactoryJAXWS.java:90)

        at org.jboss.wsf.stack.cxf.client.serviceref.CXFServiceRefFactoryImpl.newServiceRef(CXFServiceRefFactoryImpl.java:38)

        at org.jboss.as.webservices.webserviceref.WSRefValueSource.getValue(WSRefValueSource.java:70)

        at org.jboss.as.naming.ValueManagedReferenceFactory.getReference(ValueManagedReferenceFactory.java:50)

        at org.jboss.as.ee.component.ManagedReferenceFieldInjectionInterceptorFactory$ManagedReferenceFieldInjectionInterceptor.processInvocation(ManagedReferenceFieldInjectionInterceptorFactory.java:105) [jboss-as-ee-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

        at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

        at org.jboss.as.ee.component.ManagedReferenceInterceptorFactory$ManagedReferenceInterceptor.processInvocation(ManagedReferenceInterceptorFactory.java:95) [jboss-as-ee-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

        at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

        at org.jboss.as.ee.component.TCCLInterceptor.processInvocation(TCCLInterceptor.java:45) [jboss-as-ee-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

        at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

        at org.jboss.as.ee.component.BasicComponent.constructComponentInstance(BasicComponent.java:161) [jboss-as-ee-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

        ... 19 more

      Caused by: java.lang.reflect.InvocationTargetException

        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [rt.jar:1.7.0_09]

        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) [rt.jar:1.7.0_09]

        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) [rt.jar:1.7.0_09]

        at java.lang.reflect.Constructor.newInstance(Constructor.java:525) [rt.jar:1.7.0_09]

        at org.jboss.wsf.stack.cxf.client.serviceref.AbstractServiceObjectFactoryJAXWS.instantiateService(AbstractServiceObjectFactoryJAXWS.java:219)

        at org.jboss.wsf.stack.cxf.client.serviceref.AbstractServiceObjectFactoryJAXWS.getObjectInstance(AbstractServiceObjectFactoryJAXWS.java:68)

        ... 34 more

      Caused by: javax.xml.ws.WebServiceException: org.apache.cxf.service.factory.ServiceConstructionException: Failed to create service.

        at org.apache.cxf.jaxws.ServiceImpl.<init>(ServiceImpl.java:149)

        at org.jboss.wsf.stack.cxf.client.ProviderImpl$JBossWSServiceImpl.<init>(ProviderImpl.java:479)

        at org.jboss.wsf.stack.cxf.client.ProviderImpl.createServiceDelegate(ProviderImpl.java:190)

        at javax.xml.ws.Service.<init>(Service.java:63) [jboss-jaxws-api_2.2_spec-2.0.1.Final-redhat-2.jar:2.0.1.Final-redhat-2]

        at enterprise.hello_webserviceref_client1.HelloService.<init>(HelloService.java:62) [classes:]

        ... 40 more

      Caused by: org.apache.cxf.service.factory.ServiceConstructionException: Failed to create service.

        at org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:100)

        at org.apache.cxf.jaxws.ServiceImpl.initializePorts(ServiceImpl.java:203)

        at org.apache.cxf.jaxws.ServiceImpl.<init>(ServiceImpl.java:147)

        ... 44 more

      Caused by: javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF; was expecting a close tag for element <HTML>

      at [row,col,system-id]: [4,0,"http://localhost:8080/hello-webserviceref/Hello?wsdl"]

        at org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:243)

        at org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.java:192)

        at org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:98)

        ... 46 more

      Caused by: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF; was expecting a close tag for element <HTML>

      at [row,col,system-id]: [4,0,"http://localhost:8080/hello-webserviceref/Hello?wsdl"]

        at com.ctc.wstx.sr.StreamScanner.throwUnexpectedEOF(StreamScanner.java:677)

        at com.ctc.wstx.sr.BasicStreamReader.throwUnexpectedEOF(BasicStreamReader.java:5532)

        at com.ctc.wstx.sr.BasicStreamReader.nextFromTree(BasicStreamReader.java:2720)

        at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1072)

        at org.apache.cxf.staxutils.StaxUtils.readDocElements(StaxUtils.java:1250)

        at org.apache.cxf.staxutils.StaxUtils.readDocElements(StaxUtils.java:1144)

        at org.apache.cxf.staxutils.StaxUtils.read(StaxUtils.java:1071)

        at org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:234)

        ... 48 more

       

       

      16:51:11,785 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/hello-webserviceref-client].[webclient]] (http-localhost/127.0.0.1:8080-1) JBWEB000235: Allocate exception for servlet webclient: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF; was expecting a close tag for element <HTML>

      at [row,col,system-id]: [4,0,"http://localhost:8080/hello-webserviceref/Hello?wsdl"]

        at com.ctc.wstx.sr.StreamScanner.throwUnexpectedEOF(StreamScanner.java:677)

        at com.ctc.wstx.sr.BasicStreamReader.throwUnexpectedEOF(BasicStreamReader.java:5532)

        at com.ctc.wstx.sr.BasicStreamReader.nextFromTree(BasicStreamReader.java:2720)

        at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1072)

        at org.apache.cxf.staxutils.StaxUtils.readDocElements(StaxUtils.java:1250)

        at org.apache.cxf.staxutils.StaxUtils.readDocElements(StaxUtils.java:1144)

        at org.apache.cxf.staxutils.StaxUtils.read(StaxUtils.java:1071)

        at org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:234)

        at org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.java:192)

        at org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:98)

        at org.apache.cxf.jaxws.ServiceImpl.initializePorts(ServiceImpl.java:203)

        at org.apache.cxf.jaxws.ServiceImpl.<init>(ServiceImpl.java:147)

        at org.jboss.wsf.stack.cxf.client.ProviderImpl$JBossWSServiceImpl.<init>(ProviderImpl.java:479)

        at org.jboss.wsf.stack.cxf.client.ProviderImpl.createServiceDelegate(ProviderImpl.java:190)

        at javax.xml.ws.Service.<init>(Service.java:63) [jboss-jaxws-api_2.2_spec-2.0.1.Final-redhat-2.jar:2.0.1.Final-redhat-2]

        at enterprise.hello_webserviceref_client1.HelloService.<init>(HelloService.java:62) [classes:]

        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [rt.jar:1.7.0_09]

        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) [rt.jar:1.7.0_09]

        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) [rt.jar:1.7.0_09]

        at java.lang.reflect.Constructor.newInstance(Constructor.java:525) [rt.jar:1.7.0_09]

        at org.jboss.wsf.stack.cxf.client.serviceref.AbstractServiceObjectFactoryJAXWS.instantiateService(AbstractServiceObjectFactoryJAXWS.java:219)

        at org.jboss.wsf.stack.cxf.client.serviceref.AbstractServiceObjectFactoryJAXWS.getObjectInstance(AbstractServiceObjectFactoryJAXWS.java:68)

        at org.jboss.wsf.stack.cxf.client.serviceref.CXFServiceRefFactoryImpl.newServiceRef(CXFServiceRefFactoryImpl.java:38)

        at org.jboss.as.webservices.webserviceref.WSRefValueSource.getValue(WSRefValueSource.java:70)

        at org.jboss.as.naming.ValueManagedReferenceFactory.getReference(ValueManagedReferenceFactory.java:50)

        at org.jboss.as.ee.component.ManagedReferenceFieldInjectionInterceptorFactory$ManagedReferenceFieldInjectionInterceptor.processInvocation(ManagedReferenceFieldInjectionInterceptorFactory.java:105) [jboss-as-ee-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

        at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

        at org.jboss.as.ee.component.ManagedReferenceInterceptorFactory$ManagedReferenceInterceptor.processInvocation(ManagedReferenceInterceptorFactory.java:95) [jboss-as-ee-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

        at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

        at org.jboss.as.ee.component.TCCLInterceptor.processInvocation(TCCLInterceptor.java:45) [jboss-as-ee-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

        at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

        at org.jboss.as.ee.component.BasicComponent.constructComponentInstance(BasicComponent.java:161) [jboss-as-ee-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

        at org.jboss.as.ee.component.BasicComponent.createInstance(BasicComponent.java:85) [jboss-as-ee-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

        at org.jboss.as.web.deployment.component.WebComponentInstantiator$1.<init>(WebComponentInstantiator.java:57) [jboss-as-web-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

        at org.jboss.as.web.deployment.component.WebComponentInstantiator.getReference(WebComponentInstantiator.java:55) [jboss-as-web-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

        at org.jboss.as.web.deployment.WebInjectionContainer.instantiate(WebInjectionContainer.java:101) [jboss-as-web-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

        at org.jboss.as.web.deployment.WebInjectionContainer.newInstance(WebInjectionContainer.java:80) [jboss-as-web-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

        at org.jboss.as.web.deployment.WebInjectionContainer.newInstance(WebInjectionContainer.java:74) [jboss-as-web-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

        at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1154) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]

        at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:950) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]

        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:151) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]

        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:149) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]

        at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:169) [jboss-as-web-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:145) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]

        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:97) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]

        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:102) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]

        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:336) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]

        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]

        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:653) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]

        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:920) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]

        at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_09]

       

      Web Service:

       

      @MTOM

      @WebService

      public class Hello

      {

          public String getHello(String name)

          {

              return "Hello " + name + "!";

          }

       

       

          public byte[] getHelloBinary(byte[] name) {

              try {

              String nameStr = new String(name,"UTF-8");       

              return ("Hello " + nameStr + "!").getBytes("UTF-8");

              } catch(java.io.UnsupportedEncodingException ex) {

                throw new WebServiceException(ex);

              }

       

       

          }

      }

       

      Web Service Client:

       

      public class TestServlet extends HttpServlet {

          @MTOM

          @javax.xml.ws.WebServiceRef(HelloService.class)

          Hello port;

       

       

          @Override

          protected void service(HttpServletRequest req, HttpServletResponse res)

                  throws IOException, ServletException {

              System.out.println("1: service");

              try {

                  String userName = "Duke";

                  if (req.getParameter("userName") != null) {

                      userName = req.getParameter("userName");

                  }

       

       

                  byte[] ret = port.getHelloBinary(userName.getBytes("UTF-8"));

                  PrintWriter writer = res.getWriter();

                  writer.write(new String(ret,"UTF-8"));

              }

              catch (Exception e) {

                  e.printStackTrace();

              }

       

       

          }

      }