Forum LAMS for Tech-Heads - General Forum: java.lang.ClassNotFoundException


 
You may request notification for java.lang.ClassNotFoundException .
Search: 

1: java.lang.ClassNotFoundException
08/16/10 01:30 PM
[ Reply | Forward ]
Hi there!

I have a problem while running my tool.

When I access to the learner enviroment, there is an error on the JBOSS console (screenshot) related to a class not found.

I don't have any problem while compiling or deploying the tool.

I'm using JBOSS 5.0.1 and the head version of LAMS.

Can someone help me please?

Posted by Felipe Peña

Attachments:
2: Re: java.lang.ClassNotFoundException
In response to 1 08/16/10 03:09 PM
[ Reply | Forward ]
HI Felipe,

It seems that you are missing the jtwitter library in your classpath. Where is this library?

Thanks,

Ernie

Posted by Ernie Ghiglione

3: Re: Re: java.lang.ClassNotFoundException
In response to 2 08/16/10 03:51 PM
[ Reply | Forward ]
Hi Ernie

The library has this path: web/WEB-INF/lib/jtwitter.jar

Thanks

Felipe

Posted by Felipe Peña

4: Re: java.lang.ClassNotFoundException
In response to 1 08/17/10 03:24 PM
[ Reply | Forward ]
Any help please?

Posted by Felipe Peña

5: Re: java.lang.ClassNotFoundException
In response to 1 08/18/10 05:30 AM
[ Reply | Forward ]
Hi Felipe,

Perhaps, you're missing jtwitter.jar from the war file produced by your tool.
Could you please check this idea?

Cheers,

Posted by Andrey Balan

6: Re: Re: java.lang.ClassNotFoundException
In response to 5 08/18/10 07:19 AM
[ Reply | Forward ]
Hi Andrey

Thanks for your help.

I'm clearly missing the jtwitter.jar file inside the war. The thing is, on my build.xml I include this path in order to add this jar.

Anyway, I did attach it in case I'm missing anything else.

Regards!

Posted by Felipe Peña

Attachments:
7: Re: Re: java.lang.ClassNotFoundException
In response to 5 08/21/10 08:53 PM
[ Reply | Forward ]
Hi Andrey

I checked the references in the build.xml and they include the jars on the web/WEB-INF/lib folder.

Still, they're not include in the war file.

What could probably be wrong?

Regards!

Posted by Felipe Peña

8: Re: Re: Re: java.lang.ClassNotFoundException
In response to 7 08/23/10 04:28 AM
[ Reply | Forward ]
Hi Felipe,

You can try adding a lib task to the "build-war" Ant target.
Smth like this:
<lib dir="${path_to_jar_files}">
    <include name="*.jar"/>
</lib>


I hope this will help

Cheers

Posted by Andrey Balan

9: Re: Re: Re: Re: java.lang.ClassNotFoundException
In response to 8 08/23/10 07:31 AM
[ Reply | Forward ]
I tried to add that but it throws an error while building the war (deploy-war action).

BUILD FAILED
/Users/patrosmania/Documents/Tesis/lams/lams_tool_twitter/build.xml:205: Problem: failed to create task or type lib
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.


I've also add the include line adding the lib folder. It does include the jar files into the war but when I try to view the Learner activity it keeps throwing the java.lang.ClassNotFoundException

I attached an image file with the build-war xml code.

Cheers

Posted by Felipe Peña

Attachments:
10: Re: Re: Re: Re: Re: java.lang.ClassNotFoundException
In response to 9 08/23/10 12:18 PM
[ Reply | Forward ]
I'm sorry for not being clear.

This <lib> task should be inserted into <war> task i.e.

<target name="build-war"...
    <war warfile="...
    ...
        <lib dir="...


Best

Posted by Andrey Balan

11: Re: Re: Re: Re: Re: Re: java.lang.ClassNotFoundException
In response to 10 08/23/10 10:13 PM
[ Reply | Forward ]
Thanks fro your help Andrey.

I did add that and it included the jar files inside the war.

But it still throws the java.lang.ClassNotFoundException.

Just an idea. Probably I could send you my entire tool so you could check what's wrong.

Posted by Felipe Peña

12: Re: Re: Re: Re: Re: Re: Re: java.lang.ClassNotFoundException
In response to 11 08/24/10 07:29 AM
[ Reply | Forward ]
Felipe,

If possible can you zip it and attach it to your next post?
And I'll try to figure out what's wrong with it

Best,

Posted by Andrey Balan

13: Re: Re: Re: Re: Re: Re: Re: Re: java.lang.ClassNotFoundException
In response to 12 08/24/10 07:44 AM
[ Reply | Forward ]
Hi Andrey

The zip is attached.

Thanks for your help!

Posted by Felipe Peña

Attachments:
14: Re: Re: Re: Re: Re: Re: Re: Re: java.lang.ClassNotFoundException
In response to 12 08/26/10 05:01 PM
[ Reply | Forward ]
Hey Andrey! Sorry to bother you.

I just wanna know if you had the time to give a sneak peek to my LAMS tool.

I'd really appreciate it!

Thanks in advance.

Posted by Felipe Peña

15: Re: Re: Re: Re: Re: Re: Re: Re: java.lang.ClassNotFoundException
In response to 12 08/27/10 09:29 AM
[ Reply | Forward ]
Hey Andrey. I don't know if this would help.

When I deploy my tool, I go and see the build/deploy folder and the war is there. Then, I look inside it and the jar files are in the web/WEB-INF/lib folder.

Now, when I go to the JBOSS folder, server/default/deploy/lams.ear folder, the tool's war is also there, but it's not the same as the one placed in the tool's build folder.

My point is that probably the process of copying the war into de JBOSS folder is failing.

Appreciate your help.

Thanks.

Posted by Felipe Peña

16: Re: Re: Re: Re: Re: Re: Re: Re: Re: java.lang.ClassNotFoundException
In response to 15 08/30/10 06:28 AM
[ Reply | Forward ]
Hi Felipe,

I was able to replicate your problem. Not so sure why it happens though.

You can simply copy these 2 jar files into server/default/deploy/lams.ear folder. It will solve the problem


Best

Posted by Andrey Balan

17: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: java.lang.ClassNotFoundException
In response to 16 08/30/10 06:41 AM
[ Reply | Forward ]
Hi Andrey

I did manage to solve the problem. I re deployed my tool from scratch and the war with the 2 jars inside, copied to the lams.ear folder.

After I do that, I change a parameter from true to false in the build.xml file (for later deployments), in order to avoid issues with the the tool's database records.

From now on, I'll just manually copy the war into the lams.ear folder.

Thanks for your help!

Posted by Felipe Peña

Reply to first post on this page
Back to LAMS for Tech-Heads - General Forum