Can run as class file but not as a jar

This is driving me nuts! I have a class called ReceiveTrap. If can run it with the following command and it runs fine:
/usr/java/j2sdk1.4.0_01/bin/java -Djsnmp.loadRFC1213MIB=false -classpath /usr/jSNMP_trapd_server/lib/jSNMP.jar:/usr/jSNMP_trapd_server/lib/. ReceiveTrap
As soon as I package it in a jar I get the following:
Command:
/usr/java/j2sdk1.4.0_01/bin/java -Djsnmp.loadRFC1213MIB=false -classpath /usr/jSNMP_trapd_server/lib/jSNMP.jar -jar PCATrapd.jar
Output:
Exception in thread "main" java.lang.NoClassDefFoundError: com/outbackinc/services/protocol/snmp/SnmpTrapListener
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:509)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:246)
at java.net.URLClassLoader.access$100(URLClassLoader.java:54)
at java.net.URLClassLoader$1.run(URLClassLoader.java:193)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:265)
at java.lang.ClassLoader.loadClass(ClassLoader.java:262)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:322)
I can't figure out how one way it finds the jars for jSNMP and the other way it doesn't. Any suggestions are appreciated.
James

I believe I'm doing that correctly. My manifest is:
Manifest-Version: 1.0
Main-Class: PCATrapd.ReceiveTrap
[blank line]
It's definitely finding my main class. If I change the Main-class from PCATrapd.ReceiveTrap to just ReceiveTrap, then I get a java.lang.NoClassDefFoundError: ReceiveTrap
The ClassDef it says it can't find is located in the jar that's in my classpath, not PCATrapd.jar.
Thanks,
James

