This is a weird situation. I am creating a plug-in which utilizes the HANA SQL Editor for Functions .hdbscalarfunction. It uses the dependency: com.sap.ndb.studio.sqlscript.function. Now, when I try accessing the class ScalarFunctionMultiPageEditor it is not working due to access restrictions. I then tried editing the access restrictions by allowing access to the specific package for that class. However, I get a NoClassDefFoundError.
I then noticed in the plugin.xml of the com.sap.ndb.studio.sqlscript.function is that the package for ScalarFunctionMultiPageEditor is not exported, so this is not visible to anyone.
Any ideas?
Thanks!
If the plugin does not export a package then you cannot use anything in the package. The Eclipse/OSGi classloaders enforce this and you can't work around it.
Related
I have recently migrated my project from Java8 to Java17. I wanted to try out the module system and added a module-info.java to my existing Eclipse project. As it caused several issues, I decided to revert back the change and to proceed without declaring modules. I deleted the file, but now I am getting compile errors. It is stated that LibX11 and libvlc_instance_t cannot be resolved to be a type and that they are not accessible. Why is that? It was working fine before. It seems that adding and removing the module-info.java has somehow messed up my configuration.
I need to access libvlc_instance_t because I need to subclass MediaPlayer, which requires a reference to libvlc_instance_t in the constructor. If libvlc_instance_t is really not meant to be used, how can I solve this? Thank you!
I've downloaded android-src.jar and added it as a dependency to another project, but the code completion will only show the something like com.google.android.mms.pdu but no suggestions come after that for classes.
I've tried various dependencies, but none of them work. I've also tried tried Invalidate cache/Restart.
When I look through the library and view one of its classes, it's telling me it can't resolve symbols for classes that are clearly there.
These classes belong to Android framework, Platform classes can refer to other package private classes and you could not see its actual compiled class. Only symbols exposed by package designer could be seen.
I have imported apache nutch from http://svn.apache.org/repos/asf/nutch/trunk/ through SVN on eclipse; however, the project I have imported has 10k+ java errors:
Some errors are due to source files being in a package different from what is specified in their source, (e.g. classes in java.org.apache... but it is declared in source that they should be in org.apache..., this is observed in many other packages)
Unimported classes, for example the Class "Context" is used in many of the classes however when looking at the import list, "Context" is not declared there.
Missing classes, though imported, classes still not resolved to a type, most probably because my imported project lacks many of the needed libraries such as hadoop,gora,witty,etc.
(Not familiar with this) Bound mismatch errors like: The generic method createDataStore(Configuration, Class, Class) of type StorageUtils is not applicable for the arguments (Configuration, Class, Class). The inferred type WebPage is not a valid substitute for the bounded parameter
What is the correct way of importing a nutch through eclipse without encountering the errors specified above? Thanks!
Refer to http://wiki.apache.org/nutch/RunNutchInEclipse
These should be followed to the "T" and it works fine.
Specially, pay attention to the manual configuration of the build paths for the plugins.
You may also notice that some library dependancies are not set even after setting the build path,within certain plugins. .. you will need to manually add the ivey dependancies for these plugins into the build patch as well.
I'm building a plugin to extend the Eclipse BPEL Designer. That plugin is supposed to allow users to add meta information to certain model elements via EAnnotations. I already did the same thing for a BPMN model and it work just finde but when doing this for the BPEL designer I reveive rather strange exceptions.
The first I thing realized when trying to extend the BPEL Designer was that the designers plugins are defined in an unusual package structure. Instead of org.eclipse.bpel.xxx they have a "bin" in front of all package names. When I'm trying to import some of the designers classes I therefore have to refernce the bin path to make it work. However all the examples I was able to find just imported classes from the ordinary package structure.
Most of the time importing classes with the bin in front of the package name worked fine for me but every now and then I receive a strange error message. The message is in the form of: The type org.eclipse.bpel.xxx cannot be resolved. It is indirectly referenced from required .class files
It seems that Eclipse somehow can't find certain classes. I'm stuck at this point for over a week now and don't find any solution. From my point of view the problem has to be seen in the BPEL Designer plugins. Inside those plugins they reference classes in the form of org.eclipse.bpel.xxx but as I said when I reference those plugins their classes are inside packages with a "bin" in front of the normal package name. Could that be an explanation why certain classes can't be referenced by Eclipse and I get those strange error messages?
I'd appreciate any new ideas about that problem and hope that somwebody can give me an advice to solve that problem.
Cheers
Stefan
I already encountered in the past such troubles ...
I think there is a problem with the export/import of the BPEL Designer plugin.
How did you get this plugin ? Are you working with binary plugin or plugin imported as source in your SDk ?
Try to get again this plugin, may be an other version, or from an other source .. an update site.
I really think these "bin" packages/folders should not be here
Hope this can help ...
I've trying to use Eclipse JDT AST parsing classes. After including the initial JAR, and sorting out a couple more dependencies, it is with 7+ JARs and I still having NoClassDefFoundError exceptions. This situation arises whenever I'm trying to test libraries with little or no documentation. Trial and error seems a very dumb (and annoying) approach to solve this problem.
Is there a way to automatically sort this out using Eclipse?
Update: Later I found that adding all the JARs you have, and using Ctrl-T (to view/locate types), lets you manually locate the JAR. That was the solution that Google provided so far. Is there a better way?
If you refer to this SO question Finding unused jars used in an eclipse project, you also have:
ClassPathHelper, which can quickly focus on unresolved classes:
It automatically identifies orphan jars, blocked (obscured) classes, and much more.
The only limit is dependencies that are not defined in classes, e.g. in dependency injection framework configuration files.
I have found setting up a workspace exclusively for browsing the eclipse source code incredibly useful. In this manner, you can use PDE tools like the Plug-in Spy, bundle dependency analysis, browsing the documentation, etc much like you would your own plugin projects. I found this article at Vogella a very useful guide.
If you know which bundle your desired class is you can generate the transitive closure of dependencies by creating a new OSGi launch configuration, with just the single bundle selected. By hitting the Add Required button, you can see all bundles necessary to use the one you're interested in.
Edit:
From your question it wasn't clear as to the environment you want to run the compiler in. If you're interested in an embeddable Java compiler to be run outside of an OSGi environment, may I suggest Janino.
You could use a dependency analyzer like:
JarAnalyzer
This will parse a directory full of Jars and give you an XML output dependency map, for which there are several tools for displaying in either graphical or text form.