0

My application tries to execute the following line of code


JMFSecurity jmfSecurity = JMFSecurityManager.getJMFSecurity();

That line throws the following exception. Here is a stack trace:


Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/media/JMFSecurityManager
        at com.compunetix.vsd.stix.main.JMFUtilities.Registry.(Registry.java:71)
        at com.compunetix.vsd.stix.main.JMFUtilities.JMFRunner.getJMFPropertiesFileLocation(JMFRunner.java:129)
        at com.compunetix.vsd.stix.main.Main.setUpJMF(Main.java:274)
        at com.compunetix.vsd.stix.main.Main.main(Main.java:166)
Caused by: java.lang.ClassNotFoundException: com.sun.media.JMFSecurityManager
        at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
        ... 4 more

Any ideas why this might be throwing an exception. This used to work fine. I didn't make any changes to this file. Any ideas?

1
  • 'this file' being what exactly? The source code? The launch script? How is the app. being launched? Commented Apr 12, 2011 at 15:19

2 Answers 2

2

ClassNotFoundException means the class isn't on your classpath.

You're using a class from the com.sun package. Those classes are implementation details, not public APIs. You might have switched to a version of the JVM that implements things differently. Generally, depending on com.sun classes is a bad idea.

Sign up to request clarification or add additional context in comments.

1 Comment

Yes, there was an issue with the classpath.
1

As the stack trace states, the class com.sun.media.JMFSecurityManager is not found. It's presumably missing from your classpath, so check this.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.