Similar Messages

  • ¿Dear Sirs, I can create with "Photoshop Elements 12", a PDF file of several pages?. I can create a "pdf" file, but not of several pages. Thank you

    ¿Dear Sirs,
    I can create with "Photoshop Elements 12", a PDF file of several pages?.
    I can create a "pdf" file, but not of several pages.
    Thank you
    Valentín Uriarte

    This is the Photoshop Elements forum.
    If you are using Acrobat, ask Here:
    Acrobat

  • I can open a .book file but not a .fm file with FM 10.0.2

    I can open FrameMaker 10 through the EXE.
    I can open FrameMaker 10 through a .book file.
    I can open a .book file from FrameMaker 10.
    I cannot open FrameMaker 10 through a .fm file.
    I cannot open a .fm file from Framemaker 10.
    I've tried multiple .fm files, so this isn't isolated to s sngle corrupted file.
    I was using FrameMaker 10 yesterday, but it doesn't work today.
    I updated Flash this morning, but have not installed any other programs.

    I'm not sure which actions resolved this issue:
    I went to: C:\Documents and Settings\[username]\Application Data\Adobe\FrameMaker\10
    I moved all files with today's date to another folder on my desktop.
    I also contunued to \WorkSpaces\Structured and moved the Structured Authoring.cfws file.
    The .fm file opened with no hitches.

  • How can I move some files (but not all) in the photostream folder on my PC to another folder on the PC?

    I have photostream set up on my PC and all photos in both mine and shared photostreams are successfully being synced to my PC automatically. However, my goal is to navigate to the photostreams on my PC and be able to move them and edit the photos with other software I have. I'd like to move more one at a time as I have 100's. This would help me better sort them as well as free up some much needed space on my iCloud account as I don't need all these photos available at all times, but also don't want to lose them. Is there a way that I can do this? I really appreciate any help I can get.

    Your my photo stream folder should operate the same way other folders do.  First go to the iCloud control panel for Windows and click Options next to Photo Stream.  Here, note you photo steam location (listed at the bottom).  Navigate to the photo stream folder at that location, then open the my photo stream folder inside.  Right-click on the my photo stream folder, select copy, navigate to a location of your choice, then right-click and select paste.  Click on the copied folder, press your F2 key and rename it something like Photo Stream Backup.  Then you should be all set.

  • Using multiple desktops with a 4 finger swipe on a Mac Book Pro running Lion- is there a way that I can allow Safari open on several but not all??  Looks like I can set it for one but not others.  All, one, or nothing

    Using multiple desktops with a 4 finger swipe on a Mac Book Pro running Lion- is there a way that I can allow Safari open on several but not all??  Looks like I can set it for one but not others.  All, one, or nothing

    Hey Eric,
    Thanks for taking the time. Unfortunately no that does not solve it. Same as swipe it will get me there and it will show separate programs spaced out. The issue I am having is that all my open word files are bunched up in a pile on top of each other. I can see the edges of each one but I want them to be separated from each other enough that I can visually identify what file is what.
    Again, thanks for trying, it is appreciated.

  • Downloaded certain files from my old computer on a memory stick.Have inputted stick into my new mac and can open PDF files but not xlr,aww or eps files.Is there a solution to this please?

    Transferred certain files to my new Mac from my old computer via memory stick.Can open PDF files but not xlr,aww or wps ones.The important ones are in xlr format.Is there a solution please?

    My guess is they don't care. Most likely they're illiterate and don't know what a colon is for. They probably think it's a little-used character. Remember: these are the people who don't know the difference between "deprecate" and "depreciate".
    I have the same colon problem as you do. But it's not the biggest problem I have encountered in Lion. If it was only that I'd be Mr. Delighted with Lion. There's worse than having a colon - uh -  that won't cooperate. A lot worse, in Lion.

  • I downloaded music to my ipod (4th gen) from my computer but it was mp3 format.  It shows that the music is in there but I can not play it.  It seems to  be in there as a file but not as music.

    I downloaded music from my computer to my ipod (4th gen) but I can not listen to it. It shows that it is on there as files but not music is this because the music was format for a mp3.  How do I convert it to play on the ipod or move it to the music file?

    The iPod can play MP3 files, so that's not the problem.
    It sounds like you're accessing the iPod as a disk drive, and copying files in Windows Explorer.
    This is not the way to put music on your iPod. You have to install iTunes on your computer, and put your music in iTunes. Then you can use iTunes to select the music you want on your iPod.

  • HT3775 I am using OS X Mountain Lion and I have this .avi file but not able to read. What is missing in my setup and what other file do I need to download to enable me to read?  I can read mp4 files though.

    I am using OS X Mountain Lion and I have this .avi file but not able to read. What is missing in my setup and what other file do I need to download to enable me to read?  I can read mp4 files though.

    Here is a link: https://itunes.apple.com/en/app/mplayerx/id421131143?mt=12
    I agree that VLC is also a good choice but MPlayerX is more user friendly.

  • I can open some older numbers files but not others. I get a message that says I need a newer version of numbers.

    I can open some older numbers files but not other. I get a message saying I need a new version of numbers. Why would some files open and not others?

    SK,
    Here's the deal. If you ever open a Numbers file with Version 3, the file is converted to Version 3 and can't be opened again by Version 2. Version 2 and Version 3 are undoubtedly both on your machine and they look so similar that you may not realize which you are using. So, there are two steps to getting into trouble.
    1. Open a Numbers 2 file with Numbers 3, edit it and Close it.
    2. Try to open that file with Version 2. You ill get the error.
    To always get it right, find the file you want to open in Finder, Right-Click it and choose Open With... and pick Version 3 from the drop down list.
    If you have a file that you prefer to use only in Version 2, always use Open with... Numbers 2.3.
    Jerry

  • Compiling on a dual core machine and running the class files on linux.

    does compiling on a dual core machine and running the class files on linux have any effect?

    well, the problem that i felt was that when i runmy
    class files on my machine(windows xp, dual core),
    Thread.sleep(60000) sleeps for 1 minute. but wheni
    run it on a linux machine, Thread.sleep(60000)sleeps
    for 2 minutes. my application has a lot ofthreads.
    I can't be 100% sure, but I'm pretty sure that
    sleep(60000) doesn't sleep for 2 minutes on the other
    machine.I, wholeheartedly, agree.
    Due to timing issues it may seem to sleep a few milliseconds more, but not double.
    Of course, if there is a "real-time" (or even simply higher than the Java app) priority program running that is using a lot of the CPU it may seem like it sleeps a lot longer than 60000, but that is a different issue.

  • Can't access class files in jar file

    I'm running Eclipse and trying to access class files in a jar file from source. I have added the jar file through Properties/Java Build Path/Add External JARs... but the class files are not visible from my source code. Any ideas what is happening?
    Thanks!

    Depends what you mean by "visible." Are you getting a ClassNotFoundException? If so, your JAR isn't in your runtime CLASSPATH. You should be able to solve that (in Eclipse) by by modifying your project classpath.
    If "visible" means your code is usng a ZIP class to peek inside the JAR & it's not working, best bet is to re-study the ZIP class Javadocs & examine the error messages carefully.
    If this doesn't solve the problem, please provide more details & the specific error message/stack trace you're getting.

  • I had a repair done at the apple store where the replaced my hard drive and copied my other hard drive over to the new one.  Everything is fine except the time machine wont reconnect to my old file and is trying create a new file but not enough space?

    I had a repair done at the apple store where the replaced my hard drive and copied my other hard drive over to the new one.  Everything is fine except the time machine wont reconnect to my old file and is trying create a new file but not there is not enough space for both files files? Do I need to do something to have it continue to update my old file instead of recreating a new one?

    Depending on what version of OSX you're running, and how the data was transferred, you may be out of luck.
    If you're running Lion, and your backups were made to a directly-connected external HD (ie, not a Time Capsule or other network location), you may be able to get Time Machine to "associate" the new disk with the old backups.  See #B6 in Time Machine - Troubleshooting, especially the pink box there.
    If you're running Snow Leopard, you might be able to do a full system restore of your backups to the new HD.  See Time Machine - Frequently Asked Question #14 for detailed instructions.  That should leave a "trail" that Time Machine can follow to "associate" the new drive with the old backups.  Unfortunately, that doesn't always work, and there's no way to do it manually, as there is with Lion.

  • How to run java .class file?

    How can i run/view .class file in java?. is there tool/utilities in java that can do that.?. Thanks

    Ednut wrote:
    I'm sure you must have been taught using the command: java yourClassName after navigating to the location of your compiled class in the command prompt.I'm sure the OP does not need condescending remarks from someone who knows almost as little Java as s/he does.

  • On imac 10.6.8 using current version of Aperture.  How can I access the Aperture Library  on my external hard drive that I use with time machine for backup?  I can only access the application but not the library..

    On imac 10.6.8 using current version of Aperture.  How can I access the Aperture Library  on my external hard drive that I use with time machine for backup?  I can only access the application but not the library..

    Go into Time Machine (the program not the bundle on the extrnal disk) and using Time Machine's browser go to the Folder where the library lives. You could look in the library bundle in Time Machine but that won't really tell you much,
    If you want to make sure it truely has backed up your library you will need to restore it and open the restored library with Aperture.
    If all this still has you confused you need to read up on Time Machine in order to get a feel for how it works, for what it is doing and for how to restore files from it.

  • Why can I sync a movie but not TV shows on my nano (7th gen)?

    I am using iTunes 11.0 and can sync a movie (Miracle on 34th Street) to my new ipod nano 7th gen but when I try a TV Show (a Planet Earth HD episode) or even a brief video clip taken with my camara I am told that such an action is not permitted on this ipod.  So why can I sync a movie but not TV shows on my nano (7th gen)?  Thank you.

    Before you can sync video files, it must be converted into a format compatible with ipod.  If you can’t sync a video convert it by doing the following:
    In iTunes, select the video you want to convert. Do one of the following then sync again after:
    1) Choose File > Create New Version > Create iPod or iPhone Version.
    2) Choose File > Create New Version > Create iPad or Apple TV Version.
    I hope this works.

