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

Similar Messages

  • 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!

  • Proxy to JDBC scenario need dynamic sql query for sender .

    Hi Experts,
    I am developing proxy to jdbc scenario. in this i need to pass dynamic sql query  whre we are passing classical method like below.
    while we are passing select stmt in constant and mapped with access field  and key field mapped with key field.
    MY requirement is like instead of passing select stmt in constant where i can generate dynamically and passed in one field and mapped with access field.

    Hi Ravinder,
    A simple UDF or use of graphical mapping functions in most cases should provide you everything you need to construct a dynamic SQL statement for your requirement.
    Regards,
    Ryan Crosby

  • 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.

  • Jax-ws: dynamic proxy-suppress weblogic's default ws-policy handling

    hi all,
    i am writing my own jax-ws client (dynamic proxy) to call a web service, secured by usernametoken profile.
    the wsdl of the web service do include the ws-policy information.
    sample client side code:
    URL url = new URL("path_to_wsdl_file");
    QName serviceQname = new QName("http://model/", "CalculationService");
    Service service = Service.create(url, serviceQname);
    //add resolver and jax-ws handler to add username token SOAPElement fragment to the SOAP message.
    the above code runs fine in J2SE 6.0 environment (without any weblogic-specific library).
    but when i run the above code in a servlet (running in weblogic), the above code fails with the following error:
    Exception in thread "main" javax.xml.ws.soap.SOAPFaultException: Unable to add security token for identity, token uri =http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#UsernameToken
    at com.sun.xml.ws.fault.SOAP11Fault.getProtocolException(SOAP11Fault.java:196)
    at com.sun.xml.ws.fault.SOAPFaultBuilder.createException(SOAPFaultBuilder.java:122)
    at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:119)
    at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:89)
    at com.sun.xml.ws.client.sei.SEIStub.invoke(SEIStub.java:118)
    at $Proxy23.add(Unknown Source)
    at client.ServiceLocator.main(ServiceLocator.java:32)
    it seems that the weblogic server will try to handle the ws-policy element (according to those in the wsdl), even though
    i have already added the username-token security header by my own code.
    As i don't add some weblogic-specific code (e.g. weblogic.wsee.security.unt.ClientUNTCredentialProvider), the web service call fails.
    is it possible to disable/suppress such behavior (weblogic runtime handle the ws-policy element) per web service call???
    (i don't want a server scope solution, as there may be other web service client running on the same weblogic server that rely on such behavior).
    i don't want to use weblogic's API (e.g. ClientUNTCredentialProvider) as i want my web service client be portable (username token is easy to be handled by my own code)
    thank you.

    Hi René ,
    i just use plain HTTP, not HTTPS.
    seems don't involve any certificate, am i right?
    in J2SE environment, i can run the webservice client without problem.
    but once i run the client in weblogic, the problem mentioned occurred.
    if i manually delete the ws-policy related tag in the wsdl file (i download it to local filesystem for testing), the client can run in weblogic too.
    so, think there is some setting in weblogic that try to handle the ws-policy by its so-called 'credential provider'(e.g. ClientUNTCredentialProvider ?)
    thank you.

  • ASA - cut through proxy authentication for RDP?

    I know how to set this up on a router (dynamic access-list - lock and key)... But, I'm having trouble understanding how to setup OUTSIDE to INSIDE cut through proxy authentication for RDP.
    OUTSIDE to INSIDE RDP is currently working.
    I have 2 servers I want RDP open for..
    [*]OUTSIDE 1.1.1.1 to INSIDE 10.10.70.100
    [*]OUTSIDE 1.1.1.2 to INSIDE 10.10.50.200
    What's required for OUTSIDE users  to authenticate on the ASA before allowing port 3389 opens? I was hoping for is a way to SSH into this ASA, login with a special user, then have the ASA add a dynamic ACE on the OUTSISE interface to open 3389 for a designated time limit. Is this possible?
    Here is my current config.
    [code]
    ASA Version 8.2(5)
    hostname ASA5505
    names
    name 10.10.0.0 LANTraffic
    name 10.10.30.0 SALES
    name 10.10.40.0 FoodServices
    name 10.10.99.0 Management
    name 10.10.20.0 Office
    name 10.10.80.0 Printshop
    name 10.10.60.0 Regional
    name 10.10.70.0 Servers
    name 10.10.50.0 ShoreTel
    name 10.10.100.0 Surveillance
    name 10.10.90.0 Wireless
    interface Ethernet0/0
    description TO INTERNET
    switchport access vlan 11
    interface Ethernet0/1
    description TO INSIDE 3560X
    switchport access vlan 10
    interface Ethernet0/2
    shutdown
    interface Ethernet0/3
    shutdown
    interface Ethernet0/4
    shutdown
    interface Ethernet0/5
    shutdown
    interface Ethernet0/6
    shutdown
    interface Ethernet0/7
    shutdown
    interface Vlan1
    no nameif
    security-level 50
    no ip address
    interface Vlan10
    description Cisco 3560x
    nameif INSIDE
    security-level 100
    ip address 10.10.1.1 255.255.255.252
    interface Vlan11
    description Internet Interface
    nameif OUTSIDE
    security-level 0
    ip address 1.1.1.1 255.255.255.224
    ftp mode passive
    clock timezone PST -8
    clock summer-time PDT recurring
    dns domain-lookup OUTSIDE
    dns server-group DefaultDNS
    name-server 8.8.8.8
    name-server 4.2.2.2
    domain-name test.local
    access-list RDP-INBOUND extended permit tcp any host 1.1.1.1 eq 3389
    access-list RDP-INBOUND extended permit tcp any host 1.1.1.2 eq 3389
    pager lines 24
    logging enable
    logging timestamp
    logging trap warnings
    logging device-id hostname
    logging host INSIDE 10.10.70.100
    mtu INSIDE 1500
    mtu OUTSIDE 1500
    ip verify reverse-path interface OUTSIDE
    icmp unreachable rate-limit 1 burst-size 1
    asdm image disk0:/asdm-645.bin
    no asdm history enable
    arp timeout 14400
    global (OUTSIDE) 1 interface
    nat (INSIDE) 1 LANTraffic 255.255.0.0
    static (INSIDE,OUTSIDE) tcp interface 3389 10.10.70.100 3389 netmask 255.255.255.255
    static (INSIDE,OUTSIDE) tcp 1.1.1.2 3389 10.10.50.200 3389 netmask 255.255.255.255
    access-group RDP-INBOUND in interface OUTSIDE
    route OUTSIDE 0.0.0.0 0.0.0.0 1.1.1.1 1
    route INSIDE LANTraffic 255.255.0.0 10.10.1.2 1
    timeout xlate 3:00:00
    timeout conn 1:00:00 half-closed 0:10:00 udp 0:02:00 icmp 0:00:02
    timeout sunrpc 0:10:00 h323 0:05:00 h225 1:00:00 mgcp 0:05:00 mgcp-pat 0:05:00
    timeout sip 0:30:00 sip_media 0:02:00 sip-invite 0:03:00 sip-disconnect 0:02:00
    timeout sip-provisional-media 0:02:00 uauth 0:05:00 absolute
    timeout tcp-proxy-reassembly 0:01:00
    timeout floating-conn 0:00:00
    dynamic-access-policy-record DfltAccessPolicy
    aaa authentication ssh console LOCAL
    aaa authentication http console LOCAL
    http server enable
    http Management 255.255.255.0 INSIDE
    no snmp-server location
    no snmp-server contact
    snmp-server enable traps snmp authentication linkup linkdown coldstart
    crypto ipsec security-association lifetime seconds 28800
    crypto ipsec security-association lifetime kilobytes 4608000
    telnet timeout 5
    ssh 10.10.70.100 255.255.255.255 INSIDE
    ssh Management 255.255.255.0 INSIDE
    ssh 0.0.0.0 0.0.0.0 OUTSIDE
    ssh timeout 5
    ssh version 2
    console timeout 0
    threat-detection basic-threat
    threat-detection scanning-threat shun
    threat-detection statistics access-list
    threat-detection statistics tcp-intercept rate-interval 30 burst-rate 400 average-rate 200
    webvpn
    username scott password CNjeKgq88PLZXETE encrypted privilege 15
    class-map inspection_default
    match default-inspection-traffic
    policy-map type inspect dns preset_dns_map
    parameters
      message-length maximum client auto
      message-length maximum 512
    policy-map global_policy
    class inspection_default
      inspect dns preset_dns_map
      inspect ftp
      inspect h323 h225
      inspect h323 ras
      inspect ip-options
      inspect netbios
      inspect rsh
      inspect rtsp
      inspect skinny
      inspect esmtp
      inspect sqlnet
      inspect sunrpc
      inspect tftp
      inspect sip
      inspect xdmcp
    service-policy global_policy global
    prompt hostname context
    no call-home reporting anonymous
    call-home
    profile CiscoTAC-1
      no active
      destination address http https://tools.cisco.com/its/service/oddce/services/DDCEService
      destination address email [email protected]
      destination transport-method http
      subscribe-to-alert-group diagnostic
      subscribe-to-alert-group environment
      subscribe-to-alert-group inventory periodic monthly
      subscribe-to-alert-group configuration periodic monthly
      subscribe-to-alert-group telemetry periodic daily
    Cryptochecksum:1e9d278ce656f22829809f4c46b04a07
    : end
    [/code]

    You're running ASA 8.2(5). In 8.4(2) Cisco added support for what they call Identity Firewall rules. That is, you can make access-lists entries specific to users (or object groups containing users).
    There's an overview document on this posted here. It's a bit dated but I believe the only change is that Cisco is now preferring use of the more current Context Directory Agent (CDA) - a free VM they provide - vs. the deprecated AD agent (software service that runs on your DC).

  • 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

  • Using Dynamic Proxy in AppServer 7 during EJB deploy

    Hello Guys.
    I know Dynamic Proxy is the default when deploying EJBs starting from AS 8.1. If I want to use Dynamic Proxy in AS before 8.1, how can I do that?
    Thanks.
    Rye

    Just to clarify, I assume you're referring to the Remote EJB dynamic RMI-IIOP feature in 8.x and later.
    Java SE has a generic dynamic proxy facility in the java.lang.reflect package. That can of course
    be used by any JDK 1.4 program and has no relationship to Java EE.
    There is no support for the Remote EJB dynamic RMI-IIOP feature prior to AS 8.x / J2EE SDK 1.4.
    In those releases, e.g. S1AS 7.x / J2EE 1.3 SDK , static RMI-IIOP stubs are generated during
    deployment and must be present for any client access to Remote EJBs.
    --ken                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Dynamic Proxy and OutOfMemoryError

    I ran into this problem before when working with Proxied objects.
    I am integrating iBatis into my framework and using Dynamic Proxies to allow a developer to pass in a DAO interface and the Dynamic Proxy will retrieve the correct iBatis SQL Map and run it according to the DAO interface method. Some of these DAO methods take parameters that are lists with 100,000s of records. When I run my batch process using Dynamic Proxies, I get OutOfMemoryError in WebLogic. When I remove the Dynamic Proxy and create a simple implementation for my DAO that I use instead of Proxying it, I get no error and my process runs fine.
    Any thoughts? Does sending huge amounts of data through a Proxy or doing quite a bit of activity inside a Proxied object cause OutOfMemoryErrors?
    Thanks,
    -jay blanton

    Check you don't have an infinite loop or recursion which is wrapping Proxies in Proxies in Proxies...

  • Dynamic Proxy API does not support WSRM.

    Hi ,
    I am recieving "Dynamic Proxy API does not support WSRM. See operation Outbound_Service_Interface" when i am testing the scenario in WSNavigator where in i am using WS adapter at the sender side.
    Can anyone tell  what might be the problem.
    Thanks & Regards,
    Hamsa Shree

    Hello Hamsa,
    This was known error still SDN buddies are looking for research:
    May these links will help:
    http://help.sap.com/saphelp_nwpi71/helpdata/en/46/741a3dfcfa0eede10000000a155369/content.htm
    You can try with this blog also:
    /people/michael.hill/blog/2007/12/13/service-implementation-in-java
    Even previous threads are shown the proofs as still looking for clues:
    web service scenario with PI 7.1 as mediator does not work
    error with WS navigator , 'Dynamic Proxy API does not support WSRM'

  • Async Dynamic Proxy Patented!

    Hi,
    I needed to make a call to send an email asynchronous, to remove it from the critical path. This is so that when the user hits a 'submit' button for an application on a web page, the server does not take a long time to respond, when it is busy sending the email, which can take a few seconds sometimes.
    Easy to do, but then I thought, why don't I write a dynamic proxy that makes any method call asynchronous and add that to my library of useful stuff. Googled "java dynamic proxy asynchronous method call", and found that IBM have patented it:
    http://www.google.com/patents/US7519977
    For real? Ok, I know there are even worse patents than that.
    Anyone have an idea of how different my implementation of this would need to be to avoid being covered by the the patent?

    Paula-
    Given that you can work around this issue with the stub client,
    you should be able to work around the issue in the dynamic proxy client
    in the same way-
    I am interested that you say workaround the issue with the stub client.
    Is there a problem that you have noted?
    If you can let me know how you worked this issue with the stub,
    and what problems you have specifically had with the dynamic proxy client
    I will look at the issue to see if it a bug.
    Please let me know what environment you are working in, the version of jaxrpc 1.x,
    what container, jdk or jre and a sample client program that would help me understand
    the problem.
    Thanks,
    Kathy

  • Wrap Stub with dynamic proxy?

    Hi All,
    I am looking for the answer of this question from couple of days.
    I want to create an Interceptor chains on RMI level for an EJB client communicating with an Application server.
    This client can communicate using RMI/JRMP or RMI/IIOP, nevertheless the semantics is RMI.
    I want to wrap the stub on client side (Maybe static stub already placed on classpath / dynamic downloaded stub) with dynamic proxy and
    want to apply some interceptors on it before actual invocation of method.
    Is there anyway to wrap stubs with dynamic proxy in any existing client(with no source code only binary form)?

    EJP wrote:
    But you're not doing that. You are casting String to Comparable.Why do you think so?
    System.out.print("Proxy is instance of Comparable? ");
    System.out.println(Proxy.newProxyInstance(Comparable.class.getClassLoader(), new Class[] { Comparable.class },new Proxer(new String("String1"))) instanceof Comparable);
    System.out.print("Proxy is instance of String? ");
    System.out.println(Proxy.newProxyInstance(Comparable.class.getClassLoader(), new Class[] { Comparable.class },new Proxer(new String("String1"))) instanceof String);
    System.out.print("Proxy is instance of Object? ");
    System.out.println(Proxy.newProxyInstance(Comparable.class.getClassLoader(), new Class[] { Comparable.class },new Proxer(new String("String1"))) instanceof Object);
    Output:
    Proxy is instance of Comparable? true
    Proxy is instance of String? false
    Proxy is instance of Object? true

  • Dynamic proxy

    Hi
    Is there such thing as dynamic proxy in AS 3 ?
    I don't want to implement wrapper for interface with XXXX functions
    Thanks

    Unfortunately, I can't use them.
    My employer's policy restricts me from third party libs

  • Dynamic proxy API

    where can i learn about Dynamic Proxy API,..
    can anyone provide me links for the same...
    thank you...

    I would start with.
    [http://www.google.co.uk/search?q=Dynamic+Proxy+API+tutorial]

Maybe you are looking for

  • How can you create a spry menu bar with no background colour?

    How can you create the first level of a spry menu bar to have no colour? I have a coloured background right now and the colour matches when you load the site in Internet explorer but does not match in Firefox. Any suggestions are welcomed on how to f

  • Connecting to Access Point (WiFi) via iPhone 5

    My aim is to have a network configured where all devices can see and communicate with each other, all devices should have access to the internet as standard. The reason why I have decided on a cascading network setup with a "Master" and "Slave" is be

  • Where we can find Short Text data type attachment

    Hi, file type attachements are store in fnd_lob. Where we can find Short Text data type attachment in oracle apps. Regards

  • N800 does not connect to USB for OS update

    Hi, I am trying to update my N800 to use the latest OS2008. I already have the file and also the update wizard in my Windows XP SP2. I used this same computer to update this device from the factory Os to OS2008 (Chinook, one of the first releases). B

  • MSI GE 620 - Need help changing intergrated graphics over to NVIDIA card.

    Hello, I don't know if I should be posting this question in the VGA Products section or the NVidia boards section but here goes anyway! I got an MSI GE 620. Now after I installed all my games onto the new system I notice something was off. My compute