NoClassDefFoundError when accessing outside class

In my iView I need to reference to a class from a different package. I get NoClassDefFoundError exception trying it.
I have a SharingReference for that package in my portalapp.xml:
<application-config>
<property name="SharingReference" value="myPackage.common" />
</application-config>
As well as I have included reference to that package within the classpath of the deployed application. Also JAR file that contains that package residing in the physical server directory (in .../server0/additional-lib)
Actually it works on SAP EP 6. However it does not work for SAP EP11 version.
What am I missing?
Any suggestion is greatly appreciated.

Thank you Prakash.
I already resolved it.
So, I had to make sure that:
1. class path has it
2. portalapp.xml has the SharingReference
3. PAR file includes the JAR file in the PORTAL-INF/lib

Similar Messages

  • Class not Found when accessing Proxy class from backing bean in VC.

    Hi All,
    I'm attempting to access a class of a webservice(generated as a proxy) within my ADF application and invoke the method within a backing bean of the View Controller(bean scope : backing bean). The proxy has generated an ObjectFactory class among other classes. When I access this Object factory class from within the backing bean, the application throws a Class not found error.
    I don't know where the error lies since I've declared the View Controller of the ADF application dependent on the Proxy and I've imported the class and accessing it within a backing bean. How would you suggest I approach resolveing this.
    JDev : 1.1.1.4
    Thank you.
    Regards
    PP.

    Hello Arun,
    Thank you for suggesting a Data control, but my requirement isn't to drag and drop the method as a button. It's more of a behind the scnes updating data via a database adapter requirement.
    I've resolved the issue. turns out, my deployment archive didn't include the proxy.jpr. Once included it works likea charm.
    Thanks
    PP.

  • How to access a class file outside the package?

    created a two java files Counter.java and TestCounter.java as shown below:
    public class Counter
         public void print()
              System.out.println("counter");
    package foo;
    public class TestCounter
         public static void main(String args[])
              Counter c = new Counter();
              c.print();
    Both these files are stored under "D:\Test". I first compiled Counter.java and got Counter.class which resides in folder "D:\Test"
    when i compile TestCounter.java i got the following error message:
    D:\Test>javac -classpath "d:\Test" -d "d:\Test" TestCounter.java
    TestCounter.java:6: cannot find symbol
    symbol : class Counter
    location: class foo.TestCounter
    Counter c = new Counter();
    ^
    TestCounter.java:6: cannot find symbol
    symbol : class Counter
    location: class foo.TestCounter
    Counter c = new Counter();
    ^
    2 errors
    what could be the problem. Is it possible to access a class file outside the package?

    ya that's fine..if we have two java files where both resides in the same package works fine or two java files which donot have a package statement also works fine. But my doubt is, i have a Counter.class which does not reside in a package and i have a TestCounter.class which resides in a package "foo", in such a scenario, how do i tell to the compiler that "Counter.class resides in such a path, please look at that and give me TestCounter.class". i cannot use import statement to import Counter.class in TestCounter.java because i donot have a package for Counter.java.

  • Java.lang.NoClassDefFoundError exception when accessing BDB container using WAS

    Dear Techies,
    I installed BDB 2.5.16 on a Solaris 10 machine using the below build arguments.
    bash ./buildall.sh -c gcc -x g++ --with-configure-env="CFLAGS='-mcpu=v9' CXXFLAGS='-mcpu=v9' LDFLAGS='-mcpu=v9 -L$PWD/install/lib'" --enable-java --prefix=<installation target path>
    I am able to create BDB container and access it from a standalone java class. But, when I try to achieve the same using application deployed on WebSphere (WAS 7.0.0.23 ND 64 bit), it throws me the below error:
    Caused by: java.lang.NoClassDefFoundError: Could not initialize class com.sleepycat.db.internal.db_javaJNI
      at com.sleepycat.db.internal.DbEnv.<init>(DbEnv.java:264)
      at com.sleepycat.db.EnvironmentConfig.createEnvironment(EnvironmentConfig.java:3910)
      at com.sleepycat.db.EnvironmentConfig.openEnvironment(EnvironmentConfig.java:3863)
      at com.sleepycat.db.Environment.<init>(Environment.java:93)
      at com.ins.sot.batch.CreateBDBEnvProcessor.process(CreateBDBEnvProcessor.java:59)
      at com.ins.batch.BatchDeligator.deligateJob(BatchDeligator.java:32)
      at com.ins.batch.BatchService.processBatch(BatchService.java:65)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at com.ibm.ws.webservices.engine.dispatchers.java.JavaDispatcher.invokeMethod(JavaDispatcher.java:178)
      at com.ibm.ws.webservices.engine.dispatchers.java.JavaDispatcher.invokeOperation(JavaDispatcher.java:141)
      at com.ibm.ws.webservices.engine.dispatchers.SoapRPCProcessor.processRequestResponse(SoapRPCProcessor.java:490)
      at com.ibm.ws.webservices.engine.dispatchers.SoapRPCProcessor.processMessage(SoapRPCProcessor.java:433)
      at com.ibm.ws.webservices.engine.dispatchers.BasicDispatcher.processMessage(BasicDispatcher.java:134)
      at com.ibm.ws.webservices.engine.dispatchers.java.SessionDispatcher.invoke(SessionDispatcher.java:204)
    I am not sure what the problem is, and what to do next. Is it a 32-bit JVM vs 64-bit JVM (on WAS) issue? Can someone kindly help?
    This is my first application with BDB. Kindly bear if I sound too basic.
    Thanks & Regards
    Amit

    Hello, the missing class is in reposimpl.jar. In fact you need to add a lot of jars to publicapi.jar. Publicapi.jar is simply a public entry point to the common library used by other components (the GUI, OMBPlus,etc). I suggest you browse the scripts OWB_HOME/owb/bin/unix/setowbenv.sh or OWB_HOME/owb/bin/win32/setowbenv.bat depending on you OS, and start with the content of the OMBCLASSPATH variable.
    Make sure you have corrected the problem with JCE libraries, as mentioned in thread OWB client not working
    pubapi_javadoc.jar contains the docs, but if you've reached this far I suppose you already have it.
    Good work, Antonio

  • Java.lang.NoClassDefFoundError when compile class in Weblogic Linux Env.

    Hi,
    I'm trying jay article ( http://jaysensharma.wordpress.com/2009/08/17/mdb3-0-sample-for-weblogic-application-server/ ) for send message
    to JMS, it works great in windows but in Linux is failed.
    I’m facing the issue when compile QueueSend class linux environment,
    but windows it works great.
    in windows I compile the class like this :
    C:\bea\user_projects\domains\MyDomain\bin>setDomainEnv.cmd
    C:\bea\user_projects\domains\MyDomain>java QueueSend t3://localhost:7001
    JMS Message Sent: Test Message Body with counter = 0
    JMS Message Sent: Test Message Body with counter = 1
    in Linux :
    after ./setDomainEnv,
    $bea\…\MYDOMAIN\bin >java QueueSend t3://localhost:7001
    Exception in thread “main” java.lang.NoClassDefFoundError: javax/jms/Message
    Caused by: java.lang.ClassNotFoundException: javax.jms.Message
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    I think it cannot find the java_home or classpath properly, how to solve this issue?
    Really thanks in advance.
    Edited by: muhkah on 09-Apr-2010 19:58

    Hi Muhkah,
    Please add the *"<BEA_HOME>\modules\javax.jms_1.1.1.jar"* file also in the Client ClassPath.
    But the Best thing i will suggest it to Just add the "wlfullClient.jar" file in the client ClassPath...this is a very useful Jar file which solves many many issues. There is a very simple way to create this JAR file: http://jaysensharma.wordpress.com/2010/02/03/building-wlfullclient-jar/
    <BR>
    The advantage of using *"wlfullclient.jar"* is Just Make it once and then reuse this single Jar in any client Application which is going to interact with WebLogic. This Powerful Jar contains almost all the Classes which is needed by a Client.
    Now you can run your Client Program like this :
    java    -classpath    /app/bea10.3/wl_server/server/lib/wlfullclient.jar    QueueSend t3://localhost:7001
    Thanks
    Jay SenSharma

  • Can Access Outside Dll's Friend Functions On Own Class

    Can Access Outside Dll's Friend Functions On Own Class?
    For Example:
    System.Web.Util's SecUtility ?SecUtility is : internal static class SecUtility

    See the answer by nobugz to this
    thread.

  • In onLoad JavaScript, I'm getting "Error: Permission denied to access property 'classes'" when I access Components.classes; how do I enable that permission?

    I need to emulate several ActiveX functions in my client's web application. I have located several Mozilla web pages that describe how to do the things I need, and I have attempted to implement those instructions. However, I can't seem to get past the first line of code. In my web page, I am calling a JavaScript function using the onLoad attribute of the <body> tag. I am using the Navigator object to determine that the browser is Firefox. I then attempt to access the extension classes using the following code on lines 51 and 52 of the Download.js file:
    var C = Components;
    var CC = C.classes;
    The Web Console gives me these two messages:
    [13:51:55.621] The Components object is deprecated. It will soon be removed. @ http://distribution:781/NewDDI/DownLoad.js:51
    [13:51:55.621] Error: Permission denied to access property 'classes' @ http://distribution:781/NewDDI/DownLoad.js:52
    How do I enable adequate permission to be able to access the Components classes?

    I think Components is available only in extensions (or otherwise privileged code) and not in ordinary web pages.

  • Error when accessing Oracle BPEL console

    The following error message shows up when access oracle BPEL console. Any advice to resolve this error? Thanks a lot in advance!
    ***************************************************************************** Oracle BPEL Server version 10.1.3.1.0 Build: 0 Build time: Mon Oct 09 08:44:49 PDT 2006 Build type: release Source tag: PCBPEL_10.1.3.1.0_GENERIC_061009.0802
    Exception Message:
    [java.lang.NoClassDefFoundError] org/apache/log4j/Category
    Exception Trace:
    java.lang.NoClassDefFoundError: org/apache/log4j/Category at java.lang.Class.getDeclaredConstructors0(Native Method) at java.lang.Class.privateGetDeclaredConstructors(Class.java:2328) at java.lang.Class.getConstructor0(Class.java:2640) at java.lang.Class.getConstructor(Class.java:1629) at org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:410) at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:529) at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:235) at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:370) at org.collaxa.thirdparty.apache.axis.components.logger.LogFactory.getLog(LogFactory.java:37) at org.collaxa.thirdparty.apache.axis.encoding.TypeMappingImpl.(TypeMappingImpl.java:68) at com.collaxa.cube.engine.deployment.TypeSoapRegistry.registerHeaderTypes(TypeSoapRegistry.java:251) at com.collaxa.cube.engine.deployment.TypeSoapRegistry.load(TypeSoapRegistry.java:79) at com.collaxa.cube.engine.core.TypeRegistry.load(TypeRegistry.java:126) at com.collaxa.cube.engine.CubeEngine.__load(CubeEngine.java:613) at com.collaxa.cube.engine.CubeEngine.load(CubeEngine.java:474) at com.collaxa.cube.admin.ServerManager.loadDomain(ServerManager.java:1111) at com.collaxa.cube.admin.ServerManager.loadAllDomains(ServerManager.java:924) at com.collaxa.cube.admin.ServerManager.init(ServerManager.java:111) at com.collaxa.cube.ejb.impl.ServerBean.init(ServerBean.java:254) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at com.evermind.server.ejb.interceptor.joinpoint.EJBJoinPointImpl.invoke(EJBJoinPointImpl.java:35) at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119) at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52) at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119) at com.evermind.server.ejb.interceptor.system.JAASInterceptor$1.run(JAASInterceptor.java:31) at java.security.AccessController.doPrivileged(Native Method) at javax.security.auth.Subject.doAs(Subject.java:396) at com.evermind.server.ThreadState.runAs(ThreadState.java:622) at com.evermind.server.ejb.interceptor.system.JAASInterceptor.invoke(JAASInterceptor.java:34) at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119) at com.evermind.server.ejb.interceptor.system.TxNotSupportedInterceptor.invoke(TxNotSupportedInterceptor.java:43) at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119) at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52) at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119) at com.evermind.server.ejb.InvocationContextPool.invoke(InvocationContextPool.java:55) at com.evermind.server.ejb.StatelessSessionEJBObject.OC4J_invokeMethod(StatelessSessionEJBObject.java:87) at ServerBean_RemoteProxy_4bin6i8.init(Unknown Source) at com.collaxa.cube.admin.CXLoaderServlet.init(CXLoaderServlet.java:60) at javax.servlet.GenericServlet.init(GenericServlet.java:256) at com.evermind.server.http.HttpApplication.loadServlet(HttpApplication.java:2361) at com.evermind.server.http.HttpApplication.findServlet(HttpApplication.java:4810) at com.evermind.server.http.HttpApplication.findServlet(HttpApplication.java:4734) at com.evermind.server.http.HttpApplication.initPreloadServlets(HttpApplication.java:4922) at com.evermind.server.http.HttpApplication.initDynamic(HttpApplication.java:1134) at com.evermind.server.http.HttpApplication.(HttpApplication.java:738) at com.evermind.server.ApplicationStateRunning.getHttpApplication(ApplicationStateRunning.java:414) at com.evermind.server.Application.getHttpApplication(Application.java:545) at com.evermind.server.http.HttpSite$HttpApplicationRunTimeReference.createHttpApplicationFromReference(HttpSite.java:1990) at com.evermind.server.http.HttpSite$HttpApplicationRunTimeReference.(HttpSite.java:1909) at com.evermind.server.http.HttpSite.initApplications(HttpSite.java:645) at com.evermind.server.http.HttpSite.setConfig(HttpSite.java:290) at com.evermind.server.http.HttpServer.setSites(HttpServer.java:270) at com.evermind.server.http.HttpServer.setConfig(HttpServer.java:177) at com.evermind.server.ApplicationServer.initializeHttp(ApplicationServer.java:2450) at com.evermind.server.ApplicationServer.setConfig(ApplicationServer.java:998) at com.evermind.server.ApplicationServerLauncher.run(ApplicationServerLauncher.java:131) at java.lang.Thread.run(Thread.java:595)

    ru able to login to the other applications on your App server ... viz.
    Oracle App Server Console, ESB Console, Worklist App ... etc

  • Rmi interface not loading when invoked from class in package

    Hi, It would be a great help if you could help me out with the following problem:
    The RMIClient fails to detect the remote object interface in the current directory when i place it within a package.
    1) I tried placing the remote object interface in the same package - this didn't change the error output.
    2) I tried to import the remote object by placing the parent's parent directory in the classpath - a new error popped up saying the file did not contain any class! Since its an RMI interface extending remote, it dosen't involve a class directly.
    The following is my client code:
    package java.util.logging;  // Without this line, this client works fine.
    import java.rmi.*;
    import java.rmi.server.*;
    import java.io.*;
    import java.util.logging.*;
    import logTest.RMIChannel;
    public class RMIChannelClient
       public static void main(String[] args)
          System.setProperty("java.security.policy", "client.policy");
          System.setSecurityManager(new RMISecurityManager());
          String url = "rmi://acrux.cis.ksu.edu/";
          LogRecord record= new LogRecord(Level.ALL,"");
          try
             RMIChannel rc = (RMIChannel)Naming.lookup(url + "RMI_Channel");
          rc.sendRecord(record);
          catch(Exception e)
             e.printStackTrace();
    }The following is my interface extending remote:
    //package java.util.logging;  // I tried adding and removing this line but to no avail
    import java.rmi.*;
    import java.util.logging.LogRecord;
    public interface RMIChannel extends Remote
      String getDescription() throws RemoteException;
      void sendRecord(LogRecord record) throws RemoteException;
    }Could anyone suggest a solution to this issue?
    Thanks.

    ok. i was hoping to write my own logging class (extending upon sun's classes). while doing this, i found that LogManager.getStringProperty() is not a public method and cannot be accessed outside the java.util.logging package and the compiler complained. So i tried placing my file in java.util.logging package and it compiled fine. Is there a way i can use a method thats not declared public without importing its package?

  • NoClassDefFoundError when using URLClassLoader

    Hi,
    I have an applet which tries to load a jar file dynamically. I am giving the code snippet here.
    loader = new URLClassLoader(new URL[] { new URL("http://localhost:4095/jars/dynamicload.jar") });
    m_class = loader.loadClass("loader.DynamicLoadedClass");
    (loader.DynamicLoadedClass) prntr = (loader.DynamicLoadedClass) m_class.newInstance();
    But this is throwing a NoClassDefFoundError when I try to cast the new instance to a DynamicLoadedClass.
    Can anybody help me correct this problem?
    Thanks
    Unni

    It will be happening when your code tries to access loader.DynamicLoadedClass for the cast. When a class accesses another class implicitly it asks the ClassLoader that loaded it for the class. That will presumably be the standard class loader that points to the classpath, and knows nothing about your dynamically loaded class.
    Really if you mention a class to the compiler then there's no point in trying to load it dynamically, since you must already have it locally to do the compilation.
    Usually you know that an dynamically loaded class will conform to some abstract class or interface you have locally, and you cast the new instance to that. That works because standard classloader delegation means your URLClassLoader will take classes from the class path if they are there.

  • Controlling Access to Classes

    Hi,
    I know that you can use the keywords private and protected for methods and variables, but can you also use these keywords at the class level? I understand that the public modifier enables a class to be accessed outside of its package, and that if no modifier is used, then the class can be accessed by any class within the same package. But what would the private and protected keywords mean at the class level?
    Thx.

    I know that you can use the keywords private and
    protected for methods and variables, but can you also
    use these keywords at the class level? I understand
    that the public modifier enables a class to be
    accessed outside of its package, and that if no
    modifier is used, then the class can be accessed by
    any class within the same package. But what would the
    private and protected keywords mean at the class
    level?They cause a compile-time error.
    It's can be explained.
    private modifer forbid(? a don't know how to translate :) ) access to class, why you must need class that you can't access?
    protected modifer used when you inheritr something/ but tou newer inherite class. You inherit it'as member.
    It was simple question :)

  • Accessing a Class in a Package[in a dir]  via Different Directory

    Hi,
    I am trying to access a class belonging to a package in a directory via another class in a different directory.
    However, there are problems.
    Here is what I do:
    I created a source file ProtectedTest2.java
    package com.java.MyLesson.ch8;
    public class ProtectedTest2
    private int iN1, iN2;
    public ProtectedTest2(){ }
    public ProtectedTest2(int iA, int iB)
    iN1 = iA;
    iN2 = iB;
    public String getNumbers()
    return "Numbers are: "+iN1 +" and "+ iN2;
    } After that, I compiled this file with javac -d C:\\MyUserClasses ProtectedTest2.java. There was no problem.
    I then, created another source file TestPro2.java and imported ProtectedTest2 in TestPro
    import javax.swing.JOptionPane;
    import com.java.MyLesson.ch8.ProtectedTest2;
    public class TestPro2 extends ProtectedTest2
    public TestPro2()
    ProtectedTest2 pro = new ProtectedTest2(8,12);
    JOptionPane.showMessageDialog(null, p.getNumbers() );
    public static void main(String args[])
    new TestPro2();
    System.exit(0);
    } Then, I continue to compile TestPro2.java like this:
    javac -classpath C:\\MyUserClasses TestPro2.java -- there was no problem, but when I try to execute
    TestPro2, the error I got was :
    Exception in thread "main" java.lang.NoClassDefFoundError: com/java/MyLesson/ch8/ProtectedTest2
    at java.lang.ClassLoader.defineClass0(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader . java:502)
    I understand that the class loader will look into the classpath[current directory] if it cannot find the user- defined class [ProtectedTest2.class] in the standard and optional java packages. Why did the application raise error if I have specified the classpath for the ProtectedTest2.class [which is in C:\MyUserClasses] during the compilation of TestPro2.java ?
    Can someone please correct me and tell me what is the mistake here ?
    Thank you all! :-)

    You need to have C:\MyUserClasses in the class search path both when compiling and running.
    Where the compiler finds a depency class is not saved in the generated .class file, so the runtime is on its own when it needs to find it. If C:\MyUserClasses is not in the class search path, the runtime doesn't know that it should be looking for ProtectedTest2 there. In addition to MyUserClasses you want to search for classes in the current directory (the path ".") so the command to execute TestPro2 is:
    java -classpath .;C:\MyUserClasses TestPro2
    See also the document on how classes are found (if you already haven't)
    http://java.sun.com/j2se/1.4.2/docs/tooldocs/findingclasses.html

  • Problem with Dynamically accessing EJB Class objects in WL 7.0 SP1

    I am trying to build a component which has the ability to instantiate and execute
    an known EJB method on the fly.
    I have managed to build the component but when I try and execute it I get a ClassNotFoundException.
    I know that the EJB I am trying to invoke is deployed and available on the server,
    as I can see it in the console, I also seen to have been able to get the remote
    interface of the object, my problem occurs when I try and access the class object
    so I can perform a create on the object and then execute my method
    The code I have written is below:
    private Object getRemoteObject(Context pCtx, String pJNDIName, String pHomeBean)
    throws Exception {
         String homeCreate = "create";
         Class []homeCreateParam = { };
         Object []homeCreateParamValues = {};           
    try {  
    //This call seems to work and doesn't throw an exception     
    Object home = pCtx.lookup(pJNDIName);
    //However this call throws a java.lang.ClassNotFoundException
    Class homeBean = Class.forName(pHomeBean);
    Method homeCreateMethod = homeBean.getMethod(homeCreate,homeCreateParam);
    return homeCreateMethod.invoke(home, homeCreateParamValues);
    } catch (NamingException ne) {             
    logStandardErrorMessage("The client was unable to lookup the EJBHome.
    Please make sure ");
    logStandardErrorMessage("that you have deployed the ejb with the JNDI
    name "+pJNDIName+" on the WebLogic server ");
    throw ne;
    } catch (Exception e) {
    logStandardErrorMessage(e.toString());
    throw e;     
    Any advice would be really appreciated, I'm fast running out of ideas, I suspect
    it has something to do with the class loader but I'm not sure how to resolve it
    Regards
    Jo Corless

    Hello Joanne,
    Congratulations! I'm very happy that you've managed to fix your problem. It's
    always essential to understand how to package applications when deploying on BEA
    WebLogic. Usually, by throwing everything into an EAR file solves just about all
    the class loader problems. :-) Let us know if you have any further problems that
    we can assist you with.
    Best regards,
    Ryan LeCompte
    [email protected]
    http://www.louisiana.edu/~rml7669
    "Joanne Corless" <[email protected]> wrote:
    >
    >
    I've fixed it!!!!!!!!
    Thanks to everyone who gave me help!!!!
    The class loader was the culprit which is what I suspected all along.
    As soon
    as I put the 2 jar files I was using into an EAR file the problem went
    away!!!!!
    Thanks again
    Jo Corless
    "Ryan LeCompte" <[email protected]> wrote:
    Hello Joanne,
    As Mr. Woollen mentioned, I also believe it's a problem with the class
    loader.
    You need to be careful how you arrange your EJBs, because WebLogic has
    a specific
    method in which it loads classes in an EAR, JAR, and WAR file(s). Please
    refer
    to http://dev2dev.bea.com/articles/musser.jsp for more information about
    BEA WebLogic
    class loading mechanisms and caveats. Also, try printing out the various
    methods
    that are available on the object that was returned to you via reflection.
    For
    example, use the getMethods() method, which returns an array of Method
    objects
    that you can subsequently cycle through and print out the various method
    names.
    This way you can discover if the class found/returned to you is indeed
    the one
    you intend to locate.
    Hope this helps,
    Ryan LeCompte
    [email protected]
    http://www.louisiana.edu/~rml7669
    Rob Woollen <[email protected]> wrote:
    I believe the issue is the home interface class for this EJB is not
    available in the class loader which is doing the reflection.
    If you do:
    getClass().getClassLoader().loadClass(homeInterfaceClassName)
    I suspect it will fail. Reflection still requires that the class be
    loadable.
    -- Rob
    Joanne Corless wrote:
    Hi Slava,
    If I make my code look like you describe below I get a compliationerror telling
    me that
    home.getMethod() is not recognised (no such method)
    If I change it slightly and use
    Method homeCreateMethod =
    home.getClass().getMethod(homeCreate,homeCreateParam);
    The code will compile OK but when executed it still throws a NoSuchMethodException
    Any ideas ?
    Thanks for your help so far
    Regards
    Jo Corless
    Your code should look like
    Object home = pCtx.lookup(pJNDIName);
    Method homeCreateMethod =
    home.getMethod(homeCreate,homeCreateParam);
    return homeCreateMethod.invoke(home, homeCreateParamValues);
    Regards,
    Slava Imeshev
    "Joanne Corless" <[email protected]> wrote in message
    news:[email protected]...
    Hi Ryan,
    I also wanted to mention that if you do a "header search" in this
    particular
    newsgroup
    with the search query as "reflection", you will see many previousmessages
    regarding
    reflection and EJBs. I believe you could learn a lot from thedifficulties
    that
    others have faced and solved.I tried that and although there was a number of similar cases noneof them
    actually
    seem to fix my issue. Thanks for the suggestion though
    Are the EJBs that you are trying to access accessible via your
    system
    classpath?
    Try to avoid having them accessible via the main system classpath,and
    only bundle
    them in your appropriate EJB jar files (contained in an EAR file,for
    example).Maybe I should have laid the problem out a little clearer.
    I have a number of EJB's bundled up in a JAR file which is hot deployedto
    the
    server. Within this first JAR file is an EJB (SSB) component that
    needs
    to
    be
    able to invoke a known method on another EJB. This second EJB may
    or
    may
    not be
    within the first JAR file but it also will be hot deployed.
    The component trying to invoke the method on the 2nd EJB has to
    be
    able to
    create
    an instance of the 2nd EJB without actually knowing anything bar
    a
    JNDI
    Name which
    is passed in at runtime.
    I can get as far as doing the
    Object home = pCtx.lookup(pJNDIName);
    This returned a class with the name
    "com.csc.edc.projects.allders.httppostoffice.postman.PostmanBean_mp8qy2_Home
    Impl_WLStub"
    My problem seems to occur when I try and invoke the create method
    Method homeCreate = home.getClass().getMethod("create", new Class[0]);
    My code throws a java.lang.NoSuchMethodException at this point so
    I
    am
    unable
    to progress to the next step of :
    Object bean = homeCreate.invoke(home, null);
    So I can return the instantiated bean back to the calling client.
    Why am I getting the NoSuchMethodException, is is because I am gettinga
    stub
    back rather than the home interface and if so how do I get the truehome
    interface
    from the bean
    Thanks in advance
    Jo Corless

  • NoClassDefFoundError when trying to return a custom Object

    Hi,
    I'm trying to get some system memory info from a Windows machine using Java. I've written the C code and Java code and it all compiles fine. I can also use most of the methods in the two files. I have a problem with one method though. Its a method that is returning an object type that I created that mirrors a windows structure. Below is the code.
    // Java Object to store the data
    package agent.win32;
    public class MemoryInfo{
      int dwLength;
      int dwMemoryLoad;
      int dwTotalPhys;
      int dwAvailPhys;
      int dwTotalPageFile;
      int dwAvailPageFile;
      int dwTotalVirtual;
      int dwAvailVirtual;
      public int get_dwLength() { return dwLength; }
      public int get_dwMemoryLoad() { return dwMemoryLoad; }
      public int get_dwTotalPhys() { return dwTotalPhys; }
      public int get_dwAvailPhys() { return dwAvailPhys; }
      public int get_dwTotalPageFile() { return dwTotalPageFile; }
      public int get_dwAvailPageFile() { return dwAvailPageFile; }
      public int get_dwTotalVirtual() { return dwTotalVirtual; }
      public int get_dwAvailVirtual() { return dwAvailVirtual; }
    // Java Class that uses JNI
    package agent.win32;
    public class NIMSNT {
      //Constructor
      public NIMSNT(){};
      static{
        try{
          System.loadLibrary("NIMSNT");
        catch (java.lang.UnsatisfiedLinkError e) {
          System.out.println (e);
       * check psapi.dll and psapi functions
       * return true if NT process can be enumerate
      public static native boolean Initialize();
       * Description:The EnumProcesses function retrieves the process identifier
       * for each process object in the system
       * return value:the list of process identifiers
       * call psapi function EnumProcesses
      public static native int[] EnumProcesses();
       * Description:The OpenProcess function returns a handle to an existing process object.
       * return value:If the function succeeds, the return value is an open handle to the specified process
       * call kernel32 function OpenProcess
      public static native int OpenProcess(int Pid);
       * Description:The EnumProcessModules function retrieves a handle for each module in the specified process
       * return value:the list of module handles
       * call psapi function EnumProcessModules
      public static native int[] EnumProcessModules(int hProcess);
       * Description:The GetModuleFileNameEx function retrieves the fully qualified path for the specified module
       * return value:the fully qualified path for the specified module
       * call psapi function GetModuleFileNameEx
      public static native String GetModuleFileName(int hProcess,int hModule);
       * Description:The GetModuleBaseName function retrieves the base name of the specified module
       * return value:the base name of the specified module
       * call psapi function GetModuleBaseName
      public static native String GetModuleBaseName(int hProcess,int hModule);
       * Description:function closes an open object handle
       * return value:true if succesfuly
       * call kernel32 function CloseHandle
      public static native boolean CloseHandle(int handle);
       * Description:function gets system memory
       * return value:String
      public static native MemoryInfo GetSystemMemoryInfo();
    // C Structure (defined in windows.h)
    typedef struct _MEMORYSTATUS {
      DWORD dwLength;
      DWORD dwMemoryLoad;
      SIZE_T dwTotalPhys;
      SIZE_T dwAvailPhys;
      SIZE_T dwTotalPageFile;
      SIZE_T dwAvailPageFile;
      SIZE_T dwTotalVirtual;
      SIZE_T dwAvailVirtual;
    } MEMORYSTATUS, *LPMEMORYSTATUS;
    // C code
    #include <windows.h>
    #include <string.h>
    #include "agent_win32_NIMSNT.h"
    #define MaxProcessNumber 10000
    /** Type Definitions                                  **/
    typedef BOOL (WINAPI *ENUMPROCESSES)(
         DWORD * lpidProcess, 
           DWORD cb,            
           DWORD * cbNeeded     
    typedef BOOL (WINAPI *ENUMPROCESSMODULES)(
         HANDLE hProcess,     
         HMODULE * lphModule, 
         DWORD cb,            
         LPDWORD lpcbNeeded   
    typedef DWORD (WINAPI *GETMODULEFILENAMEEXA)(
         HANDLE hProcess,          
         HMODULE hModule,          
         LPTSTR lpstrFileName,     
         DWORD nSize               
    typedef DWORD (WINAPI *GETMODULEBASENAME)(
         HANDLE hProcess,          
         HMODULE hModule,          
         LPTSTR lpstrFileName,     
         DWORD nSize               
    typedef struct _PROCESS_MEMORY_COUNTERS {
        DWORD cb;
        DWORD PageFaultCount;
        DWORD PeakWorkingSetSize;
        DWORD WorkingSetSize;
        DWORD QuotaPeakPagedPoolUsage;
        DWORD QuotaPagedPoolUsage;
        DWORD QuotaPeakNonPagedPoolUsage;
        DWORD QuotaNonPagedPoolUsage;
        DWORD PagefileUsage;
        DWORD PeakPagefileUsage;
    } PROCESS_MEMORY_COUNTERS, *PPROCESS_MEMORY_COUNTERS;
    typedef BOOL (WINAPI *GETPROCESSMEMORYINFO)(
         HANDLE hProcess,
         PPROCESS_MEMORY_COUNTERS ppsmenCounters,
         DWORD cb
    /** Global Variables                                  **/
    ENUMPROCESSES EnumProcesses;
    ENUMPROCESSMODULES EnumProcessModules;
    GETMODULEFILENAMEEXA GetModuleFileNameExA;
    GETMODULEBASENAME GetModuleBaseName;
    GETPROCESSMEMORYINFO GetProcessMemoryInfo;
    /** DLL Entry                                         **/
    BOOL APIENTRY DllMain(HANDLE hInst, DWORD ul_reason_being_called, LPVOID lpReserved){    
         return TRUE;
    * Class:     nims4_agent_win32_NIMSNT
    * Method:    Initialize
    * Signature: ()Z
    JNIEXPORT jboolean JNICALL Java_agent_win32_NIMSNT_Initialize(JNIEnv * env,jclass clazz){
         HANDLE hpsapi=LoadLibrary("PSAPI.DLL");
         if (hpsapi==NULL) return FALSE;
         EnumProcesses=(ENUMPROCESSES)GetProcAddress((HINSTANCE)hpsapi,"EnumProcesses");
         GetModuleFileNameExA = (GETMODULEFILENAMEEXA)GetProcAddress((HINSTANCE)hpsapi, "GetModuleFileNameExA");
         GetModuleBaseName = (GETMODULEBASENAME)GetProcAddress((HINSTANCE)hpsapi, "GetModuleBaseNameA");
         EnumProcessModules = (ENUMPROCESSMODULES)GetProcAddress((HINSTANCE)hpsapi, "EnumProcessModules");
         GetProcessMemoryInfo = (GETPROCESSMEMORYINFO)GetProcAddress((HINSTANCE)hpsapi, "GetProcessMemoryInfo");
         if (
              NULL == EnumProcesses          ||
              NULL == GetModuleFileName     ||
              NULL == GetModuleBaseName     ||
              NULL == EnumProcessModules  )
            return FALSE;
         return TRUE;   
    * Class:     nims4_agent_win32_NIMSNT
    * Method:    EnumProcesses
    * Signature: ()[I
    JNIEXPORT jintArray JNICALL Java_agent_win32_NIMSNT_EnumProcesses(JNIEnv * env, jclass clazz){
         DWORD aPids[MaxProcessNumber];
         DWORD cGot;
         jintArray Pids=0;
         if(EnumProcesses(aPids,sizeof(aPids),&cGot)){
              cGot /= sizeof(aPids[0]);
                 Pids= (*env)->NewIntArray(env,cGot);
              (*env)->SetIntArrayRegion(env,Pids,0,cGot,(jint*) aPids);
         return Pids;
    * Class:     nims4_agent_win32_NIMSNT
    * Method:    OpenProcess
    * Signature: (IZI)I
    JNIEXPORT jint JNICALL Java_agent_win32_NIMSNT_OpenProcess (JNIEnv * env, jclass clazz,jint Pid){
         return (jint) OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ,FALSE,Pid);
    * Class:     nims4_agent_win32_NIMSNT
    * Method:    EnumProcessModules
    * Signature: (I[I)[I
    JNIEXPORT jintArray JNICALL Java_agent_win32_NIMSNT_EnumProcessModules (JNIEnv * env, jclass clazz, jint hProcess){
         HMODULE hModule[MaxProcessNumber];
         jintArray jModule=0;
         DWORD cGot;    
         if (EnumProcessModules((HANDLE)hProcess,hModule,sizeof(hModule),&cGot)){
              cGot/= sizeof(hModule[0]);
              jModule= (*env)->NewIntArray(env,cGot);
              (*env)->SetIntArrayRegion(env,jModule,0,cGot,(jint*)hModule);
         return jModule;
    * Class:     nims4_agent_win32_NIMSNT
    * Method:    GetModuleFileName
    * Signature: (II)Ljava/lang/String;
    JNIEXPORT jstring JNICALL Java_agent_win32_NIMSNT_GetModuleFileName(JNIEnv * env, jclass clazz, jint hProcess, jint hModule){
         jstring jName=0;
         char FileName[MAX_PATH];
         if(GetModuleFileNameExA((HANDLE)hProcess,(HMODULE)hModule,FileName,sizeof(FileName))!=0){
              jName=(*env)->NewStringUTF(env,FileName);
         return jName;
    * Class:     nims4_agent_win32_NIMSNT
    * Method:    GetModuleBaseName
    * Signature: (II)Ljava/lang/String;
    JNIEXPORT jstring JNICALL Java_agent_win32_NIMSNT_GetModuleBaseName(JNIEnv * env, jclass clazz, jint hProcess, jint hModule){
         jstring jName=0;
         char FileName[MAX_PATH];
         if(GetModuleBaseName((HANDLE)hProcess,(HMODULE)hModule,FileName,sizeof(FileName))!=0){
              jName=(*env)->NewStringUTF(env,FileName);
         return jName;
    * Class:     nims4_agent_win32_NIMSNT
    * Method:    CloseHandle
    * Signature: (I)Z
    JNIEXPORT jboolean JNICALL Java_agent_win32_NIMSNT_CloseHandle(JNIEnv * env, jclass clazz, jint handle)
         return CloseHandle((HANDLE) handle);
    * Class:     nims_agent_win32_NIMSNT
    * Method:    GetSystemMemoryInfo
    * Signature: (I)Lagent/win32/MemoryInfo;
    JNIEXPORT jobject JNICALL Java_agent_win32_NIMSNT_GetSystemMemoryInfo(JNIEnv * env, jclass clazz){
         jfieldID jfield;
         jobject jobj=0;
         MEMORYSTATUS stat;
         stat.dwLength = sizeof(stat);
         GlobalMemoryStatus(&stat);
         clazz=(*env)->FindClass(env,"agent.win32.NIMSMemoryInfo");
         if (clazz==0) return 0;
         jobj = (*env)->AllocObject (env,clazz);
         //set NIMSMemoryInfo object field
         // dwLength
         jfield=(*env)->GetFieldID(env,clazz,"dwLength","I");
         (*env)->SetIntField (env,jobj, jfield,stat.dwLength);
         // dwMemoryLoad
         jfield=(*env)->GetFieldID(env,clazz,"dwMemoryLoad","I");
         (*env)->SetIntField (env,jobj, jfield,stat.dwMemoryLoad);
         // dwTotalPhys
         jfield=(*env)->GetFieldID(env,clazz,"dwTotalPhys","I");
         (*env)->SetIntField (env,jobj, jfield,stat.dwTotalPhys);
         // dwAvailPhys
         jfield=(*env)->GetFieldID(env,clazz,"dwAvailPhys","I");
         (*env)->SetIntField (env,jobj, jfield,stat.dwAvailPhys);
         // dwTotalPageFile
         jfield=(*env)->GetFieldID(env,clazz,"dwTotalPageFile","I");
         (*env)->SetIntField (env,jobj, jfield,stat.dwTotalPageFile);
         // dwAvailPageFile
         jfield=(*env)->GetFieldID(env,clazz,"dwAvailPageFile","I");
         (*env)->SetIntField (env,jobj, jfield,stat.dwAvailPageFile);
         // dwTotalVirtual
         jfield=(*env)->GetFieldID(env,clazz,"dwTotalVirtual","I");
         (*env)->SetIntField (env,jobj, jfield,stat.dwTotalVirtual);
         // dwAvailVirtual
         jfield=(*env)->GetFieldID(env,clazz,"dwAvailVirtual","I");
         (*env)->SetIntField (env,jobj, jfield,stat.dwAvailVirtual);
         return jobj;
    };I can use all of the methods in the Java/C code except for the the last native method   public static native MemoryInfo GetSystemMemoryInfo(); . I get a NoClassDefFoundError when I try to use this method. I have a feeling that I'm just doing something stupid.
    Thanks in advance,
    John

    Yes, exactly. I changed the name of that class and forgot to change it in the c code. Thanks for the feedback.
    Also, if anyone is using this code as an example, you need to change "agent.win32.MemoryInfo" to "agent/win32/MemoryInfo" in the c code. If it is left as "agent.win32.MemoryInfo" you will get a ClassCircularityError when trying to make multiple calls to the NIMSNT.GetSystemMemoryInfo();.

  • Error ODS activation - sql error when accessing a table.

    Hi,
    sometimes occurs an error by activation ODS. I have proces chain and when is loaded second packet an error occurs. In monitor>>
    -RSMPC 128, datapacket 3 is wrong, with status number 9
    -RSMPC 131
    -RSDRO 108 - communcation error (sql error when accessing a table)
    In sm21>
    -sql error when accessing a table
    -The exception, which is assigned to the class 'CX_SY_OPEN_SQL_DB', was  
    either                                                      caught nor passed along using a RAISING clause, in the procedure <b>"UPDATE_ATAB"</b>   "(FORM)"                                                                    
    Since the caller of the procedure could not have expected this exception     
       to occur, the running program was terminated.                               
      The reason for the exception is:                                             
      The database system recognized that your last operation on the database      
      would have led to a deadlock.                                                
      Therefore, your transaction was rolled back                                  
      to avoid this.                                                                       
      ORACLE always terminates any transaction that would result in deadlock.      
      The other transactions involved in this potential deadlock                   
      are not affected by the termination.
    I have BW 3.5.
    Thank You very much.

    There are a few different scenarios that I can think of where this might come up that all involve what might resulting in parallel (concurrent)processes:
    Loading packets in parallel - that is there are X number of processes loading packets concurrently. This could be set in your IMG settings system wide or in the InfoPackage for just this datasource.   You seem to indicate that you don't have this.
    Database parallel processing - RSAMDIN - ORA_PARALLEL_DEGREE ( there was a different RSADMIN parm for older versions - forget what SP the change came with).
    You have multiple InfoPackages for the datasource, each loading what should be a different range of data, and they run atthe same time.
    You could be loading from two different datasources to the ODS at the same time.
    If any of these are true, I would look at bumping the INITRANS setting up.  Your DBA will probably need to do this for table and its indices.  There is a Note - 831234 that allows you to create a parameter in RSADMIN that will specify a INITRANS value (e.g. 20) rather than using the default. The ODS would need to be activated to pick this new setting up for the table to be altered. 
    You could also look at the Processing settings for the InfoPackage and change to PSA first, then target to see if that helps. 
    Or if you are loading from two different datasources at the same time, you might adjust your schedule so that doesn't happen.
    Pizzaman

Maybe you are looking for

  • Link between schedule Line Number and Delivery

    Is there a link between Schedule line Number and Delivery number ? Eg. Line item 10 with quantity 100.  has 5 schedule lines..with 5 different delivery dates. 1 .  quanity 40 2.   quantity 30 3.   quantity 20 4.   quanity  6 5    quantity  4 For sche

  • Is there a way to get Audiobook to play chapters continuously?

    I have converted several Audiobook's on CD into Itunes and then changed the extension from .m4a to .m4b to get them into the Audiobook folder. I can sync them to my IPhone and they show up in the Audiobook folder on the IPhone. I can listen to Chapte

  • Writing blobs to files in 8.1.7

    (Duplicate post of a message in the SQL forum - I belatedly realized it might belong under Java...) I have got several thousand blobs in an Oracle 8.1.7 instance that I need to write to files. I found sample procedures for doing this listed below. I

  • Unable to view deployed apps in app gallery

    Hi All, I have created SharePoint hosted app and deployed it on a site, I am able to see the app in site contents page after deployment. If I try to add the app on a page I am unable to see the app in the app gallery, please let me know what wrong I

  • VAT Configuration for Netherlands

    Dear SAP Gurus, I'm seeking information on the effort required to configure VAT for Netherlands, on R/3 4.0B. I'd appreciate if anyone can share their experience and provide documentations on this topic. I'd appreciate your help. Thank you.