Dynamic Proxy class in JDK1.18

I want to create a Dynamic Proxy class in JDK1.1.8 can any one help me out

thanX for ur reply.
I need to implement that in JDK1.1.8, I need to deletgate all opperations on my proxy class to another class.

Similar Messages

  • Dynamic proxy class

    Hello every body,
    i have my own package .inside my package i use invoke method form java.lang.Reflect . This invoke method call method from out side package at run time .However, becuase i try to call method from outside package and not public i get the follwoing Exception :
    IllegalAccessException
    at run time
    my question :
    can i use dynamic proxy class in the reflect package to solve my problem ???
    Actually , when i back to proxy class i found that it also depend on invoke method in the invokation handler
    so pleeeease i need support
    Nada

    Why are you calling a non-public method in unrelated class in another package? The maintainer of that package has no responsibility to ensure that the signature or behavior of the method does not change. A later change in that package could break your code.
    The access rules in Java are set up to prevent exactly this sort of thing, so it's not a problem to be overcome. It's not a bug... it's a feature!

  • Dynamic proxy class from a Class instead of an Interface

    Why is not possible to create a dynamic proxy class from a Class instead of an Interface, using java.lang.reflect.Proxy?
    I have seen the source code of Proxy :
         * Verify that the Class object actually represents an
         * interface.
         if (!interfaceClass.isInterface()) {
              throw new IllegalArgumentException(
              interfaceClass.getName() + " is not an interface");
    It seems to be restricted as a desing desition. Has someone knows about the reason of that?
    There is a workarround for creating dynamic proxy classes from any POJO which not implements any interface?

    The JDK doesn't allow you to proxy classes for a few reasons: it encourages you to use interfaces - often a good idea - and also, proxying of classes exposes you to unpredictable behaviour. Since dynamic proxies are created by generating a new class at runtime, if you proxied a class you'd be generating a subclass of that class, and if the superclass had any final methods, the proxy wouldn't be able to intercept invocation of them, so your proxy wouldn't work properly. Also, the superclass would actually be loaded, which could produce other unpredictable results if, say, that class had a static initializer. With an interfaces, you generate an object that just has the public API described by the interface, with a class, you're actually generating a subclass of the proxied type, which isn't the same thing
    If you really want to proxy a class rather than an interface, there are various third-party libraries around that will do it for you. ASM, CGLIB, BCEL to name a few. My choice would be ASM, but really I'd urge you to try and re-design with interfaces if at all possible
    http://cglib.sourceforge.net/
    http://asm.objectweb.org/
    http://jakarta.apache.org/bcel/

  • What is a Dynamic Proxy Class or Method for?

    I only recently "discovered" proxy classes/methods.
    Im rather curious about them because I still cant manage
    to understand what they do or what theyre for.
    Can anyone give a simple and practical use for this language feature?
    I read this:
    http://java.sun.com/developer/technicalArticles/JavaLP/Interposing/
    Which seems to indicate that proxy classes are for intercepting
    method calls?
    http://java.sun.com/j2se/1.4.2/docs/api/java/lang/reflect/Proxy.html

    becareful what you ask for? :)
    http://java.sun.com/j2se/1.3/docs/guide/reflection/proxy.html
    http://www.javaworld.com/gomail.cgi?id=658521
    http://www.codeproject.com/dotnet/dynamicproxy.asp
    http://www.javaworld.com/javaworld/jw-02-2002/jw-0222-designpatterns_p.html
    http://www.devx.com/Java/Article/21463/1954?pf=true
    http://www.developertutorials.com/tutorials/java/java-dynamic-proxies-050514/page1.html
    http://today.java.net/pub/a/today/2005/11/01/implement-proxy-based-aop.html
    http://joe.truemesh.com/blog/000181.html
    http://www.ociweb.com/jnb/jnbNov2005.html
    http://builder.com.com/5100-6370-5054393.html
    http://www.javaworld.com/javaworld/jw-02-2002/jw-0215-dbcproxy.html
    http://today.java.net/pub/a/today/2006/07/13/lazy-loading-is-easy.html
    http://www.artima.com/weblogs/viewpost.jsp?thread=43091

  • AXIS - deploying services implemented as dynamic proxy.

    I have web services defined in interfaces Service1, Service2, Service3 deployed using a deploy.wsdd that contains the class names Impl1, Impl2, Impl3 that implements their respective interfaces.
    What I want to do now is to replace Impl1, Impl2, Impl3 with instances of dynamic proxy classes that I will create using my factory.
    I just want to tell Axis something like:
    Implement each service by calling
    Class MyFactory.getImpl(Class serviceInterface).
    How can I tell Axis to do that?

    I have web services defined in interfaces Service1, Service2, Service3 deployed using a deploy.wsdd that contains the class names Impl1, Impl2, Impl3 that implements their respective interfaces.
    What I want to do now is to replace Impl1, Impl2, Impl3 with instances of dynamic proxy classes that I will create using my factory.
    I just want to tell Axis something like:
    Implement each service by calling
    Class MyFactory.getImpl(Class serviceInterface).
    How can I tell Axis to do that?

  • Dynamic proxy (clientside) for EJBObject

    I ran into some ClassNotFoundException when using dynamic proxy.
    Can anyone shed some light? I am running weblogic workshop 8.1 beta.
    Here is the code and exception stack trace:
    session bean code:
    public VPNIf makeProxy(){
    ClassLoader ejbcl =
    ctx.getEJBObject().getClass().getClassLoader();
         try {
    Class cs = Class.forName(VPNIf.class.getName(), true,
    ejbcl);
         VPNIf obj = (VPNIf)VProxy.createProxy(ejbcl, new Class[]{cs});
    obj.setBandwidth(15);
    return obj;
    } catch (Exception ex){
    ex.printStackTrace();
    return null;
    VProxy class packaged with the bean:
    public class VProxy implements InvocationHandler, Serializable {
    private Map m_map;
    public static Object createProxy(ClassLoader cl, Class[] interfaces)
    try {
         Class proxyedClass = Class.forName(VProxy.class.getName(), true, cl);
    InvocationHandler ih =
    (InvocationHandler)proxyedClass.newInstance();
         return Proxy.newProxyInstance(cl, interfaces, ih);
    } catch (Exception ex){
    ex.printStackTrace();
    return null;
    VPNIf with the bean:
    public interface VPNIf extends Serializable {
    public void setBandwidth(int x);
    public int getBandwidth();
    Client code:
    Method method =
    sessionObject.getClass().getMethod("makeProxy", null);
    Class proxyedIf = method.getReturnType();
    Class x = Class.forName("org.openuri.VPNIf", true,
    proxyedIf.getClassLoader()); // this line works fine
    Method method1 = proxyedIf.getMethod("getBandwidth", null);
    Object proxy = method.invoke(sessionObject, null); //
    Exception here
    method = proxyedIf.getMethod("getBandwidth", null);
    Integer bw = (Integer)method.invoke(proxy, null);
    System.out.println("bandwidth: " + bw);
    Here is the exception on client side:
    Caused by: java.rmi.UnmarshalException: failed to unmarshal interface
    org.openuri.VPNIf; nested exception is:
         java.lang.ClassNotFoundException: org.openuri.VPNIf
         at weblogic.rjvm.ResponseImpl.unmarshalReturn(ResponseImpl.java:163)
         at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:285)
         at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:244)
         at org.openuri.VPNServiceBean_9khl0e_EOImpl_WLStub.makeProxy(Unknown
    Source)
         ... 21 more
    Caused by: java.lang.ClassNotFoundException: org.openuri.VPNIf
         at java.net.URLClassLoader$1.run(URLClassLoader.java:198)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
         at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:265)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
         at java.lang.Class.forName0(Native Method)
         at java.lang.Class.forName(Class.java:217)
         at java.io.ObjectInputStream.resolveProxyClass(ObjectInputStream.java:630)
         at java.io.ObjectInputStream.readProxyDesc(ObjectInputStream.java:1469)
         at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1432)
         at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1626)
         at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
         at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
         at weblogic.common.internal.ChunkedObjectInputStream.readObject(ChunkedObjectInputStream.java:111)
         at weblogic.rjvm.MsgAbbrevInputStream.readObject(MsgAbbrevInputStream.java:95)
         at weblogic.rmi.internal.ObjectIO.readObject(ObjectIO.java:56)
         at weblogic.rjvm.ResponseImpl.unmarshalReturn(ResponseImpl.java:159)

    Greetings,
    Say i have a servlet named "DispatcherServlet",
    let", how should i go about to implement a
    dynamic proxy class for the same? Depends on your application requirements and what you want to proxy to and where. Can you be more specific?
    Thanks
    SamRegards,
    Tony "Vee Schade" Cook

  • Dynamic proxy for subclassing given classes

    Is or will it be possible in future to generate a dynamic proxy as subclass of a given class in addition of implementing a set of interfaces?
    The reason why I am asking:
    Currently it is not possible to define a subclass of a generic type. With that, it would be possible to at least provide a generified factory for that purpose.
    TIA
    Richard

    This is not exactly what I want. Let me illustrate with a snippet what I want to do:
         public static class Base {
              public void doIt() {
         public static class Factory<T extends Base> {
              public T getCommonlyOverwrittenInstance() {
                   return new Overwriter();
              private class Overwriter extends T {
                   @Override
                   public void doIt() {
                        //do something different common
                        //to all classes delivered by the factory
         }This gives a compiler error at 'Overwriter extends T', since I cannot extend a generic type. On the other hand I have to return the generified type. I want to have a factory for any type down the Base hierarchy.
    This could be achieved with a proxy class if it not only would implement interfaces but also be capable of deriving a given type.

  • Proxy Class (for compiling purpose)?

    Since JDK 1.3, there is a Proxy class that allows us to dynamically generate Java object classes from scripts. We can use it to implement interface functions etc and calls to these functions would be redirect to a hook.
    My question is, will Sun consider to extend this functionality to compiled Java classes using some mechanism?
    For instance, I would like to statically link to some JavaScript functions or read the variables of some JavaScript objects. That is a lot easier than calling some long functions to access the variable/functions.
    The problem is the compiler would not understand such need unless the variables/functions are present in the statically compiled class files.
    Would it possible to a compile time class executed by the compiler to generate a list of variables/functions and types accessible.
    For example:
    // resource/test.js needs to be in the class path
    import javascript.ProxyClassHandler("resource/test.js");
    public class Foo
       public static void main ()
          // javascriptobject is the package of the object generated from resource/test.js
          javascriptobject.Test = (javascript.Test)JavaScript.eval ("resource/test.js");
          new Thread (Test.getRunnable ()).start ();
          System.out.println (Test.foo);
    }In the example above, the function getRunnable () and the field foo are statically linked at coimpile time.
    This capability can be useful because it allows Java to have better mixing with other scripting engines running on top of JVM.
    Currently, except the variable part which is not being handled by Proxy class, there is a workaround by generating an actual interface that correspond to javascript.Test. And then use that for the compiling purpose. The problem is that it is a two step process and does not handle variables. When we are dealing with heavy mixing of scripts and Java code, it can become a serious pain.
    What do you think of this idea?
    Message was edited by:
    coconut99_99

    Well, interface simply cannot solve all the problems. When one deals with scripting engine a lot, it is the general case that it is much easier to access fields and functions of Java objects, but extremely painful to access fields and functions of the script objects. Every scripting engine has its own way of how to getting the scripted objects exposed.
    Proxy of JDK1.3 alleviate the problem somewhat, but it is still problematic overall. Even if we use interfaces, we would have to "cast" the object returned from the scripting engine anyways, already "violating" the OO principle ^_^ Besides, scripts can generate GUI components and sub-classing them within scripting engine just fine, how to return the script object?
    If scripting engines, such as BeanShell and Rhino JS are capable of generating class byte codes, why not have a convenient way of importing these classes (having two steps complicates maintainence), and thus being able to access/link to the exposed script object statically. This way, we can discover problems at compile time rather than having to run the actual code and discover (if we ever) the runtime exceptions.
    Here is another case where it would be immensely useful.
    Say there is an XML parser that generate classes dynamically, and inserting class members as attributes as were read from an XML. Currently, there are two ways of accomplishing the similar thing. One is through JAXB or similar, which is known for slowness, requiring XML Schema, and generating classes. These three reasons remove JAXB from general use. Another is through DOM, which is used in general. However, this does not mean to say it is simple to use DOM. It is very wordy. One has to use myDomTree.getAttribute ("abc") to access an attribute, while on the other hand in other languages such as Python and JavaScript, one could potentially access DOM tree in the form of myDomTree.abc. With import method described in the original post, we would be able to access the fields, which is somewhat like auto importing the result from JAXB class generated. Compiler may maintain the generated class cache as needed if we are compiling many classes.
    Of course this still does not give us full power of meta objects of what Python/JS provides, they have their own problems having such flexibilities in general, but it could provide Java such capability when there is such needed.

  • Dynamic proxy not working

    Folks,
    I deployed a EJB Webservice(Document Literal) in Sun App Server. I am able to access the method through Static Stub but Dynamic proxy says the below error:
    port: {http://com.venkat.webservice/AllInOne/targ}AllInOneIntfPort does not contain operation: justConcat
         at com.sun.xml.rpc.client.dii.ConfiguredCall.configureCall(ConfiguredCall.java:98)
         at com.sun.xml.rpc.client.dii.ConfiguredCall.configureCall(ConfiguredCall.java:69)
         at com.sun.xml.rpc.client.dii.ConfiguredCall.setMethodName(ConfiguredCall.java:50)
         at com.sun.xml.rpc.client.dii.DynamicProxyBuilder.buildDynamicProxyFor(DynamicProxyBuilder.java:66)
         at com.sun.xml.rpc.client.dii.ConfiguredService.getPort(ConfiguredService.java:250)
         at wsclient.DynProxy.main(DynProxy.java:50)
    The Code i used to access is as below:
    String UrlString = "http://venkat:8080/AllInOneServiceBean" + "?WSDL";
                String nameSpaceUri = "http://com.venkat.webservice/AllInOne/targ";
                String serviceName = "AllInOneService";
                String portName = "AllInOneIntfPort";
      Service helloService =
                    serviceFactory.createService(helloWsdlUrl,
                        new QName(nameSpaceUri, serviceName));
    AllInOneIntf myProxy = (AllInOneIntf) helloService.getPort(new QName(
                        nameSpaceUri,
                        portName), AllInOneIntf.class);          
                System.out.println(myProxy.justConcat("aasds","as"));The WSDL File is:
    <?xml version="1.0" encoding="UTF-8"?><definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://com.venkat.webservice/AllInOne/targ" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:ns2="http://com.venkat.webservice/AllInOne/type" name="AllInOneService" targetNamespace="http://com.venkat.webservice/AllInOne/targ">
    <types>
    <schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://com.venkat.webservice/AllInOne/type" xmlns:soap11-enc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://com.venkat.webservice/AllInOne/type">
    <complexType name="justConcat">
    <sequence>
    <element name="String_1" type="string" nillable="true"/>
    <element name="String_2" type="string" nillable="true"/></sequence></complexType>
    <complexType name="justConcatResponse">
    <sequence>
    <element name="result" type="string" nillable="true"/></sequence></complexType>
    <complexType name="takeCustomObject">
    <sequence>
    <element name="ValueObject_1" type="tns:ValueObject" nillable="true"/></sequence></complexType>
    <complexType name="ValueObject">
    <sequence>
    <element name="comp" type="string" nillable="true"/>
    <element name="name" type="string" nillable="true"/></sequence></complexType>
    <complexType name="takeCustomObjectResponse">
    <sequence>
    <element name="result" type="string" nillable="true"/></sequence></complexType>
    <element name="justConcat" type="tns:justConcat"/>
    <element name="justConcatResponse" type="tns:justConcatResponse"/>
    <element name="takeCustomObject" type="tns:takeCustomObject"/>
    <element name="takeCustomObjectResponse" type="tns:takeCustomObjectResponse"/></schema></types>
    <message name="AllInOneIntf_justConcat">
    <part name="parameters" element="ns2:justConcat"/></message>
    <message name="AllInOneIntf_justConcatResponse">
    <part name="result" element="ns2:justConcatResponse"/></message>
    <message name="AllInOneIntf_takeCustomObject">
    <part name="parameters" element="ns2:takeCustomObject"/></message>
    <message name="AllInOneIntf_takeCustomObjectResponse">
    <part name="result" element="ns2:takeCustomObjectResponse"/></message>
    <portType name="AllInOneIntf">
    <operation name="justConcat">
    <input message="tns:AllInOneIntf_justConcat"/>
    <output message="tns:AllInOneIntf_justConcatResponse"/></operation>
    <operation name="takeCustomObject">
    <input message="tns:AllInOneIntf_takeCustomObject"/>
    <output message="tns:AllInOneIntf_takeCustomObjectResponse"/></operation></portType>
    <binding name="AllInOneIntfBinding" type="tns:AllInOneIntf">
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
    <operation name="justConcat">
    <soap:operation soapAction=""/>
    <input>
    <soap:body use="literal"/></input>
    <output>
    <soap:body use="literal"/></output></operation>
    <operation name="takeCustomObject">
    <soap:operation soapAction=""/>
    <input>
    <soap:body use="literal"/></input>
    <output>
    <soap:body use="literal"/></output></operation></binding>
    <service name="AllInOneService">
    <port name="AllInOneIntfPort" binding="tns:AllInOneIntfBinding">
    <soap:address location="http://venkat:8080/AllInOneServiceBean" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"/></port></service></definitions>
    Please let me what mistake i am doing if any? or is this a bug
    Thanks
    Venkat

    If you are using document/literal, which this WSDL is, you would be much better off using Metro (JAX-WS) as it has a much better dynamic interface in the Dispatch APIs. Metro: http://metro.dev.java.net, JAX-WS: http://jax-ws.dev.java.net.

  • Dynamic proxy, several instances, same name, diff ids?

    I'm using a dynamic proxy with a simple invocation handler. Using the proxy for several instances of the target object should yield multiple instances of the proxy. In the debugger, each proxy instance is named $proxy0 with different ids. Can someone please elaborate on this? Specifically, the Proxy instance is created using the target object. Thus, how can each proxy instance have the same name, when different target objects (of the same type though) are used to construct the Proxy object? Is the Proxy instance the same regardless of the target object?
    I : interface
    T: target class
    pseudo thing:
    <code>
    T t1, t2, t3 ... new ...
    I i1 = (I) Proxy.newInst...(..., ..., t1)
    I i2 = (I) Proxy.newInst...(..., ..., t2)
    I i3 = (I) Proxy.newInst...(..., ..., t3)
    Each i has name $proxy0 with different id. For instance: i1-> $proxy0 id=68, i2 ->$proxy0 id= 32, etc.
    </code>
    Insight is appreciated!

    is it the same proxy that is instantiated three times (obviously)?It is the same proxy class that is instantiated three times. Obviously. Because that is the only meaning for 'instantiate' in Java.
    But how can that be when the target object for each Proxy instance is different?Because they are three different instances of the same class, each with a different target object.
    What's the problem here?

  • Any example of dynamic proxy with RMI?

    Hi, are there any good example of dynamic proxy with RMI, using the new RemoteObjectInvocationHandler class?
    I am currently implementing a Registry, and want to use dynamic proxy to wrap around the registry stub, to pass extra information to the client.
    I've tried it, but the program will hang and get this exception:
    Exception in thread "RMI TCP Connection(1616)-192.168.1.23" java.lang.OutOfMemoryError: Java heap space
    My implementation looks like this:
    public RegistryImpl extends RemoteServer Implements Registry {
        public RegistryImpl(int port, Properties... properties) throws RemoteException, ChannelException {
             // Create a reference for the registry.
         LiveRef liveref = new LiveRef(id, port);
            ref = new UnicastServerRef(liveref);
             Registry proxy = (Registry)RegistryProxy.newProxyInstance(
                  this.getClass().getClassLoader(),
                  this.getClass().getInterfaces(),
                  new RemoteObjectInvocationHandler(this.getRef()));
             /* Using dynamic proxy */
             usref.exportObject(proxy, null, true);
    public class RegistryProxy extends Proxy implements Registry {
         private InvocationHandler handler;
         public RegistryProxy(InvocationHandler handler) {
              super(handler);
              this.handler = handler;
         public Remote lookup(String name) throws RemoteException, NotBoundException, AccessException {
              Remote result;
              try {
                   Method m = Registry.class.getMethod("lookup", new Class[]{String.class});
                   result = (Remote)handler.invoke(this, m, new Object[]{name});
              } catch (SecurityException e) {
                   throw new UndeclaredThrowableException(e);
              } catch (NoSuchMethodException e) {
                   throw new UndeclaredThrowableException(e);
              } catch (Throwable e) {
                   throw new UndeclaredThrowableException(e);
              return result;
         public void bind(String name, Remote remoteObj) throws RemoteException, AlreadyBoundException, AccessException {
         public void unbind(String name) throws RemoteException, NotBoundException, AccessException {
         public void rebind(String name, Remote remoteObj) throws RemoteException, AccessException {
         public String[] list() throws RemoteException, AccessException {
    }I am new to Java programming, any help is appriciated.
    Regards
    Eddie

    Hi Eddie,
    Perhaps you might like this one:
    http://wiki.java.net/bin/view/Communications/TransparentProxy
    it uses dynamic proxies to achieve complete RMI transparency.
    Something to consider, good luck.
    John

  • Dynamic proxy client error

    hello,
    im running a dynamic proxy client for a simple web service. I have the web service up and running but when i run the client i get the following error:
    run-client:
    [java] java.lang.NoClassDefFoundError: dynamicproxy/BookClient
    [java] Exception in thread "main"
    [java] Java Result: 1
    run:
    BUILD SUCCESSFUL
    Total time: 2 seconds
    My client code is as follows:
    package dynamicproxy;
    import java.net.URL;
    import javax.xml.rpc.Service;
    import javax.xml.rpc.JAXRPCException;
    import javax.xml.namespace.QName;
    import javax.xml.rpc.ServiceFactory;
    import dynamicproxy.BookIF;
    public class BookClient{
    public static void main(String[] args){
    try{
    String UrlString = args[0] + "?WSDL";
    String nameSpaceUri = "urn:Foo";
    String serviceName = "MyBookService";
    String portName = "BookIFPort";
    System.out.println("UrlString = " + UrlString);
    URL bookWsdlUrl = new URL(UrlString);
    ServiceFactory serviceFactory = ServiceFactory.newInstance();
                   Service bookService = serviceFactory.createService(bookWsdlUrl,
                   new QName(nameSpaceUri, serviceName));
    dynamicproxy.BookIF
    myProxy = (dynamicproxy.BookIF)
    bookService.getPort(new QName(nameSpaceUri, portName),
    dynamicproxy.BookIF.class);
                   System.out.println("The sum of the 2 numbers is:");
    System.out.println(myProxy.add(1, 2));
    catch (Exception ex)
    ex.printStackTrace();
    Any ideas??

    thnx kwalsh1 i got it working. It was the targets.xml file in jaxrpc/common, i edited the package-dynamic to include all class files!

  • Dynamic Proxy Client

    Hi all,
    iam trying to use the dynamic proxy client with the following lines
    String UrlString =
    "http://localhost:8080/ProxyHelloWorld.wsdl";
    String nameSpaceUri = "http://proxy.org/wsdl";
    String serviceName = "HelloWorld";
    String portName = "HelloIFPort";
    URL helloWsdlUrl = new URL(UrlString);
    ServiceFactory serviceFactory =
    ServiceFactory.newInstance();
    Service helloService =
    serviceFactory.createService(helloWsdlUrl,
    new QName(nameSpaceUri, serviceName));
    //HelloIF myProxy = (HelloIF) helloService.getPort(
    //new QName(nameSpaceUri, portName),
    //proxy.HelloIF.class);
    when i try to do this i get the following exception
    Exception in thread "main" java.lang.NoSuchMethodError
    at com.sun.xml.rpc.wsdl.parser.Util.verifyTagNSRootElement(Util.java:59)
    at com.sun.xml.rpc.wsdl.parser.WSDLParser.parseDefinitionsNoImport(WSDLP
    arser.java:191)
    at com.sun.xml.rpc.wsdl.parser.WSDLParser.parseDefinitionsNoImport(WSDLP
    arser.java:165)
    at com.sun.xml.rpc.wsdl.parser.WSDLParser.parseDefinitions(WSDLParser.ja
    va:96)
    at com.sun.xml.rpc.wsdl.parser.WSDLParser.parse(WSDLParser.java:91)
    at com.sun.xml.rpc.processor.modeler.wsdl.WSDLModeler.buildModel(WSDLMod
    eler.java:85)
    at com.sun.xml.rpc.processor.config.ModelInfo.buildModel(ModelInfo.java:
    77)
    at com.sun.xml.rpc.client.dii.ServiceInfoBuilder.getModel(ServiceInfoBui
    lder.java:96)
    at com.sun.xml.rpc.client.dii.ServiceInfoBuilder.buildServiceInfo(Servic
    eInfoBuilder.java:59)
    at com.sun.xml.rpc.client.dii.ConfiguredService.<init>(ConfiguredService
    .java:44)
    at com.sun.xml.rpc.client.ServiceFactoryImpl.createService(ServiceFactor
    yImpl.java:32)
    at JAXRPCClient.main(JAXRPCClient.java:38)
    what am i doing wrong
    suresh

    Hi,
    Yeah the Wsdl is hosted at http://localhost:8080/ProxyHelloWorld.wsdl.I also tried binding with a few xmethods service i get the same error.
    same error.

  • Dynamic proxy on jwsdp 1.1 deserialization error

    Hi,
    I want to use a dynamic proxy to get information from an webservice.
    normal datatypes like String or integer works fine. But when I want to have an object back, I get an deserialization error. I use sdk 1.3.1_08 and the jwsdp 1.1
    Does the jwsdp 1.1 support to transfer objects with dynamic proxy?
    thx
    Matthias

    I must use the jwsdp 1.1 because our clients run on IBM-Webspehre the highest sdk wich is at the moment supported is sdk 1.3.1_08.
    But with the jwsdp and sdk 1.4.2 I became also an exception.
    her it is:
    UrlString = http://localhost:8080/uisservice/endpoint?WSDL
    deserialization error: java.lang.NullPointerException
         at com.sun.xml.rpc.encoding.ObjectSerializerBase.deserialize(ObjectSerializerBase.java:212)
         at com.sun.xml.rpc.encoding.ReferenceableSerializerImpl.deserialize(ReferenceableSerializerImpl.java:115)
         at com.sun.xml.rpc.client.dii.CallInvokerImpl._readFirstBodyElement(CallInvokerImpl.java:188)
         at com.sun.xml.rpc.client.StreamingSender._send(StreamingSender.java:168)
         at com.sun.xml.rpc.client.dii.CallInvokerImpl.doInvoke(CallInvokerImpl.java:56)
         at com.sun.xml.rpc.client.dii.BasicCall.invoke(BasicCall.java:281)
         at com.sun.xml.rpc.client.dii.CallInvocationHandler.doCall(CallInvocationHandler.java:98)
         at com.sun.xml.rpc.client.dii.CallInvocationHandler.invoke(CallInvocationHandler.java:70)
         at $Proxy0.getTestUser(Unknown Source)
         at test.TestClient.main(TestClient.java:37)
    CAUSE:
    java.lang.NullPointerException
         at com.sun.xml.rpc.encoding.soap.SOAPResponseSerializer.doDeserialize(SOAPResponseSerializer.java:106)
         at com.sun.xml.rpc.encoding.ObjectSerializerBase.deserialize(ObjectSerializerBase.java:165)
         at com.sun.xml.rpc.encoding.ReferenceableSerializerImpl.deserialize(ReferenceableSerializerImpl.java:115)
         at com.sun.xml.rpc.client.dii.CallInvokerImpl._readFirstBodyElement(CallInvokerImpl.java:188)
         at com.sun.xml.rpc.client.StreamingSender._send(StreamingSender.java:168)
         at com.sun.xml.rpc.client.dii.CallInvokerImpl.doInvoke(CallInvokerImpl.java:56)
         at com.sun.xml.rpc.client.dii.BasicCall.invoke(BasicCall.java:281)
         at com.sun.xml.rpc.client.dii.CallInvocationHandler.doCall(CallInvocationHandler.java:98)
         at com.sun.xml.rpc.client.dii.CallInvocationHandler.invoke(CallInvocationHandler.java:70)
         at $Proxy0.getTestUser(Unknown Source)
         at test.TestClient.main(TestClient.java:37)
    CAUSE:
    java.lang.NullPointerException
         at com.sun.xml.rpc.encoding.soap.SOAPResponseSerializer.doDeserialize(SOAPResponseSerializer.java:106)
         at com.sun.xml.rpc.encoding.ObjectSerializerBase.deserialize(ObjectSerializerBase.java:165)
         at com.sun.xml.rpc.encoding.ReferenceableSerializerImpl.deserialize(ReferenceableSerializerImpl.java:115)
         at com.sun.xml.rpc.client.dii.CallInvokerImpl._readFirstBodyElement(CallInvokerImpl.java:188)
         at com.sun.xml.rpc.client.StreamingSender._send(StreamingSender.java:168)
         at com.sun.xml.rpc.client.dii.CallInvokerImpl.doInvoke(CallInvokerImpl.java:56)
         at com.sun.xml.rpc.client.dii.BasicCall.invoke(BasicCall.java:281)
         at com.sun.xml.rpc.client.dii.CallInvocationHandler.doCall(CallInvocationHandler.java:98)
         at com.sun.xml.rpc.client.dii.CallInvocationHandler.invoke(CallInvocationHandler.java:70)
         at $Proxy0.getTestUser(Unknown Source)
         at test.TestClient.main(TestClient.java:37)
    and here my client class:
    public class TestClient {
         public static void main(String[] args) {
              try {
                   String UrlString ="http://localhost:8080/uisservice/endpoint?WSDL";
                   String nameSpaceUri = "http://localhost:8080/uisservice/wsdl/UisService";
                   String serviceName = "UisService";
                   String portName = "UisServicePort";
                   System.out.println("UrlString = " + UrlString);
                   URL helloWsdlUrl = new URL(UrlString);
                   ServiceFactory serviceFactory = ServiceFactory.newInstance();
                   Service uisService = serviceFactory.createService(helloWsdlUrl,
                        new QName(nameSpaceUri, serviceName));
                   //END E anderer code
                   UisService
                        myProxy = (UisService)uisService.getPort(new QName(nameSpaceUri, portName), UisService.class);
              System.out.println(myProxy.getTestUser().getFirstname());
              } catch (Exception ex) {
                   ex.printStackTrace();

  • Proxy Class for Services

    Hi!
    I followed the Blogs <a href="/people/amir.madani/blog/2007/01/05/create-dynamic-xss-homepages-with-static-services-using-a-simple-proxy-class Dynamic XSS Homepages with Static Services Using a Simple Proxy Class</a> advisory to dynamically set some services invisible on XSS areapage, wich works out fine except the following:When setting all services of an area to invisible, the link to it still remains in areagroup of course.
    After klicking in, I receive two messages - no services available (one for the area itself, I assmue, and one for subarea).
    Is there a possibility to get rid of this messages or the area-link itself on areagroup?
    Regards,
    Thomas

    Hello Thomas,
    when you say you have set all services of an area to invisible, you basically want to make the area itself invisible and not a specific service, right?
    Unfortunately the link between Area goup page and Area page is static. But you could implement a enhancement to the standard anyway, so it does become dynamic
    regards,
    Markus

Maybe you are looking for

  • CS4 Extremely slow, and crashing on save

    Illustrator CS4 is taking hours to save bigger files with semi-complicated drawings.  Seeing a lot of the rotating beach ball.  This drawing happens to have many gradients, a drop shadow and also a glow.  Sometimes it takes all night to save the file

  • My bookmarks toolbar is gone & won't come back, how do I get it back?

    I have already googled the problem & have tried all of the suggested fixes. When I click on the "Show your bookmarks" icon in the upper right, I can click on "Bookmarks Toolbar" and I can see the bookmarks in a list, but they are no longer on a bar n

  • Two way video chat possible with osmf?

    We are looking to add a 2 way video chat to our chat system (web based) using flash.  Would osmf be able to link the two live webcams together?  If not, could someone suggest something? Our chat's are currently written in Php using ajax.  We're looki

  • Distribution and collection wizard problem with formulas

    Hi gurus, I've an input schedule I want to distribute through the distribution wizard, this input schedule, has some rows where the user should enter data and some rows with formula using the data the user filled before. When I collect the data I not

  • Suddenly cant install any android apk files to Z10

    Dear all, i need help with my new Z10 which I have about one week. I installed some apk files via amazon store or directly from sites. I also installed some applications using Apk Extractor on my second android device and simply moved apk files via b