Tuesday, June 2, 2009

Method cannot be Resolved / Reflected to a type?

In Rad 7 I have seen this problem for EJB projects which use .class files. Apparently RAD7 does not like .class files and if your project happens to refer to .class files, putting them in the classpath also will not work.

One workaround for this is to create a jar file out of the .class files and refer to the new jar file from the project. To create the jar file use the command from the appropriate directory:

jar -cvf newJar.jar /your/package/*.class

Once the jar is created simply put it at some lib folder or someplace and refer to it from the build path.

The other thing (perhaps easier too) is to add the folder containing the .class files to the RAD build path. Do this by clicking the build path, click the libraries tab and then click on 'Add class folder'. If you have package that should be considered add the parent folder where the package name starts. Now build again and see if the error goes away!

This should solve the probelm.

No comments:

Post a Comment