Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

ClassNotFoundException for Inner classes encapsulated in jar

Avatar

Former Community Member
Hi,



I am facing a very strange problem when my service is deployed at LiveCycle Server then inner classes included in the jars are not being Loaded at runtime. When I unjar these inner classes then they are accessible for LiveCycle class loader. I am using LiveCycle (Jboss turnkey installation)



I would be very thankful if you could reply this.



Thanks and Regards

Imam Raza
8 Replies

Avatar

Former Community Member
I am having the exact same problem. An inner class is failing to be loaded by the ClassLoader during deserialization.



Any help?

Avatar

Level 1

I am having the same problem as well.  Has anyone from Adobe looked into this?

Avatar

Level 8

I take it you have added the class-path tag to your component.xml file and the referenced jar file is in the correct location?

Avatar

Level 4

hi..

I am also facing the same issue. Has somebody, found the solution. If yes, please share on the forum.

Hodmi- "

I take it you have added the class-path tag to your component.xml file and the referenced jar file is in the correct location?

"

can u please elaborate your point? I think this can solve the problem. But I am not able to figure out.

Thanks and Regards,

Ambika Mittal

Avatar

Level 8

There are two ways to refer to classes in the component.xml file; class-path and import-packages.

If the jar file containing the class you need is in your component (i.e. it is in the component's jar file) then use the class-path tag to refer to that jar file.  For example, I am using two jar files that will be inside my component:

<class-path>lib/livecycle-productivity-1.02.jar lib/carbon.jar</class-path>

If the classes you need are in the application server's library path, then you don't want to include them in your component jar file.  You refer to the classes using the import-packages tag:

    <import-packages>
        <package version="1.0">org.apache.axis.encoding.Deserializer</package>
    </import-packages>

Note - don't do both for the same class, you may get coercion errors.

Avatar

Level 4

Hodmi,

I tried both the ways, but it dint work.

In my case, I am having five class files, component.xml and one supporting jar in component's jar. Now, out of these five java classes, one is java bean object which is used in other class files as an object.

When, I am deploying the component, there is no error. I also made a test process for checking the component.While executing the process, I am getting an error, "Class Not found" for that java bean object.

Please let me know, where am I getting wrong? I guess, I am missing some configuration, which needs to be in config.xml regarding that bean class.

Thanks and Regards,

Ambika

Avatar

Level 8

From your description it sounds like your java bean is not in a seperate jar file.  I had assumed it was earlier.  If that is true then you don't need a class path or import packages entry.  You really don't need anything.  As long as the class is in the right package folder in your component.jar then everything should be fine.

Avatar

Level 4

But I am still facing the problem.

The process throws the same error. But while playing back, its not tracing the error. Its showing the contents of the complex custom data component.

When I tried to retrieve, the values in different variables, its going empty.