How can i edit OSGi bundles manifest file in Netbeans 6.9? - java

I'm using Netbeans 6.9 RC2 and Maven OSGi Bundle project template. Actually i dont want to test my bundles in Netbeans environment so i copy the jar file to the OSGi container directory and install it from command line. But when i want to see its headers from OSGi console, i see a lot of Netbeans related unnecessary stuff. Is it possible to edit the contents of the manifest file in Netbeans?

Looks like Netbeans does not allow to edit manifest file, no matter what i do it just adds the unedited version of file. Answered my own question for people who has similar problems.

Related

Maven Build Views & XML Files Missing

I've been having trouble with Maven. Searched around but couldn't find anyone with similar problem or explanation. I am packaging a webapp with maven's generate archetype using openjdk7 for jre and jdk. Using Lubuntu Os. I am not using Eclipse or Netbeans since my computer is too slow to support it (runs too slow, I can't take it). Plus I'll have to create the war for the live webapp soon (outside of eclipse).
What happens:
I run mvn package and it create's the .war file.
There's only warnings about UTF-8 encoding. I fixed all other warnings which were about plugin version in the pom.
When I open the war, my views are gone and my spring-context file is gone.
Any ideas?
You need to place the files under src/main/resources to be packaged with the war. See the maven directory structure shown here: http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html
With a typical web-app with xml file, the xml file and views go under src/main/resources/webapp/WEB-INF folder. See this discussion: What is WEB-INF used for in a Java EE web application?

How to add jasypt plugin to eclipse

So I am using
Eclipse IDE for Java EE Developers
http://www.eclipse.org/downloads/packages/eclipse-ide-java-ee-developers/keplerrc3
and I am trying to add the jasypt - 1.9.0 plugin to eclipse
Since I am not experienced in this, I only tried one way which is
1- Download the zip file form the following url
http://sourceforge.net/projects/jasypt/files/
2- Unzip the file into the eclipse subdirectory plugins
3- Restart eclipse
However it seems that there is something missing
Go to your downloaded file and go to the lib folder. In there, you have a whole host of jar files. It is most likely the jasypt-1.9.0 jar you want.
In Eclipse: go to: Properties > Java Build Path > Libraries
Choose to add an External Jar and navigate to the location of the jasypt-1.9.0.jar
This will add the jar and its libraries to your project. Note: Look at the API for what you are using if this doesn't work - you may require a different jar to be imported instead/as well.
This is the standard way to add any third-party libraries to your project.

Adding plain Java project as a classpath to an eclipse plugin

I have a plain Java project (not a plugin project) which I want to add to a classpath of a eclipse plugin which I am developing. But in web projects I can add that project as a build path and it works fine. But I tried same thing in eclipse plugin, I am able to compile successfully, but at run time I am getting java.lang.ClassNotFoundException.
I know OSGi quite well and I know how to add OSGi into an classpath (using export-packages) but what I want is to add Standard, non-osgi project into an classpath, so that I wont' get runtime errors. Is there anyway I can achieve this?
I can export project as a jar file or make it as a plugin project and it would work fine. But that's not my option currently because, still that API is in pre-alpha stage, and there would be lot of changes going on. So I am trying to avoid pain of exporting it as jar file everytime. Is there any option for me other than this?
I have a similar situation: I want non-OSGi Maven dependencies integrated into the classpath of my plugin. I succeeded with a roundabout solution, which I think is the best I could get.
I have a build step outside of Eclipse where I copy the class files of the dependency into the plugin's lib folder. The lib folder is specified in MANIFEST.MF as an entry in Bundle-ClassPath and (here comes the hack) as a source folder in build.properties. That was the only way to make the plugin work both when launched from within Eclipse and when exported.

Adding an external JAR to Eclipse Application debug configuration

The issue is as follows:
I have a 3rd party Eclipse plug-in installed and running
The above Eclipse plug-in provides an "extension point" of sorts - a source for a class I can extend/rewrite and replace in the plug-in lib directory (I am not saying it's a great idea, but necessity makes us do things we are not proud of - in-house development has its quirks)
The idea here is to envelop any such change in an external JAR (created by us) so that any change in code wouldn't require us to restart Eclipse to "refresh" the "extension point" class during development.
Eventually, a plugin/bundle will be created and placed as a dependency on the original plugin - so that installing and using that plug-in would actually, you know, work.
Question is - can I somehow add what is basically an external JAR file to Eclipse Application debug/run configuration?
Normally, adding JAR to classpath tab would work for regular Java application debugging/running. Eclipse Application however, doesn't have that tab.
So far the efforts (failed, perhaps due to some stupid syntax error or whatnot) included:
Adding the JAR as a dependency to Bundle-ClassPath: of the plug-in as C:\test.jar
Adding the JAR to the system's CLASSPATH variable
None of that made any difference - the code in the "extension point" that refers to a class in the JAR file fails - exception that boils down to:
Caused by: java.lang.ClassNotFoundException: test.Test
at org.eclipse.osgi.internal.loader.BundleLoader.
findClassInternal(BundleLoader.java:506)
Any pointer/help/criticism would be greatly appreciated.
Update
Apparently putting the JAR in the lib directory of the plug-in and updating the MANIFEST file doesn't work (not that it would help me - since such a solution would require a "refresh", which I am trying to avoid in the first place), so I must be doing something fundamentally wrong.
Does that make any sense or did I miss something in one of those attempts?
I have included an external JAR file to my Eclipse application.....not to the debug/run configurations but to the application itself.
What we did was to wrap the plugin into it's own java project. We are using maven for our build, so the pom.xml lists the dependency as the .jar file (which we put into a lib directory in the project). The manifest.mf file exports the needed classes. My application plugins have a dependency on this project. When I debug/run the application in the workbench I just make sure that this library project is included.
I'm not sure this answers your question completely or not....but I hope it helps.
A first guess based on some assumptions:
You are developing an extension to an 3rd party extension point 'foo'. Your application is a Eclipse Application, that you start via a run configuration. You need to create a new plugin 'foo-extension' which implements the extension point. You have to add the new plugin as a plugin dependency to your application. This way it will be available in the project class path, as well as in the 'Plugin-Ins' tab of your run configuration. Select the new project and when you start your application the extension will be available with the latest change.

How do I add a build.xml to an existing GWT project in Eclipse?

I have a running Java GWT application, that I can compile using Eclipse.
Now I wan't to also be able to build this application from the command line using ant.
As of my understanding I therefore need a build.xml file.
I used the webAppCreator tool, that comes with the SDK to create this build.xml file and adapted it to my needs and got it working.
But how do I tell Eclipse now to automatically update the build.xml file upon code changes?
I know it is possible for it works in projects created with webAppCreator. But I just copied the build.xml to another project. So what do I need to adapt? Or where do I need to set up the link to the build.xml?
You could use Ant4Eclipse to get the Eclipse classpath into your ant build file. That's probably only part of the solution you're looking for... I'm not sure, how useful this will actually be when used together with a GWT project (do you want automatic copying of the libraries to WEB-INF/lib, too? Etc...)

Categories

Resources