Removing Java packages in IBM Integration Toolkit (Eclipse-based) - java

I'm working on a project in IBM Integration Toolkit 10.0.0.3 (formerly known as IBM Integration Bus) which is based on Eclipse. I have restructured a couple of Java libraries and part of this restructuring was to add a level in the package structure. To do this, I created a new package and moved the source files from the old package to the new. The next step is to delete the old (empty) package which has proved to be quite challenging.
It seems that the version of Eclipse that IBM Integration Toolkit is based on is quite limited.
The problems I have are:
Packages which do not contain any files are not visible in Package Explorer.
It is not possible to change this in the filter (Package Explorer -> View Menu -> Filters...).
It is not possible to delete packages which contain files, and as soon as I remove the files in the package it disappears from the Package Explorer.
If I delete the package outside of Eclipse, they don't show in Eclipse, but Eclipse still recognizes that the package exist. (I've tried creating a new package with the old name and it stops me from doing so saying that it already exists).
I've also tried installing a new version of vanilla Eclipse and deleting the packages using that, but IBM Integration Toolkit still recognizes the packages.
Does anyone have any idea of how I can remove the packages considering the limitations mentioned above? Because of 4) it leads me to believe that there is a config file somewhere which stores that there should be a package in that location. I'm thinking that I can delete the packages outside of Eclipse and then edit this config file. Is there such a file?
If anyone has an alternative way of removing the packages using Eclipse that would be even better.

A colleague found a solution. Switch to Java view and then it's possible to change the filters to show empty Java packages.

Related

trying to compile ehcache - javax.transaction package not found

I want to use the ehCache as 2nd level cache in my application.
I downloaded the latest version from the ehcache web site. Unfortunatly no jar file is provided, therefor I wanted to compile the code myself. I put it into a new Eclipse dynamic Web Project and added the necessary jars that came with the download to the Build Path. But now, there are still errors in my project..
e.g. this fails: import javax.transaction.TransactionManager;
Does anybody know why? Usually I have javax package available in a Eclipse Web project...
I somehow have not gotten the original javax package.
I answer my own question because an other reference was missing after adding the javaee package. This was the one to the sun. misc.Unsafe.
It does not have to be downloaded, but to be able to use it, the compiler settings have to be changed in Eclipse as described here: https://stackoverflow.com/a/5549580/1737854

Building RCP with support for Eclipse projects

