[JBossWS] - jbossws in applet with jdk 1.5, signed jars, SecurityExcepti
by suvigy
Hi All!
Is it possible to create webservice client in applet with wsconsume? I tried it, but I keep getting error, I signed all the jars as well as the applet:
java.lang.ExceptionInInitializerError
| at org.jboss.ws.core.jaxws.DynamicWrapperGenerator.init(DynamicWrapperGenerator.java:67)
| at org.jboss.ws.core.jaxws.DynamicWrapperGenerator.<init>(DynamicWrapperGenerator.java:62)
| at org.jboss.ws.metadata.builder.jaxws.JAXWSMetaDataBuilder.initWrapperGenerator(JAXWSMetaDataBuilder.java:902)
| at org.jboss.ws.metadata.builder.jaxws.JAXWSMetaDataBuilder.resetMetaDataBuilder(JAXWSMetaDataBuilder.java:908)
| at org.jboss.ws.metadata.builder.jaxws.JAXWSClientMetaDataBuilder.rebuildEndpointMetaData(JAXWSClientMetaDataBuilder.java:273)
| at org.jboss.ws.core.jaxws.spi.ServiceDelegateImpl.getPortInternal(ServiceDelegateImpl.java:262)
| at org.jboss.ws.core.jaxws.spi.ServiceDelegateImpl.getPort(ServiceDelegateImpl.java:193)
| at javax.xml.ws.Service.getPort(Service.java:116)
| at applettest.ws.TestServiceService.getTestServicePort(TestServiceService.java:50)
| at applettest.WSTest.init(WSTest.java:21)
| at sun.applet.AppletPanel.run(Unknown Source)
| at java.lang.Thread.run(Unknown Source)
| Caused by: java.security.AccessControlException: access denied (java.lang.RuntimePermission accessDeclaredMembers)
| at java.security.AccessControlContext.checkPermission(Unknown Source)
| at java.security.AccessController.checkPermission(Unknown Source)
| at java.lang.SecurityManager.checkPermission(Unknown Source)
| at java.lang.SecurityManager.checkMemberAccess(Unknown Source)
| at java.lang.Class.checkMemberAccess(Unknown Source)
| at java.lang.Class.getDeclaredMethod(Unknown Source)
| at javassist.ClassPool$1.run(ClassPool.java:78)
| at java.security.AccessController.doPrivileged(Native Method)
| at javassist.ClassPool.<clinit>(ClassPool.java:75)
| ... 12 more
|
It comes from the javassist, doesn't it?
My webservice is a simple Hello World Service:
@WebService
| public class TestService {
|
| @WebMethod
| public String hello(String name) {
| return "Hello "+name+"!";
| }
|
|
| }
|
The applet simply displays the return value in a label. It works fine as a normal application, but not in applet enviroment.
The included jars in the applet (the s beginning means that it is signed):
| <applet code="applettest.WSTest.class" archive="jar/sapplettest.jar, jar/sjboss-jaxws.jar,jar/sjaxb-api.jar, jar/sjaxb-impl.jar, jar/sjaxb-xjc.jar, jar/sjboss-common-client.jar, jar/sjbossws-spi.jar, jar/sjboss-xml-binding.jar, jar/sxercesImpl.jar, jar/sjbossws-client.jar, jar/sjbossws-common.jar, jar/sjboss-jaxrpc, jar/sactivation.jar, jar/sjboss-saaj.jar jar/smail.jar, jar/swsdl4j.jar, jar/sconcurrent.jar, jar/spolicy.jar, jar/scommons-logging.jar, jar/slog4j.jar, jar/sjavassist.jar, jar/sstax-api.jar, jar/sgetopt.jar" width="200" height="200" >
On the client and server side I have jdk1.5.0_5
Jboss 4.2.2Ga
Is it actually possible to create jbossws client for applet? (And how about the jdk 1.6)
Any Idea?
Thnx
George
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4113189#4113189
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4113189
17 years
[JBossWS] - return type polymorphism issue, please help
by beligum
Hi all, I guess this should be easy for some of you experts, so I hope to get an answer here, after searching for this bug for a couple of hours now.
Here's the situation:
| @XmlJavaTypeAdapter(AbstractInodeImpl.Adapter.class)
| public interface Inode extends Serializable, Comparable<Inode>, Cloneable
| {
| //definition of getters,setters,...
| }
|
| @Entity
| @Table(name="inode")
| @Inheritance(strategy=InheritanceType.SINGLE_TABLE)
| @DiscriminatorColumn(
| name="type",
| discriminatorType=DiscriminatorType.STRING
| )
|
| @XmlSeeAlso({FileInode.class, DirectoryInode.class})
| public abstract class AbstractInodeImpl implements Inode
| {
| //implementation of getters,setters,...
|
| static public class Adapter extends XmlAdapter<AbstractInodeImpl, Inode>
| {
| public Inode unmarshal(AbstractInodeImpl v)
| {
| return v;
| }
| public AbstractInodeImpl marshal(Inode v)
| {
| return (AbstractInodeImpl)v;
| }
| }
| }
|
| @Entity
| @Name("directoryInode")
| @DiscriminatorValue("directory")
| public class DirectoryInode extends AbstractInodeImpl implements Serializable
| {
| // more implementation
| }
|
| @Entity
| @Name("fileInode")
| @DiscriminatorValue("file")
| public class FileInode extends AbstractInodeImpl implements Serializable
| {
| // even more...
| }
|
| @Stateless
| @WebService(name = "FileSystemService", serviceName = "FileSystemService")
| @Name("fileSystemService")
| @WebContext(contextRoot="/tumbolia/services", urlPattern="/FileSystemService")
| public class FileSystemServiceImpl implements FileSystemService, Serializable
| {
| @WebMethod
| public List<Inode> getAllChildren(String inodePath)
| {
| List<Inode> children = ((FileSystemManager)Component.getInstance("fileSystemManager", true)).getInodePathChildren(inodePath);
|
| return children;
| }
| }
|
I generate my JAXB beans with wsconsume or wsimport (have tried both) from the wsdl that was automatically generated.
When I call the webservice in the last bean, I get this exception:
| [javax.xml.bind.UnmarshalException: Unable to create an instance of com.acepostproduction.tumbolia.webservice.AbstractInodeImpl
| - with linked exception:
| [java.lang.InstantiationException]]
| com.acepostproduction.virtuolia.exceptions.WsException: [TumboliaFileSystemCommunicator] Error while calling getAllChildren(): javax.xml.bind.UnmarshalException
| - with linked exception:
| [javax.xml.bind.UnmarshalException: Unable to create an instance of com.acepostproduction.tumbolia.webservice.AbstractInodeImpl
| - with linked exception:
| [java.lang.InstantiationException]]
| at com.acepostproduction.virtuolia.communicator.TumboliaFileSystemCommunicator.getAllChildren(TumboliaFileSystemCommunicator.java:87)
| at com.acepostproduction.virtuolia.VirtuoliaDiskDriver.startSearch(VirtuoliaDiskDriver.java:340)
| ...
|
Any ideas why the polymorphism on the return value is failing?
It would be great if someone could give me a hint here.
bram
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4112791#4112791
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4112791
17 years
[JBossWS] - JBoss Hanging on start up during Web Service ServletContext
by hopkinst
On my JBoss 4.2.2 Server I have two web services.
If I first start my JBoss server without either web service then deploy web service A. Then deploy web service B. The following runs (as intended).
Web Service B has a ContextInitialized piece that runs when it is deployed. Inside of Web Service B (which has already ingested via wsimport Web Service A prior to packaging as a WAR and deployment on the same server) an instance of web service A is created via service and port. Then a function in web service A is called, passed an object, and properly returns data (in this case a boolean).
Everything there runs as it is supposed to. The issue is that if I shut the server down and bring it back online with both of the Web Services (A and B) on the server the server will hang when it tries to create the instance of Web Service A inside the Servlet ContextInitialized section.
During start up web service A deploys properly and I can see its endpoints created. Then web service B deploys and after one println that tells me it is starting it tries to create the service and port for web service A and the server just hangs.
Does anyone have any idea what I've forgotten to do, or what the reason is that this will fail when the server is started and the web services are already deployed?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4112745#4112745
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4112745
17 years
[JBossWS] - Exception while running JbossWS service client
by techie_techie
Hi,
I have a service up and running on Jboss 4.2.2 GA. I can browse the WSDL file and see the content.
Now using wsconsume I generated the client side stubs and wrote a test client. The testclient class path refers to jars in "lib" of Jboss Ws 2.0.2 "lib"
but i am getting the following exception.
Any pointers what could be missing or correct proedcure to create clients using wsconsume?
.....
| Exception in thread "main" javax.xml.ws.WebServiceException: Unable to load Provider: Failed to load javax.xml.ws.spi.Provider: com.sun.xml.ws.spi.ProviderImpl
| at javax.xml.ws.spi.Provider.provider(Provider.java:98)
| at javax.xml.ws.Service.<init>(Service.java:83)
| at com.danny.techtalk.ex1.echo.EchoImplService.<init>(EchoImplService.java:53)
| at com.danny.techtalk.ex1.echo.TestClient2.main(TestClient2.java:12)
| Caused by: java.lang.IllegalStateException: Failed to load javax.xml.ws.spi.Provider: com.sun.xml.ws.spi.ProviderImpl
| at javax.xml.ws.spi.ProviderLoader.loadProvider(ProviderLoader.java:96)
| at javax.xml.ws.spi.Provider.provider(Provider.java:90)
| ... 3 more
| Caused by: java.lang.ExceptionInInitializerError
| at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
| at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
| at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
| at java.lang.reflect.Constructor.newInstance(Unknown Source)
| at java.lang.Class.newInstance0(Unknown Source)
| at java.lang.Class.newInstance(Unknown Source)
| at javax.xml.ws.spi.ProviderLoader.loadProvider(ProviderLoader.java:91)
| ... 4 more
| Caused by: javax.xml.ws.WebServiceException: Error creating JAXBContext for W3CEndpointReference.
| at com.sun.xml.ws.spi.ProviderImpl.getEPRJaxbContext(ProviderImpl.java:188)
| at com.sun.xml.ws.spi.ProviderImpl.<clinit>(ProviderImpl.java:65)
| ... 11 more
| Caused by: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 2 counts of IllegalAnnotationExceptions
| Two classes have the same XML type name "address". Use @XmlType.name and @XmlType.namespace to assign different names to them.
| this problem is related to the following location:
| at com.sun.xml.ws.developer.MemberSubmissionEndpointReference$Address
| at public com.sun.xml.ws.developer.MemberSubmissionEndpointReference$Address com.sun.xml.ws.developer.MemberSubmissionEndpointReference.addr
| at com.sun.xml.ws.developer.MemberSubmissionEndpointReference
| this problem is related to the following location:
| at javax.xml.ws.wsaddressing.W3CEndpointReference$Address
| at private javax.xml.ws.wsaddressing.W3CEndpointReference$Address javax.xml.ws.wsaddressing.W3CEndpointReference.address
| at javax.xml.ws.wsaddressing.W3CEndpointReference
| Two classes have the same XML type name "elements". Use @XmlType.name and @XmlType.namespace to assign different names to them.
| this problem is related to the following location:
| at com.sun.xml.ws.developer.MemberSubmissionEndpointReference$Elements
| at public com.sun.xml.ws.developer.MemberSubmissionEndpointReference$Elements com.sun.xml.ws.developer.MemberSubmissionEndpointReference.referenceProperties
| at com.sun.xml.ws.developer.MemberSubmissionEndpointReference
| this problem is related to the following location:
| at javax.xml.ws.wsaddressing.W3CEndpointReference$Elements
| at private javax.xml.ws.wsaddressing.W3CEndpointReference$Elements javax.xml.ws.wsaddressing.W3CEndpointReference.referenceParameters
| at javax.xml.ws.wsaddressing.W3CEndpointReference
|
| at com.sun.xml.bind.v2.runtime.IllegalAnnotationsException$Builder.check(IllegalAnnotationsException.java:66)
| at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:422)
| at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:270)
| at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:103)
| at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:81)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
| at java.lang.reflect.Method.invoke(Unknown Source)
| at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:210)
| at javax.xml.bind.ContextFinder.find(ContextFinder.java:366)
| at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:574)
| at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:522)
| at com.sun.xml.ws.spi.ProviderImpl.getEPRJaxbContext(ProviderImpl.java:186)
| ... 12 more
|
TIA...
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4112570#4112570
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4112570
17 years
[JBossWS] - Exception while running JbossWS service client
by techie_techie
Hi,
I have a service up and running on Jboss 4.2.2 GA. I can browse the WSDL file and see the content.
Now using wsconsume I generated the client side stubs and wrote a test client. The testclient class path refers to jars in "lib" of Jboss Ws 2.0.2 "lib"
but i am getting the following exception.
Any pointers what could be missing or correct proedcure to create clients using wsconsume?
.....
| Exception in thread "main" javax.xml.ws.WebServiceException: Unable to load Provider: Failed to load javax.xml.ws.spi.Provider: com.sun.xml.ws.spi.ProviderImpl
| at javax.xml.ws.spi.Provider.provider(Provider.java:98)
| at javax.xml.ws.Service.<init>(Service.java:83)
| at com.danny.techtalk.ex1.echo.EchoImplService.<init>(EchoImplService.java:53)
| at com.danny.techtalk.ex1.echo.TestClient2.main(TestClient2.java:12)
| Caused by: java.lang.IllegalStateException: Failed to load javax.xml.ws.spi.Provider: com.sun.xml.ws.spi.ProviderImpl
| at javax.xml.ws.spi.ProviderLoader.loadProvider(ProviderLoader.java:96)
| at javax.xml.ws.spi.Provider.provider(Provider.java:90)
| ... 3 more
| Caused by: java.lang.ExceptionInInitializerError
| at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
| at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
| at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
| at java.lang.reflect.Constructor.newInstance(Unknown Source)
| at java.lang.Class.newInstance0(Unknown Source)
| at java.lang.Class.newInstance(Unknown Source)
| at javax.xml.ws.spi.ProviderLoader.loadProvider(ProviderLoader.java:91)
| ... 4 more
| Caused by: javax.xml.ws.WebServiceException: Error creating JAXBContext for W3CEndpointReference.
| at com.sun.xml.ws.spi.ProviderImpl.getEPRJaxbContext(ProviderImpl.java:188)
| at com.sun.xml.ws.spi.ProviderImpl.<clinit>(ProviderImpl.java:65)
| ... 11 more
| Caused by: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 2 counts of IllegalAnnotationExceptions
| Two classes have the same XML type name "address". Use @XmlType.name and @XmlType.namespace to assign different names to them.
| this problem is related to the following location:
| at com.sun.xml.ws.developer.MemberSubmissionEndpointReference$Address
| at public com.sun.xml.ws.developer.MemberSubmissionEndpointReference$Address com.sun.xml.ws.developer.MemberSubmissionEndpointReference.addr
| at com.sun.xml.ws.developer.MemberSubmissionEndpointReference
| this problem is related to the following location:
| at javax.xml.ws.wsaddressing.W3CEndpointReference$Address
| at private javax.xml.ws.wsaddressing.W3CEndpointReference$Address javax.xml.ws.wsaddressing.W3CEndpointReference.address
| at javax.xml.ws.wsaddressing.W3CEndpointReference
| Two classes have the same XML type name "elements". Use @XmlType.name and @XmlType.namespace to assign different names to them.
| this problem is related to the following location:
| at com.sun.xml.ws.developer.MemberSubmissionEndpointReference$Elements
| at public com.sun.xml.ws.developer.MemberSubmissionEndpointReference$Elements com.sun.xml.ws.developer.MemberSubmissionEndpointReference.referenceProperties
| at com.sun.xml.ws.developer.MemberSubmissionEndpointReference
| this problem is related to the following location:
| at javax.xml.ws.wsaddressing.W3CEndpointReference$Elements
| at private javax.xml.ws.wsaddressing.W3CEndpointReference$Elements javax.xml.ws.wsaddressing.W3CEndpointReference.referenceParameters
| at javax.xml.ws.wsaddressing.W3CEndpointReference
|
| at com.sun.xml.bind.v2.runtime.IllegalAnnotationsException$Builder.check(IllegalAnnotationsException.java:66)
| at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:422)
| at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:270)
| at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:103)
| at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:81)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
| at java.lang.reflect.Method.invoke(Unknown Source)
| at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:210)
| at javax.xml.bind.ContextFinder.find(ContextFinder.java:366)
| at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:574)
| at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:522)
| at com.sun.xml.ws.spi.ProviderImpl.getEPRJaxbContext(ProviderImpl.java:186)
| ... 12 more
|
TIA...
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4112569#4112569
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4112569
17 years