I have created an eclipse plugin/bundle which needs some additional jar-files. these jar-files are located in the 'lib'-folder and added to the build-path. so far, so good.
If I launch the application which uses the bundle, I get exceptions. It looks like the required jar-files are not known anymore. I'm confused.
all of our bundles (the others work fine) appear in the bundle cache (../configuration/org.eclipse.osgi/bundles/) and they contain their.jar + the lib-folder with all jars this bundle needs.
in the problematic bundle the lib-folder is missing.
other bundles from other people do not appear at all in this cache. why? should they appear there? if not, what am I doing wrong? if yes, how do I have to configure my bundle that it doe not miss the required jars?
can anybody help with this issue?
Which build path did you add them to? The project one, or the MANIFEST.MF->runtime->Classpath one? They need to be in the MANIFEST.MF file for them to be on the classpath at runtime.
Even though the lib is on the build path, it may not be included in the build output. Open the plugin.xml or plugin manifest file, select the Build tab. Examine the *Binary Buil*d section to see if the JAR(s) from /lib are being included.
Related
Just recently started using Eclipse and ran into an issue with exporting the plugin I'm working on. I tried to search but so far no luck - but if the answer is already here I'd be grateful if someone can point me to it.
I'm writing a n OSGi/Equinox plugin with Eclipse. The plugin is for a 3rd party system, which allows extensions: basically all jars placed in the application's plugin folder are automatically loaded into the application at startup. I have managed to put together my plugin, it's loading fine and it works.
The issue is that I rely on another plugin which is placed beside mine in the plugins folder. For obvious reasons I do not want to package that plugin into my plugin jar file. I have tried to add the dependency as an external archive, but this breaks the export: when I try to export my plugin project ant complains about missing dependencies and types. (If I actually include the other jar file in my plugin everything works, but obviously this is less then ideal.)
So: how do I set up my plugin project dependency, that it's a) an external dependency and b) doesn't need to be specified with a path or a variable - i.e. how do I tell my exporter to "don't worry, it will be there right beside you"?
Edit: Apparently there's an important detail I didn't mention. The external jar file I depend on is not an OSGi plugin, just a regular jar file with some classes in it. To the 3rd party system it seems all the same (all are under the plugins folder, all are loaded into the application), but for Eclipse the distinction seems important.
If you reference the other plug-in as a dependency in your plug-in's MANIFEST.MF the export should work without errors. The plug-in should be listed in the Require-Bundle list in the MANIFEST.MF.
You can do this in the MANIFEST.MF editor by adding to the 'Required Plug-ins' list on the 'Dependencies' tab of the editor.
Note: When referencing other plug-ins you must always use this method. Do not try adding the plug-in jar to the Java build path or anything like that.
If the jar you want to use is not an Eclipse plug-in you must should include it as part of the plug-in and list the jar in the Bundle-Classpath in the MANIFEST.MF. If you cannot do this you can reference an external jar in the Bundle-Classpath using something like:
Bundle-Classpath: .,external:$LIB_LOCATION$/lib.jar
. is the normal entry in for the plug-in code. external:$LIB_LOCATION$/lib.jar looks for lib.jar in a location defined by the environment variable LIB_LOCATION. This method can be difficult to get right.
In the end the solution to my specific problem was to add the external jar file as an Extra Classpath Entry on the build properties tab (this translated to a "jars.extra.classpath = .jar" entry in the build.properties file). I have also added the jar file to the project itself - after adding the extra class path entry that got changed into an external dependency automatically.
With these two changes I was able to successfully export my plugin, which didn't contain the external jar file, but was able to reference it when loaded into the 3rd party system.
I'll start with the other threads I've read:
GWT module may need to be (re)compiled REDUX
Some subtlety of GWT compilation - "gwt module may need to be (re)compiled."
Google App Engine - recompile GWT module
GWT Maven : Module 'xxx' may need to be (re)compiled
I have taken the following steps to fix this:
Cleared my browser cache.
Deleted gwt-unitCache folder.
Deleted *.nocache.js.
Deleted every file that was left over from a previous build. (I did this by looking at the date and time it was created.)
Run both maven clean and gwt:clean on my project.
Compile by right clicking on the project and going to Google > GWT Compile.
Run maven package.
Put the war in my JBoss EAP 6.1 (JBoss AS 7) folder.
Connect to it and still get the "GWT module may need to be recompiled" error.
What else could be causing this error to come up?
This has happened to me in the past when I imported a GWT project to a different computer. Seems you have already done some things I have tried. Before you start, right click on your project, hit Refresh, so you don't miss anything that's not in sync with the file system. There are multiple things it may be, so here's all the things I did to get it working:
Before the following steps also helps if you use the same version of GWT that was originally used to create your project. Also, make sure gwt-servlet.jar, gwt-servlet-deps.jar, validation-api-1.0.0.GA.jar, and validation-api-1.0.0.GA-sources.jar in your libs directory are the same as the ones from your GWT SDK directory (only if your app uses them).
Delete gwt-UnitCache
Open up the war directory.
Delete ALL compiled module folders.
Delete the war/WEB-INF/deploy folder.
Delete the war/WEB-INF/classes folder. It may be hidden in Eclipse, so you may have to do it via your file system.
Now, on the menus: click Project > Clean...
Make sure a build happens too. Either make "Build automatically" is selected, or use the option in the "Clean" dialog.
Do a GWT Compile. If you have more than one module, ONLY compile the main module. Any inherited modules will also be compiled.
I hope this helps. Ask if you need any clarifications.
I have a .war project in Eclipse. It is probably not relevant but I should mention that it was converted from a maven project using mvn eclipse:eclipse plugin.
I saw a warning that various .jar files on the Build Path were not being exported. To fix this I went to Project Properties -> Deployment Assembly and added the jars that needed to go into the .war
However, one .jar file does not need to go into the .war because it will be provided by the container. It is on the build path merely to get the project to compile.
For this .jar file, I want to get rid of the warning. One way was to Ctrl+1 to QuickFix which caused the Properties->Java Build Path->Libraries tab->...jar file to have an extra line on expanding it which says: Excluded from publish/export structure: (None)
My question is how could I have done this without Quick Fix? I could not find any way to exclude from publish/export structure without using the Eclipse Ctrl+1 Quick Fix.
There is no other UI beyond the quick fix for setting the ignore flag.
m2e-wtp automatically takes care of this for you - any dependency that has the scope as provided is excluded from the publish\export structure.
I've been trying to add tomahawk library to a JSF app.
I click on project -> BuildPath -> Libraries -> Add external Jars.
But when I try to deploy there's a message that says that there's no taglib for t.
So, what's the correct way of adding a library?
The correct way of adding webapp-specific libraries is just dropping the JAR files in /WEB-INF/lib. That's all. Eclipse is smart enough to detect changes in the /WEB-INF/lib and will take appropriate actions automagically. You really don't need to fiddle with Build Path in project's properties. It would possibly make things worse. Undo all changes which you made in the Build Path.
Are the libraries also part of your web-inf/lib ?
I added a classpath variable (via eclipse's build path) that points to a cache of jars. While this folder is represented in eclipse's folder view, the contained jars are not recognized for some reason.
For example, when I import a class that is present in a jar in the cache (and thus the added classpath variable), eclipse indicates that the class can not be resolved.
Any ideas what is wrong and how to resolve it?
You have to make sure that the jar(s) that you want are actually included in the classpath of the project you're working on. Right-click on the project, go to properties -> java build path and make sure you've added the jar to your project.
I think this is the problem you are having : https://bugs.eclipse.org/bugs/show_bug.cgi?id=70417
So go vote for the enhancement - it's the only way things like this get done!
I too struggled with the same problem and finally got the solution for it. Just copy the jar's in your server's lib folder eg)apache tomcat's lib folder and then run the project.