I want to create an Eclipse RCP from our collection of already existing Eclipse plugins.
We have the pecularity that in our RCP we want the user to be able to open ("import") Eclipse projects (we distribute some of our features in bundles which come in the form of Eclipse projects. These should be registered in the workspace because a model server scans for the opened projects and loads them). Also, when I open files via File->open an exception is thrown from our internal editors: File opening intentionally only is possible if you load an imported resource.
For the moment, I have gotten the RCP to work by depending on org.eclipse.core.resources and org.eclipse.ui.navigator.resources. Thereby, I can import complete Eclipse projects. However, I am unsure[1] this is the correct/"intented" way of doing it (e.g. the navigator view is lacking icons per default) should I rather use the CNF?
The main thing is, we have to support loading/importing Eclipse projects in our RCP. Your answer is even helpful if you know other RCPs which allow to import Eclipse projects.
Regards
SuperUser
[1] http://wiki.eclipse.org/RCP_FAQ#Is_the_resources_plug-in_.28org.eclipse.core.resources.29_considered_part_of_the_Rich_Client_Platform.3F
If you are using org.eclipse.ui.navigator.resources then you are using the CNF (it's org.eclipse.ui.navigator).
The link you have is pretty outdated information, using the Eclipse Resources support in an RCP application will work fine (our product does it). And then if you want to package the application to work either as RCP or in an IDE environment you are one step closer. Also, despite what the link you provided says, don't be afraid to use stuff in org.eclipse.ui.ide if you need them. All you really need to be concerned about is to make sure you are only using classes that are actual Eclipse API, if you do that, then everything will work on future Eclipse versions. Anything that's public is Eclipse API unless it's marked in the Javadoc that it's not intended to be used by clients.
You should not be using the Resource Navigator as that has been deprecated and is not as general as the CNF.
As far as importing and exporting Eclipse projects with RCP, our product does that as well and it works fine.
I would say you are on the right track.

Eclipse Not Finding Classes added to the build Path (Java Dynamic Web Project)

I am taking over a web project from my school. I am trying to deploy the project in eclipse. The project uses a group of libraries (Namely javax.mail.* , com.sun.mail.*, org.joda.* and org.apache.*). The project can not compile because it is unable to locate these. I have them in the src folder and then added the three top level folders/packages to the build path. The import statements work. But getting the joda.time.CLASSXYZ does not work (Then I instantiate the class CLASSXYZ). (The error is "The type org.joda.time.base.BaseDateTime cannot be resolved. It is indirectly referenced from required .class files" the import was joda.time.* so the class should have been imported)
I've looked at the other threads and most of them just explain how to add folders to the build path. I have Apache tomcat set up with eclipse. It works with other projects that I have deployed.
This problem has gotten pretty frustrating as its preventing me from starting the project. Any help you be much appreciated.
Cheers
Unless you use maven you need to download additional libraries:
javax.mail: http://www.oracle.com/technetwork/java/javamail/index.html (also included in Java EE)
org.apache http://commons.apache.org/
org.joda http://joda-time.sourceforge.net/
I suggest to place them in a folder 'lib' and add the jar-files to your build class path. (context menu on your project).
The other threads you mentioned are pointing you in the right direction, and provide a good practice to get in to (especially once you start having more than one project running in your eclipse ide).
So right click project - Build Path - Configure Build Path... , then in the Libraries tab, click Add External JARs and add in the jar for org.joda from the link in the other answer here. This way you can have all your external jar libraries in one spot and reuse them across multiple projects. There's also about a dozen different ways to do the same thing in eclipse, but this is the most direct I think. I'm on version Helios (your's might be slightly different). I try not to use source files of external code libraries unless I want to play around, debugging their code - not a bad thing to do - but I never have the time to spare for that.
Also I'd double check that the other libraries you mentioned aren't being automatically linked in or included as part of the JRE system library. Especially if you are setup in a Dynamic Web Project, it would surprise me if org.apache wasn't already there... but I could easily be wrong there, have been many times before & eclipse was usually involved ;-)

Symbol error in java application using netbeans 6.8 when adding a shared project to library

I have a project which has shared functionality between three other projects and have linked these to existing projects as I normally would using the add project functionality of the libraries folder.
This all used to work however when I started up Netbeans yesterday it just wasn't working as in the other projects won't compile even though the projects are linked. It can recognise the packages - just the actual classes themselves were not recognised... and to add to the weirdness some of the classes are getting picked up fine.
I have checked the dist folder of the shared project and the Shared.jar file exists. Also I have checked the Jar and the other classes that are not being recognises are there also.
Any suggestions?
alt text http://inverse.seednet.eu/snaps/duvc6r.png
Solution
I had to reinstall netbeans to get this solution resolved
This is most likely a bug in 6.8, as I have ran into the same problem and I only solved it by recreating the project, was a fairly fast process, only had to re-import the sources and then add the JARs on which it depends.
To confirm this case you only have to see the imports that NetBeans did not find, and then go to the included JARs and see if the class really is there, if it is, then it should be able to find it.
Do you have AbstractCrawler.class compiled to its output location as well?

Dependency bundle (jar-files/sources/API docs) in Eclipse

I'm developing various in-house extensions for JIRA, the issue tracker we use. So far I worked with Netbeans and everything worked like a charm. However, now I need to switch to Eclipse and I'm having struggle setting up the environment for this development project.
First a clarification why I'm using the approach I'm describing here: building JIRA (in an IDE) is not easily done and I'm absolutely not interested in wasting my time to figure out how to do it. Besides, I don't need to build it, I just want to develop extensions and be able to use the IDE's auto-completion and help support (API docs). Atlassian (the company that develops JIRA) provides a "development" package, but it's just a sorry excuse rather than a real solution.
What I did with Netbeans was to create a library bundle with all relevant jar-files, the Java source files and the API documentation. This way I could use auto-completion, "jump to" the source and the API docs would pop-up when needed.
It seems Eclipse doesn't offer such a functionality, at least I couldn't figure out how to add the sources and the API docs to a "User Library" (which I'd then add as a dependency to my project just as with Netbeans).
My next approach was to create a separate project that holds all the stuff and mark that project as a dependency of my project. This works, but it leaves me with another issue: now I get 37k errors reported (all within the "dependency project"). As said, correctly setting up building for this dependency is a major struggle and not my original goal, therefore I'd happily ignore these errors. Automatic building is turned off and changing the "Errors/Warnings" settings under "Java Compiler" for the project didn't change a thing, so I'm kind of lost now.
Okay, let me try to phrase this as questions:
Maybe I just didn't find it: Is there a way to create a dependency bundle (call it whatever you want) in Eclipse that -- besides just carrying jar-files -- gives me the ability to use the API docs and "jump to" the declaration in the sources?
If not, what's the common practice to do in such a situation?
If the "dependency project" solution is the way to go, how can I completely disable compiler errors for that project?
Check this for illustration with images
Add the source code for jar
Add the Javadoc for a jar
Or just right-click on the jar file in the Package Explorer view. Select "Properties" then set the according paths in the "Java Source Attachment" and the "Javadoc Location" field.
When you create user libs via window->preferences->java-build path->user libraries you can specify which jar you need, sources (in archive or folder) && javadoc (from internet, or local, or from archive). Then you can use this lib in your project via context menu on project->Build path->add library->user library-> choose your lib.
Here you acn pick up more info Eclipse help

Categories