How to add JDBC connectors jar files to a portable Eclipse installation? - eclipse

Where should I put the JDBC JAR files in order to be able to user them from Eclipse and be able to keep Eclipse portable (in Dropbox).

Go to the folder in which tomcat is installed. Inside that go to the lib folder and put the jar file there.
You will also need to link this in eclipse.
Open eclipse IDE.
In the dynamic web design prespective, link the jar file by right clicking the project folder.

Related

Tomcat not fetching the correct jar

I'm developing a web project using Eclipse Juno, Tomcat 7 and Maven 3 and have run into a strange problem.
I have a separate project where I compile some stuff and I pick that jar up in my web project as a dependency. So, the end result is one .war.
Now, when I run this war in embedded Tomcat in Eclipse and hit the refresh button on my browser, Tomcat says it cannot find a path in that jar.
In the workspace WEB-INF/lib folder I find the myApplication-common-widgetset-0.0.11-20130926.124257-7.jar
In the Tomcat Deployment directory under wtpwebapps/myApplication/WEB-INF/lib I see myApplication-common-widgetset-0.0.11-SNAPSHOT.jar
The strange thing is that the file under the Tomcat lib is 1kb large and the file in my workspace lib is ~22Mb.
I tried to copy the workspace jar to the Tomcat lib folder and everything works and run as a charm.
Updates:
When I run mvn tomcat:run from the command line in my workspace, everything works.
I "re-installed" both Eclipse (to Kepler, wiping everything, including workspace and home folders) and Tomcat 7. I still have the same issue.
Colleges tried fetching my project from SVN and ran it successfully, both with Eclipse and IntelliJ + Tomcat 7
What could have happened? Why is Eclipse embedded Tomcat not getting everything from the target directory?
The issue I think you're facing is the reality that eclipse does not strictly honour the maven dependencies.
This has to do with the fact that eclipse does not defer to maven when building, deploying and running on tomcat. Eclipse will use your local workspace setup and will thus sometimes introduce a dependency tree that is different from maven.
From the information you've supplied it appears as if that workspace lib file is the one sourced from a maven repository and the one in embedded tomcat deployment directory is a jar that eclipse has built - I'm guessing here.
If that jar is from a workspace project you can try closing the project and letting eclipse find the jar from maven.
This issue with Eclipse and Maven is rather nebulous and so is difficult to figure out exactly what is going on in terms of dependencies so sorry I can't be of more help

Netbeans - add JAR module

I have downloaded module for Eclipse in JAR formate, but I am developing in Netbeans, which accepts only NBM module files. Do you know how to convert JAR to NBM? Have you been facing the same issue?
Thanks for reply
Waypoint
No, there is no way to run an Eclipse Plugin in NetBeans. Simply "converting" the jar to an nbm would not suffice as these, NetBeans and Eclipse, are two totally different programs. Furthermore, Eclipse uses a completely different UI (SWT) than NetBeans (Swing) and these two systems are not compatible.
The only way to use a plugin designed for Eclipse in NetBeans is to port the plugin to NetBeans. To do this you would need the source code and a good understanding of both NetBeans and the plugin you intend to port.
FYI: An nbm is little more than a compressed file (like a jar) that includes it's own MANIFEST file and the jar file which holds the code for the plugin. It's sort of a jar that holds a jar. You can see what's in an nbm by using something like 7-Zip to extract the contents (as you can do with a jar).

Uninstalling Apache Geronimo Eclipse plugin?

How do I uninstall Apache Geronimo Adapter Eclipse Plugin?
Look the prints of my Eclipse. I've tried deleting some IBM jars from plugin folder but without success.
Using Eclipse plugin form, I can't find the Geronimo Adapter plugin to remove too.
The Images:
You should find it on the Features or at least Plug-ins tab in the Installation details-Dialog.
What seemed to work for me was:
Remove all JARs named org.apache.geronimo.* from the eclipse/plugins dir.
Remove all subdirs named org.apache.geronimo.* from the same dir.
Remove all subdirs named org.apache.geronimo.* from the .metadata dir.
This comes without warranties of any kind. Close Eclipse and backup your eclipse and .metadata dirs before trying this!
If the above isn't working, you might just be able to live with Customize Perspective... -> Menu Visibility and remove the check.

how to install javax and apache plugins in eclipse?

I'm new to java and trying to rebuild in eclipse 3.4.2 an old package that require javax (classes InternetAddress, Session and others) and org.apache.xpath.* (I don't know exactly why). I'm looking for update sites but google reports billions of pages. An explaination about how/where to find eclipse plugins without getting sick will be appreciated, thanks.
From what you describe, you don't need a plugin, you just need to add the required libraries to your build path. You won't find those in update sites.
Here's what you need to do:
Locate and download the required JARs. You can use a service like FindJar.com to search for those JARs. Apache JARs are usually available from apache.org.
Put the JARs in a folder called lib in your project.
Refresh the project in Eclipse (F5 or right-click and "Refresh"), the lib folder with the JARs should appear in your project explorer.
Add them to the build path - in the Eclipse project explorer, right-click the JARs and select "Add to build path"
Right click on project ---> Properties ---> Java Build Path ---> Add Library... ---> Server Runtime ---> Apache Tomcat ----> Finish.

