com.ibm.websphere.naming.CannotInstantiateObjectEx ception:Exception occur - Websphere

This is a discussion on com.ibm.websphere.naming.CannotInstantiateObjectEx ception:Exception occur - Websphere ; Hi, when i deploy my portlet app on dev box it throws following error while jndi look up com.ibm.websphere.naming.CannotInstantiateObjectEx ception: Exception occurred while the JNDI NamingManager was processing a javax.naming.Reference object. Root exception is java.lang.IllegalAccessError: com.ibm.ejs.j2c.J2CUtilityClass tried to access method ...

+ Reply to Thread
Results 1 to 20 of 20

Thread: com.ibm.websphere.naming.CannotInstantiateObjectEx ception:Exception occur

  1. com.ibm.websphere.naming.CannotInstantiateObjectEx ception:Exception occur

    Hi,



    when i deploy my portlet app on dev box it throws following error while jndi look up



    com.ibm.websphere.naming.CannotInstantiateObjectEx ception: Exception occurred while the JNDI NamingManager was processing a javax.naming.Reference object. Root exception is java.lang.IllegalAccessError: com.ibm.ejs.j2c.J2CUtilityClass tried to access method com/ibm/ejs/j2c/ConnectorProperty.getName()Ljava/lang/String;



    datasource on WAS is setup successfully and also test connection working perfect....



    the same code works good on my local portal server but failing on dev box portal.



    i tried google but didn't find any helpful result...



    i am not getting what this exception means " Root exception is java.lang.IllegalAccessError:......."


    please suggest any solution.



    Thanks...

  2. Re: com.ibm.websphere.naming.CannotInstantiateObjectEx ception:Exception oc

    Hi, Are you using the same version of WebSphere Portal and the same JDK version?



    The exception is stated as follows:



    http: //java.sun.com/j2se/1.4.2/docs/api/java/lang/IllegalAccessError.html
    Thrown if an application attempts to access or modify a field, or to call a method that it does not have access to.
     
    Normally, this error is caught by the compiler; this error can only occur at run time if the definition of a class has incompatibly changed.




    Regards,

    Brian

  3. Re: com.ibm.websphere.naming.CannotInstantiateObjectEx ception:Exception oc

    Hi Brian,



    thanks for your reply...



    yes the portal version is same..,i will check the jdk version again..and will make sure that it same..

    nice info on the exception detail....



    thanks again..




    http://ExtremePortal.blog.co.uk

  4. Re: com.ibm.websphere.naming.CannotInstantiateObjectEx ception:Exception oc

    Hi Brian,



    I checked the jdk verison of my portal and dev box portal and it is same jdk 1.4.2.



    also i m using the following jar files, and these jar files are also same on my local portal and dev box portal.



    naming.jar

    namingclient.jar

    namingserver.jar

    ojdbc14.jar

    j2cImpl.jar



    could you please suggesst me how to solve this issue ?



    thanks again...

  5. Re: com.ibm.websphere.naming.CannotInstantiateObjectEx ception:Exception oc

    Hi, is this happening during the deploy process or during actually running the application?



    Regards,

    Brian

  6. Re: com.ibm.websphere.naming.CannotInstantiateObjectEx ception:Exception oc

    at the time of running the application, and specially making the connection first time...while calling initialContext.lookup



    deployment is going perfect...

  7. Re: com.ibm.websphere.naming.CannotInstantiateObjectEx ception:Exception oc

    More detailed exception



    ==============



    6/10/08 15:07:34:603 EDT 00000105 Helpers W NMSV0605W: A Reference object looked up from the context "devCell/nodes/devNode/servers/WebSphere_Portal" with the name "jdbc/securityservice" was sent to the JNDI Naming Manager and an exception resulted. Reference data follows:

    Reference Factory Class Name: com.ibm.ejs.j2c.ConnectionFactoryBuilderImpl

    Reference Factory Class Location URLs:
    Reference Class Name: javax.resource.cci.ConnectionFactory

    Type: connectorName

    Content: Security Service

    Type: classpath

    Content: /opt/IBM/WebSphere/AppServer/lib/rsadapter.rar:/opt/IBM/WebSphere/AppServer/lib /rsadapter.rar

    Type: FactoryJndiName

    Content: jdbc/securityservice

    Address Type: dd

    AddressContents: ffffffac ffffffed 0 5 73 72 0 25 63 6f 6d 2e 69 62 6d 2e 65 6a 73 2e 6a 32 63 2e 52 65 73 6f 75 72 63 65 ...

    Address Type: miscProps

    AddressContents: ffffffac ffffffed 0 5 73 72 0 14 6a 61 76 61 2e 75 74 69 6c 2e 50 72 6f 70 65 72 74 69 65 73 39 12 ffffffd0 7a ...

    Address Type: poolProps

    AddressContents: ffffffac ffffffed 0 5 73 72 0 27 63 6f 6d 2e 69 62 6d 2e 65 6a 73 2e 6a 32 63 2e 43 6f 6e 6e 65 63 74 6f ...

    Address Type: configProps

    AddressContents: ffffffac ffffffed 0 5 73 72 0 23 63 6f 6d 2e 69 62 6d 2e 65 6a 73 2e 6a 32 63 2e 43 6f 6e 6e 65 63 74 6f ...

    Address Type: mmProps

    AddressContents: ffffffac ffffffed 0 5 73 72 0 14 6a 61 76 61 2e 75 74 69 6c 2e 50 72 6f 70 65 72 74 69 65 73 39 12 ffffffd0 7a ...

    Address Type: dsProps

    AddressContents: ffffffac ffffffed 0 5 73 72 0 14 6a 61 76 61 2e 75 74 69 6c 2e 50 72 6f 70 65 72 74 69 65 73 39 12 ffffffd0 7a ...

    Address Type: mcfProps

    AddressContents: ffffffac ffffffed 0 5 73 72 0 2d 63 6f 6d 2e 69 62 6d 2e 65 6a 73 2e 6a 32 63 2e 4d 61 6e 61 67 65 64 43 ...

    Address Type: mbeanProps

    AddressContents: ffffffac ffffffed 0 5 73 72 0 1a 63 6f 6d 2e 69 62 6d 2e 65 6a 73 2e 6a 32 63 2e 4d 42 65 61 6e 50 72 6f ...



    Exception data follows:

    java.lang.IllegalAccessError: com.ibm.ejs.j2c.J2CUtilityClass tried to access method com/ibm/ejs/j2c/ConnectorProperty.getName()Ljava/lang/String;

    at com.ibm.ejs.j2c.J2CUtilityClass.createMCFEntry(J2C UtilityClass.java:450)

    at com.ibm.ejs.j2c.ConnectionFactoryBuilderServerImpl .createMCFandPM(ConnectionFac toryBuilderServerImpl.java:531)

    at com.ibm.ejs.j2c.ConnectionFactoryBuilderServerImpl .processObjectInstance(Connec tionFactoryBuilderServerImpl.java:883)

    at com.ibm.ejs.j2c.ConnectionFactoryBuilderImpl.getOb jectInstance(ConnectionFactor yBuilderImpl.java:603)


    ============


    Best Regards,



  8. Re: com.ibm.websphere.naming.CannotInstantiateObjectEx ception:Exception oc

    Hi, which version of WebSphere and Portal and have you entered the security constraints on both servers?



    Brian

  9. Re: com.ibm.websphere.naming.CannotInstantiateObjectEx ception:Exception oc

    Local Portal Environment



    IBM WebSphere Application Server - ND, 6.0.2.17

    Portal - 6.0.1

    Security Not Enabled



    Dev Box Portal Environment



    Portal Version:- 6.0.1.3

    WAS version:- 6.0.2.25

    Security Enabled



    Thanks,



  10. Re: com.ibm.websphere.naming.CannotInstantiateObjectEx ception: Exceptionoc

    Neeraj Sidhaye wrote:
    > More detailed exception
    >
    >
    >


    Did you open a PMR ?

  11. Re: com.ibm.websphere.naming.CannotInstantiateObjectEx ception:Exception oc

    No not yet...



    Regards,



  12. Re: com.ibm.websphere.naming.CannotInstantiateObjectEx ception:Exception oc

    Hi, According to your last post you have security on in the Dev environment. Your application needs to have security constraints in order to work with security.



    Regards,

    Brian

  13. Re: com.ibm.websphere.naming.CannotInstantiateObjectEx ception:Exception oc

    Hi Brian,



    yes correct, i am adding SECURITY_PRINCIPAL and SECURITY_CREDENTIALS to hashmap, please see the code bleow....


    Hashtable env = new Hashtable();

    env.put(Context.INITIAL_CONTEXT_FACTORY,propLoader .getProperty("initialContextF actory"));

    env.put(Context.PROVIDER_URL, propLoader.getProperty("providerurl"));



    env.put(Context.SECURITY_PRINCIPAL," ");

    env.put(Context.SECURITY_CREDENTIALS," ");



    Context initialContext = new InitialContext(env);

    Object dataSource = (Object)initialContext.lookup("jdbc/securityservice");

    DataSource source = (DataSource)PortableRemoteObject.narrow(dataSource ,DataSource.class);

    Connection dbConnection = source.getConnection(dbUserId,dbPassword);


    Am i adding the right key value to hashmap for security ?



    Thanks again,



  14. Re: com.ibm.websphere.naming.CannotInstantiateObjectEx ception:Exception oc

    Hi, A couple things could be wrong here. Do you have roles in your applications? You credentials in your post are empty. Are you really passing empty credentials?



    Regards,

    Brian

  15. Re: com.ibm.websphere.naming.CannotInstantiateObjectEx ception:Exception oc

    ohh...no no no no.... actually it is bacause of character


    i m passing the value



    env.put(Context.SECURITY_PRINCIPAL," ");

    env.put(Context.SECURITY_CREDENTIALS," ");



    and no i m not using any roles in my application.



    thanks again Brian,





  16. Re: com.ibm.websphere.naming.CannotInstantiateObjectEx ception: Exceptionoc

    Neeraj Sidhaye wrote:
    > No not yet...
    >
    >
    >
    > Regards,
    >
    >


    This newsgroup is not a support channel. I suggest that if you think
    there is a WAS problem, that you open one. However, looking at your
    recent posts, you seem to be doing some odd things in your code.

  17. Re: com.ibm.websphere.naming.CannotInstantiateObjectEx ception:Exception oc

    Hi, you probably also need:

    env.put(Context.SECURITY_AUTHENTICATION, YOUR_AUTH_TYPE);




    Regards,

    Brian

  18. Re: com.ibm.websphere.naming.CannotInstantiateObjectEx ception:Exception oc

    Hi,



    i guess the problem is not related to WAS, it seems somethig jar conflicts or jar related issue..



    it would be helpful for me if you can raise those odd things in my code....so that i can corrent them...

    are you talking about those security stuff which i am adding to hashmap ? basically these things i added later on as the code was not working before..so i have to do hit and try...


    Best Regards,



  19. Re: com.ibm.websphere.naming.CannotInstantiateObjectEx ception:Exception oc

    Hi Brian,



    i tried adding Context.SECURITY_AUTHENTICATION, but the same exception is occurring...


    i guess the issue is related to jar...file

    if we see the exception

    java.lang.IllegalAccessError: com.ibm.ejs.j2c.J2CUtilityClass tried to access method com/ibm/ejs/j2c/ConnectorProperty.getName()Ljava/lang/String;

    at com.ibm.ejs.j2c.J2CUtilityClass.createMCFEntry(J2C UtilityClass.java:450).......



    so whenever it tries to call "createMCFEntry" method throws exception,

    could you tell me where i can find the jar file where this ConnectorProperty class exists ?

  20. Re: com.ibm.websphere.naming.CannotInstantiateObjectEx ception:Exception oc



    actually when i explicitly deployed my portlet app WAR from portal admin console, it threw the same exception,

    and when i deploy other way like clicking on my RAD portal server and click on Publish, the portlet was working fine witout any error.



    to resolve this, i deleted j2cImpl.jar and namingserver.jar from my project and deployed.. and things started working fine..



    thanks again for all you help in entire thread...



    Best Regards,




    http://ExtremePortal.blog.co.uk

+ Reply to Thread