Link to home
Create AccountLog in
Avatar of PraveenKumarGautam
PraveenKumarGautam

asked on

Exception while Calling a Web Service

Hi,

I am trying to call a webservice using the following code

try {
      QName qname=new QName("http://somepackagename","CpwsImpl");
          String webServiceAddr = ConfigFile.getConfigKey( fips,
                                               INFO_SECTION,
                                               WEB_SERVICE_ADDRESS );
          URL url=new URL(webServiceAddr);
          Service cpws=Service.create(url, qname);
          CpwsImpl  cpwsImpl=cpws.getPort(qname, CpwsImpl.class);
          return cpwsImpl;
      } catch (Exception ex) {
          ex.printStackTrace();
      }

but when I execute the program I am getting the following error

java.lang.TypeNotPresentException: Type byte not present
	at sun.reflect.generics.factory.CoreReflectionFactory.makeNamedType(CoreReflectionFactory.java:98)
	at sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:107)
	at sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:31)
	at sun.reflect.generics.visitor.Reifier.visitArrayTypeSignature(Reifier.java:141)
	at sun.reflect.generics.tree.ArrayTypeSignature.accept(ArrayTypeSignature.java:24)
	at sun.reflect.generics.repository.FieldRepository.getGenericType(FieldRepository.java:67)
	at java.lang.reflect.Field.getGenericType(Field.java:223)
	at com.sun.xml.internal.bind.v2.model.nav.ReflectionNavigator.getFieldType(ReflectionNavigator.java:262)
	at com.sun.xml.internal.bind.v2.model.nav.ReflectionNavigator.getFieldType(ReflectionNavigator.java:47)
	at com.sun.xml.internal.bind.v2.model.impl.FieldPropertySeed.getRawType(FieldPropertySeed.java:63)
	at com.sun.xml.internal.bind.v2.model.impl.RuntimeClassInfoImpl$RuntimePropertySeed.getRawType(RuntimeClassInfoImpl.java:304)
	at com.sun.xml.internal.bind.v2.model.impl.RuntimeClassInfoImpl$RuntimePropertySeed.getRawType(RuntimeClassInfoImpl.java:278)
	at com.sun.xml.internal.bind.v2.model.impl.PropertyInfoImpl.<init>(PropertyInfoImpl.java:108)
	at com.sun.xml.internal.bind.v2.model.impl.ERPropertyInfoImpl.<init>(ERPropertyInfoImpl.java:42)
	at com.sun.xml.internal.bind.v2.model.impl.ElementPropertyInfoImpl.<init>(ElementPropertyInfoImpl.java:85)
	at com.sun.xml.internal.bind.v2.model.impl.RuntimeElementPropertyInfoImpl.<init>(RuntimeElementPropertyInfoImpl.java:48)
	at com.sun.xml.internal.bind.v2.model.impl.RuntimeClassInfoImpl.createElementProperty(RuntimeClassInfoImpl.java:154)
	at com.sun.xml.internal.bind.v2.model.impl.ClassInfoImpl.addProperty(ClassInfoImpl.java:857)
	at com.sun.xml.internal.bind.v2.model.impl.ClassInfoImpl.findFieldProperties(ClassInfoImpl.java:387)
	at com.sun.xml.internal.bind.v2.model.impl.ClassInfoImpl.getProperties(ClassInfoImpl.java:290)
	at com.sun.xml.internal.bind.v2.model.impl.RuntimeClassInfoImpl.getProperties(RuntimeClassInfoImpl.java:165)
	at com.sun.xml.internal.bind.v2.model.impl.ModelBuilder.getClassInfo(ModelBuilder.java:232)
	at com.sun.xml.internal.bind.v2.model.impl.RuntimeModelBuilder.getClassInfo(RuntimeModelBuilder.java:89)
	at com.sun.xml.internal.bind.v2.model.impl.RuntimeModelBuilder.getClassInfo(RuntimeModelBuilder.java:70)
	at com.sun.xml.internal.bind.v2.model.impl.ModelBuilder.getClassInfo(ModelBuilder.java:198)
	at com.sun.xml.internal.bind.v2.model.impl.RuntimeModelBuilder.getClassInfo(RuntimeModelBuilder.java:84)
	at com.sun.xml.internal.bind.v2.model.impl.RuntimeModelBuilder.getClassInfo(RuntimeModelBuilder.java:70)
	at com.sun.xml.internal.bind.v2.model.impl.ModelBuilder.getTypeInfo(ModelBuilder.java:304)
	at com.sun.xml.internal.bind.v2.model.impl.ModelBuilder.getTypeInfo(ModelBuilder.java:319)
	at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:430)
	at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:277)
	at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(JAXBContextImpl.java:1100)
	at com.sun.xml.internal.bind.v2.ContextFactory.createContext(ContextFactory.java:143)
	at com.sun.xml.internal.bind.api.JAXBRIContext.newInstance(JAXBRIContext.java:95)
	at com.sun.xml.internal.ws.developer.JAXBContextFactory$1.createJAXBContext(JAXBContextFactory.java:97)
	at com.sun.xml.internal.ws.model.AbstractSEIModelImpl$1.run(AbstractSEIModelImpl.java:148)
	at com.sun.xml.internal.ws.model.AbstractSEIModelImpl$1.run(AbstractSEIModelImpl.java:140)
	at java.security.AccessController.doPrivileged(Native Method)
	at com.sun.xml.internal.ws.model.AbstractSEIModelImpl.createJAXBContext(AbstractSEIModelImpl.java:140)
	at com.sun.xml.internal.ws.model.AbstractSEIModelImpl.postProcess(AbstractSEIModelImpl.java:83)
	at com.sun.xml.internal.ws.model.RuntimeModeler.buildRuntimeModel(RuntimeModeler.java:244)
	at com.sun.xml.internal.ws.client.WSServiceDelegate.createSEIPortInfo(WSServiceDelegate.java:687)
	at com.sun.xml.internal.ws.client.WSServiceDelegate.addSEI(WSServiceDelegate.java:675)
	at com.sun.xml.internal.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:330)
	at com.sun.xml.internal.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:313)
	at com.sun.xml.internal.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:295)
	at javax.xml.ws.Service.getPort(Service.java:92)
	at com.firstam.common.AbstractStreamProgram.getWebService(AbstractStreamProgram.java:67)

Open in new window


Can someone let me know what could be the issue. Any help will be great.
ASKER CERTIFIED SOLUTION
Avatar of garypfirstech
garypfirstech

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account