Debugging a tomcat project in Eclipse 3.4.2

I downloaded eclipse 3.4.2 and tried installing tomcat plugin (version 3.2.1)for eclipse from sysdeo (http://www.eclipsetotale.com/tomcatPlugin.html)
I have followed installation instructions but when is start tomcat from eclipse toolbar i got the following error
java.lang.NoClassDefFoundError: org/apache/tomcat/util/log/SystemLogHandler
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2357)
at java.lang.Class.getConstructor0(Class.java:2671)
at java.lang.Class.newInstance0(Class.java:321)
at java.lang.Class.newInstance(Class.java:303)
at org.apache.catalina.startup.Bootstrap.init(Bootstrap.java:205)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:390)
I did follow troubleshoot instructions but no success.
I tried to putting plugin in dropin directory too but still got the same error.
This was working fine in eclipse 3.2 and 3.3
Then I tried using standard inbuilt WTP to set up my tomcat server. I am not sure how it will pick my server.xml in conf directory of tomcat, it seems it is not picking as of now.
How do I associate my eclipse project with this setup. I am able to start the server but when i browse the tomcat start page, it does not show anything.
I would appreciate if someone can provide some ways to fix this.
Thanks in advance.
-Dipesh
After trying out few things I was able to debug tomcat project in eclipse 3.4.2
To debug tomcat application/project using eclipse 3.4.2 use WTP plugins which are installed along with it.
Go to Window --> Show View --> Others --> Server
In this view create a new server, please select tomcat installation directory and version information.
Then double click on Tomcat VX.X Server at local host, it opens up configuration settings page
In the Server Locations Section select "Use Tomcat Installation (takes control of Tomcat Installation) and enter deploy path.
In the publishing section select Never Publish automatically and uncheck update context path checkbox.
Voila!! All set to debug tomcat project in eclipse 3.4.2
There is no need to download and copy any extra plugin.
Thanks Juri. Hope this helps.
I'm using Tomcat with Eclipse Java EE version with WTP and it works perfectly. I have Ant scripts which deploy my web app to the tomcat webapp folder. In order to debug, you have to open the Server view in Eclipse, add a new server and choose the correct Tomcat version. Once that's done, open the configuration of Tomcat within eclipse by double-clicking on the server entry in the Eclipse server view you just created. On the left-middle side of the confguration page you should see something like "let Eclipse control the native Tomcat installation", I don't remember the exact text now. You have to choose that. Then you can set a breakpoint in your source code and then start Tomcat in debug mode from within Eclipse's server view.
Hope that helped.
If you are using the Sysdeo plugin, then you don't want to also be using the standard Eclipse WTP servers. To use the Sysdeo plugin, you need to have already downloaded and extracted a standard zipped tomcat directory. Make sure to define CATALINA_HOME in your path. Then, assuming you've correctly installed the sysdeo plugin, go into Eclipse->Windows->Prefs->Tomcat (this is Sysdeo's Tomcat settings, and not the WTP settings). You need to tell the plugin where you've extracted your Tomcat directory, and set it to use Context files.
Now create a new Dynamic web project. Right click it, and go into its properties->Tomcat.
Check it as a 'Tomcat Project'. Give it a context name, and also tell it the directory which would be the base of your war (by default, Eclipse has named this WebContent, I believe). Apply it and close the Window. Right click again your project, and go to the Tomcat section. Add the 'Tomcat Libraries to Build Path' so you can use the Servlet/JSP classes. Finally, click on 'Update Context'. If you go into your Tomcat directory under Conf, you'll see that the plugin has created a context for you that points to your Eclipse workspace. No need for deploying the app to the Tomcat directory. Now, you should be able to click on the Sysdeo Tomcat 'start' button, and your app should be able to connect to your app at localhost:8080/context_name.
HTH,
Bill
Using the excellent Findjar web page for:
org/apache/tomcat/util/log/SystemLogHandler
gives the following:
Information on class org.apache.tomcat.util.log.SystemLogHandler:
Containing JAR files:
jbossweb.jar
gwt-dev-windows.jar
tomcat-util-3.3.2.jar
tomcat-util-4.0.6.jar
tomcat-util-4.1.31.jar
tomcat-util-4.1.34.jar
tomcat-util-4.1.36.jar
tomcat-util-5.0.16.jar
tomcat-util-5.0.18.jar
tomcat-util-5.0.28.jar
tomcat-util-5.5.12.jar
tomcat-util-5.5.15.jar
tomcat-util-5.5.23.jar
tomcat-util-5.5.4.jar
tomcat-util-5.5.7.jar
tomcat-util-5.5.9.jar
tomcat-util-5.5.7-alpha.jar
tomcat-util-5.5.8-alpha.jar
tomcat-util-5.5.9-alpha.jar
Ensure the appropriate jar file is in your CLASSPATH.