title: oracle.iam.platform.utils.NoSuchServiceException : java.lang.reflect.InvocationTargetException
body: <p>I am trying to connect oim server and calling following function from jsf button.
  Here is my function:</p>
  
  <pre><code>public static IdentityManagerAPI connect_ICE_TEST(IdentityManagerAPI api) {
          try {
              System.setProperty("java.security.auth.login.config",
                                 "C:\\JDeveloper\\mywork\\AddRemoveAPP\\AddRemove\\src\\config\\authwl.conf");
              System.setProperty("OIM.AppServerType", "weblogic");
              java.util.Hashtable&lt;String, String&gt; env = new java.util.Hashtable&lt;String, String&gt;();
              env.put("java.naming.provider.url", "t3://&lt;ip address&gt;:&lt;port&gt;");
              env.put("java.naming.factory.initial", "weblogic.jndi.WLInitialContextFactory");
              tcUtilityFactory tcUtilityFactory = new tcUtilityFactory(env, "&lt;username&gt;", "&lt;password&gt;");
              api = IdentityManagerAPI.getAPI(tcUtilityFactory);
          } catch (Exception e) {
              logMap.put("Server connection error", 2);
              e.printStackTrace();
          }
  
          return api;
      }
  </code></pre>
  
  <p>While calling this function from main function , everything works fine. But when I try calling that function from jsf button it returns following exception.
  I have debugged project. I saw it throws exception getting instance from tcUtilityFactory in line 267</p>
  
  <p>Development Enviroment: Jdev 12 c and weblogic 12 c</p>
  
  <blockquote>
    <p>oracle.iam.platform.utils.NoSuchServiceException:
    java.lang.reflect.InvocationTargetException   at
    oracle.iam.platform.OIMClient.getServiceDelegate(OIMClient.java:197)<br>
    at oracle.iam.platform.OIMClient.getService(OIMClient.java:174)   at
    oracle.iam.platform.OIMClient.loginSessionCreated(OIMClient.java:209) 
    at oracle.iam.platform.OIMClient.login(OIMClient.java:136)   at
    oracle.iam.platform.OIMClient.login(OIMClient.java:114)   at
    Thor.API.tcUtilityFactory.(tcUtilityFactory.java:154)   at
    javaClasses.AddRemovePriv.connect_ICE_TEST(AddRemovePriv.java:267)<br>
    at javaClasses.AddRemovePriv.execute(AddRemovePriv.java:124)   at
    beans.bean.btnSubmitAction(bean.java:130)   at
    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)   at
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)   at
    com.sun.el.parser.AstValue.invoke(AstValue.java:254)   at
    com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:302) 
    at
    org.apache.myfaces.trinidad.component.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:46)
    at
    com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
    at
    org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:190)
    at
    javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:794) 
    at
    javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1259)
    at
    oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._invokeApplication(LifecycleImpl.java:1074)
    at
    oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:402)
    at
    oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:225)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)   at
    weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:280)
    at
    weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:254)
    at
    weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:136)
    at
    weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:346)
    at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:25)<br>
    at
    weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79)
    at
    oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:105)
    at
    org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:502)
    at
    oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
    at
    org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:502)
    at
    org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:327)
    at
    org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:229)
    at
    org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
    at
    weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79)
    at
    oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:137) 
    at java.security.AccessController.doPrivileged(Native Method)   at
    oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:315)
    at
    oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:460)
    at
    oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:120)
    at
    oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:217)
    at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:81)<br>
    at
    weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79)
    at
    oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:220)
    at
    weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79)
    at
    weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
    at
    weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79)
    at
    weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3436)
    at
    weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3402)
    at
    weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at
    weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
    at
    weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:57)
    at
    weblogic.servlet.internal.WebAppServletContext.doSecuredExecute(WebAppServletContext.java:2285)
    at
    weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2201)
    at
    weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2179)
    at
    weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1572)
    at
    weblogic.servlet.provider.ContainerSupportProviderImpl$WlsRequestExecutor.run(ContainerSupportProviderImpl.java:255)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:311)   at
    weblogic.work.ExecuteThread.run(ExecuteThread.java:263) Caused by:
    java.lang.reflect.InvocationTargetException   at
    sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) 
    at
    sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
    at
    sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:526)<br>
    at
    oracle.iam.platform.OIMClient.getServiceDelegate(OIMClient.java:193)<br>
    ... 61 more Caused by: java.lang.AssertionError: Failed to generate
    class for weblogic.jndi.internal.ServerNamingNode_1030_WLStub   at
    weblogic.rmi.internal.StubGenerator.generateStub(StubGenerator.java:851)
    at
    weblogic.rmi.internal.StubGenerator.generateStub(StubGenerator.java:842)
    at weblogic.rmi.extensions.StubFactory.getStub(StubFactory.java:73)<br>
    at weblogic.rmi.internal.StubInfo.resolveObject(StubInfo.java:327)<br>
    at weblogic.rmi.internal.StubInfo.readResolve(StubInfo.java:268)   at
    sun.reflect.GeneratedMethodAccessor95.invoke(Unknown Source)   at
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)   at
    java.io.ObjectStreamClass.invokeReadResolve(ObjectStreamClass.java:1104)
    at
    java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1807)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1350) 
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:370)<br>
    at
    weblogic.utils.io.ChunkedObjectInputStream.readObject(ChunkedObjectInputStream.java:208)
    at
    weblogic.rjvm.MsgAbbrevInputStream.readObject(MsgAbbrevInputStream.java:602)
    at
    weblogic.rjvm.MsgAbbrevInputStream.readObjectWL(MsgAbbrevInputStream.java:591)
    at
    weblogic.rjvm.MsgAbbrevInputStream$NestedObjectInputStream.readObjectWL(MsgAbbrevInputStream.java:730)
    at
    weblogic.jndi.internal.WLContextImpl.readExternal(WLContextImpl.java:590)
    at
    java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1837)
    at
    java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1796)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1350) 
    at
    java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1990)
    at
    java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1915) 
    at
    java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1798)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1350) 
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:370)<br>
    at
    weblogic.utils.io.ChunkedObjectInputStream.readObject(ChunkedObjectInputStream.java:208)
    at
    weblogic.rjvm.MsgAbbrevInputStream.readObject(MsgAbbrevInputStream.java:602)
    at weblogic.rjvm.ResponseImpl.getThrowable(ResponseImpl.java:204)   at
    weblogic.rjvm.ResponseImpl.unmarshalReturn(ResponseImpl.java:252)   at
    weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:477)
    at
    weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:285)
    at weblogic.jndi.internal.ServerNamingNode_12130_WLStub.lookup(Unknown
    Source)   at
    weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:440)<br>
    at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:426)
    at javax.naming.InitialContext.lookup(InitialContext.java:411)   at
    org.springframework.jndi.JndiTemplate$1.doInContext(JndiTemplate.java:155)
    at org.springframework.jndi.JndiTemplate.execute(JndiTemplate.java:88)
    at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:153)
    at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:178)
    at
    oracle.iam.platformservice.api.ClientLoginSessionServiceDelegate.(Unknown
    Source)   ... 66 more Caused by:
    java.lang.reflect.InvocationTargetException   at
    sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) 
    at
    sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
    at
    sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:526)<br>
    at
    weblogic.rmi.internal.StubGenerator.generateStub(StubGenerator.java:849)
    ... 105 more Caused by: java.lang.NoSuchMethodError:
    weblogic.rmi.internal.MethodDescriptor.(Ljava/lang/reflect/Method;Ljava/lang/Class;ZZZZII)V
    at
    weblogic.jndi.internal.ServerNamingNode_1030_WLStub.ensureInitialized(Unknown
    Source)   at
    weblogic.jndi.internal.ServerNamingNode_1030_WLStub.(Unknown
    Source)   ... 110 more</p>
  </blockquote>
  
  <p>How can I solve it ?</p>