Take the 2-minute tour ×

I'm trying to extend the JMF implementation for custom data sources in a custom environment. My JMF implementation is packed to a jar file (only class files, all obfuscated).

The JMF's package manager uses reflection to instantiate a class. It looks into one of the following packages for the desired class: javax, com.sun, com.ibm. All those packages are present in the jar file.

I need to create custom classes, for instance, in the javax package. I created a javax package (directory) and put my custom classes into it. I expected that the javax package would be considered as the same package defined into the jar file, like if the different javax packages where merged into one. However, the JMF package manager couldn't find my custom classes.

Am I expecting something impossible?

Thanks very much.

share|improve this question
Just a comment: I'm trying to avoid modifying the original jar file. It would be a problem in my development environment. –  Marcus Jun 29 '10 at 20:08
add comment

1 Answer

This is perfectly possible. You must have a classpath issue in your application, or you are probably trying to access those classes from different class loaders; or you have class name overlapping.

Anyway, you shouldn't be trying to use those "reserved" packages even if this is technically valid. I don't know exactly what you are trying to do, but you don't really gain anything simply by locating your classes in specific packages.

share|improve this answer
Thanks for your answer. I managed to do it other way. However, I'd like to know if this is possible. What I was trying is to override a buggy class that is pack into a jar file (3rd party). I know how to fix it, however I can't remove this jar from my env. So I decided to rewrite the code for this particular class. This way, when one try to access the buggy class, my custom class would be used instead. Is that what you understood? Thanks again. –  Marcus Dec 29 '10 at 12:25
add comment

Your Answer