Maybe you are looking for

  • Itunes 11.1.1 Errors occurred during installation...

    Errors occurred during installation before Itunes could be configured. Your system has not been modified. To complete the installatoin, run the instaler again. Click Finish to exit the installer. I've tried re installing iTunes 11.1.1 multiple times

  • Windows 8.1 not able to load properly

    hello sir/madam , I am pankaj kumar , I am facing a problem with my laptop(HP Pavilion g6) .I am upgrading my windows 7 to 8.1 enterprise that I have downloaded from my MSDN Account . I was using it before 4 month without any problem but aprox. 10 da

  • Fails to check out an application module error calling web service

    I am using the ServiceFactory code to invoke the TerritoryProposalPublicServiceImpl.findProposals web service method. Weird thing is it invokes the service method for the first time, second time it throws the following error. Please help Jul 20, 2011

  • Problem with ProgressMonitor

    Hi! I wanted to create a ProgressMonitor and display it to show that a task is still being executed. Unfortunately, the ProgressMonitor does not show.   public void initializeProgressMonitor()           _pm = new ProgressMonitor(_parent, "SNPs werden

  • What does the sdkVersion mean in the platform.xml for iPhone when building ANEs?

    Are there any requirements for it? Such as it must be the iOS sdk version used in compiling the .a files used in ANE? For its value, higher is better or lower is better?