"Unable to locate JAR/zip" error for JDBC connections [BIRT Eclipse, Windows 7, Oracle 11g] - eclipse

As an FYI, I'm new to this entire stack, so I might be making a basic error.
I'm attempting to explore BIRT reporting for a Maximo system that was recently upgraded.
To do so, I installed the following:
Java 6 & Java 7 JDKs
BIRT version of Eclipse (Eclipse + BIRT plugins built in).
Some Oracle 11gR2 client options (a custom install)
SQL*Plus
JDBC/ODBC drivers
Thin Client
I take the following steps:
Open Eclipse
Create a new Reporting Project
Add a Data Source
Select "JDBC Data Source" (also tried "JDBC Database Connection for Query Builder")
Select the "Oracle" connection profile type and click next.
At this point, I see that the drivers list is empty. This strikes me as odd, but I figure maybe I have to define the driver definition. So I take the following steps:
Click "Define driver definition"
In the Name/Type tab, select "Oracle Thin Driver", system version 11
At this point, I see an error message: Unable to locate JAR/zip in file system as specified by the driver definition: ojdbc14.jar. It seems that ojdbc14.jar doesn't even exist on my system that I can find.
I have tried adding other jdbc jar files that I can find in the oracle client directory (i.e. from Oracle_Base\product\11.2.0\client_1\jdbc\lib) but nothing seems to resolve the issue.
Help?

I had similar issue.
Clicking "Clear all" and then adding the jar manually solved the problem.

The answer in this case was unfortunately stupidly simple -- after closing and reopening Eclipse, I had no trouble removing the driver, adding another, and getting to work. I was up and running in no time.
Thanks for all your help!

Ensure the ojdbc14.jar file exsists and is in your library path. When on the dialog for picking the driver ojdbc14.jar, simply click the find jar/zip button and find the file.
Sometimes it is there, but still does not work. To solve this problem, press the "clear all" button. Now repeat the above process. The .jar will be added and you will continue to driver connection and details dialog box.

This happens because the Eclipse IDE could not find the driver in the eclipse installation path. This is what you will do:
Search for the .jar file in your system and copy it to the eclipse installation path.
If you could not get it visit http://dev.mysql.com/downloads/connector/j and locate the required connector. Download it and save it to the eclipse installation path. So now Eclipse can see it and the error would no longer appear.

Very simple answer is Into the Jar Console Click on edit jar and Again select jar in your file system. that will locate file in your file system simple

Related

Error Creating a new Glassfish 4 server with Oracle Tools for Kepler

I installed Oracle Tools for Kepler with no problem. But when I want to create a new server and fill in the directory to the server (which is valid, C:/glassfish4/glassfish), nothing happens. I can only click 'back' or 'cancel'.
attached image for better understanding
Thanks in advance
http://es.tinypic.com/view.php?pic=x3tkea&s=8#.U2jz6vl5NUU
http://es.tinypic.com/view.php?pic=2n0ldtu&s=8#.U2j1_Pl5NUU
This is really a weird error/bug/whatever. I have exactly the same setup on my home workstation and it works if I choose jdk1.7.0_55 or Default JRE as JDK in the dialog. It doesn't work when I choose jre7.
You can try to select Default JRE and see if this works.
Another option is to try a clean start of Eclipse. Edit the eclipse.ini file located in your Eclipse install directory and insert -clean as first line.
If you have downloaded a multi-language version of GlassFish 4, the problem may be related to that. You then may try it with the english only version.
If this also doesn't help you can also add the server runtime manually in the folder <WORKSPACE>\.metadata\.plugins\org.eclipse.core.runtime\.settings\ in a file named org.eclipse.wst.server.core.prefs (if it doesn't exist, create it). It should look similar to this:
eclipse.preferences.version=1
module-start-timeout=300000
runtimes=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?>\r\n<runtimes>\r\n <runtime id\="GlassFish 4.0" location\="C\:/glassfish4/glassfish" name\="GlassFish 4.0" runtime-type-id\="org.glassfish.jst.server.runtime.glassfish4" server_definition_id\="org.glassfish.jst.server.runtime.glassfish4" timestamp\="0" vm-install-id\="1399586723676" vm-install-type-id\="org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType">\r\n <map key\="generic_server_instance_properties" sunappserver.rootdirectory\="C\:/glassfish4/glassfish" sunappserver.runtimeName\="GlassFish 4.0"/>\r\n </runtime>\r\n</runtimes>\r\n
(The format looks a bit weird with the \r\n but this should be correct.)
You have to change the vm-install-id in this configuration, look for the ID of your JDK in the file <WORKSPACE>\.metadata\.plugins\org.eclipse.core.runtime\.settings\org.eclipse.jdt.launching.prefs. There should be an entry with your JDK. Copy the vm-install-id from this entry.
Make sure to have the right path to your GlassFish installation in that file.
After saving the file, start Eclipse and try to create a new server. The runtime should then be available when you choose GlassFish 4.0.
See also:
How to run eclipse in clean mode? and what happens if we do so?

how to setup JDBC in Eclipse?

I have eclipse and j developer,I am more comfortable with eclipse.I want to know how to setup the JDBC driver in eclipse,I downloaded a driver from oracle.com but it does not appear anywhere when I browse after clicking 'external jars' in 'java build path' in "libraries" tab. My database is Oracle express edition.
Are there any good pdf's or tutorials for java application development?I want to make a front end application where I enter data into fields and it inserts into DB,and make it such that we can also retrieve information when we enter for example an ID.
What are the materials required for this?I don't want to learn too deep but I want to learn in the process(this is not a project just something I wanna achieve this month) so I am guessing i need
1. a book on awt,swing classes
2. I need to set this JDBC thing I don't understand how to get it up and running in eclipse,i type code it gives me error.
3.a book on how to connect java to oracle express edition DB.
I have JDK 1.7.0.0.3
Thanks in advance(i'm a beginner ;))
If you're wanting to include a JAR file to your Eclipse project, you would generally create a 'lib' folder inside the project folder, and put the file in there. You then need to tell eclipse to include it in your class path so your code will compile and run inside eclipse.
To do that:
- Go into the properties of your project
- Select 'Java Build Path' in the left hand column
- Select the 'Libraries' tab in the centre part of the window
- Click the Add JARs button - this will give you a list of your projects in eclipse - expand your project and into the lib folder - your jar will be there.
- Select the JAR, click OK, and OK again out of the properties window.
Or, you can just right-click the jar and click BuildPath->Add to Build Path.
Select the option of Add External Jar from the Build path and then browse to the location where the Jar is downloaded, select it and add it.
If you are not able to find the Jar while browsing through build path, check the location in windows explorer and confirm that it is where you are searching for it.
You asked how to "set up jdbc in eclipse". Here is my take on your question. If this isn't the answer to your question maybe it will help someone else.
Also - I'm using kepler eclipse. (really jboss dev studio version based on kepler)
First set up the driver.
Preferences -> Connectivity -> Driver Definitions
Click Add... and follow the prompts. You will be able to test the connection at this point. Eclipse makes it obvious how! (Click the Test connection button)
Close the Preferences window. In the main window
Window -> Show View... -> Data Source Explorer
Right click on Database Connections. Select New... and follow the prompts.
You'll be able to open the connection and browse your database.
As far as JPA-enabling your application, there may be a way to have eclipse set that up (ie right click on your project and maybe there is something in the context menu). It would set up a persistence.xml file in the right place and maybe other things. I don't know off the top of my head.
Hope this helps.
add a classnotfound exception. like this:
try {
Class.forName("com.mysql.jdbc.Driver");//the class driver
} catch (ClassNotFoundException e) {
e.printStackTrace();
}

"Save could not be completed" errors with Eclipse and MySQL Workbench

I'm having a weird problem saving with Eclipse and MySQL Workbench. I am using Eclipse Java EE Indigo Service Release 1 and Workbench CE 5.2.24. My java is version 1.7.0_01. I am running on a Windows 7-64 machine.
I have some files on a network drive. If I edit one in Eclipse and try to save it, I get "Save could not be completed" with the reason "The system cannot find the path specified". Eclipse can successfully edit other files on the same drive. Also, another version of Eclipse on a different machine (32 bit Java EE Indigo) can edit and save the exact same file that the Eclipse on my laptop cannot save.
If I edit a model using Workbench on the network drive, I can modify the model just fine. If I try to export the script however, I get the error "Could not save file ". Failed to create file .KWLQCW". No such file or directory. I am trying to overwrite an existing script when I do the export. Again, using Workbench (same version) from another machine can make the modification that the Workbench on my laptop fails to.
I can edit or change both of these files using other editors with no problem. In fact, when I change do change them, Eclipse requires me to refresh them, but then can't save after editing them.
Both Eclipse and Workbench work just fine if the files are on my C drive. All of this was working last week and I cannot think of a configuration change I have made to my machine. I'd be grateful for any advice on debugging this.
I'd suggest you to try with the most recent MySQL Workbench version (5.2.39). The 5.2.24 version you are using is quite old. You can download Workbench here.
Well, I seem to have solved this by deleting the parent directory, recreating, and repopulating it. I can only imagine that the file system got corrupted somehow.
By changing the permission of the file and directory , the issue got resolved

Can't get GNATbench working with Eclipse

I'm trying to get the GNATbench plugin to work with Eclipse. I put the plugin and feature files in the correct places. I restart Eclipse and I am now given the option to create a new Ada project but when I try to do it I get this error:
The selected wizard could not be started. Plug-in com.adacore.gnatbench.cdt was unable to load class
com.adacore.gnatbench.ui.internal.wizards.NewAdaProject. An error
occurred while automatically activating bundle
com.adacore.gnatbench.ui (235).
Any idea what is causing this?
This is the issue you'll see if you attempt to use GNATbench with the 64-bit version of Eclipse. As the system requirements note in the readme, it's only compatible with the 32-bit version. I just did a quick test, which confirmed the issue.
I checked the README file of this plugin, it says this is required:
"C/C++ Development Tools (CDT) plug-in for Eclipse 3.5.x or 3.6.x"
Have you installed that?
The other important thing is that the downloaded archive file is actually a P2 repository installable file. In this case I would unzip a new eclipse (or remove manually the related plugins you copied over, this is the hard way), start it, click on help/install new software, click add, select archive, point to your downloaded GNATbench zip file, select the 2 features appearing on the avail "software" list and continue the wizard normally (next, finish...). If there is a version problem the wizard should "validate" it.
There was a plugin for Ada called Hibachi, IIRC... I'm not sure where it stands on development or completeness though.

Can't add server to a moved workspace

I have this workspace downloaded off the web and I try running it on a tomcat server from a fresh installation of Eclipse Ganymede. This particular project came with its own workspace.
When I select Tomcat v6.0 I get a message
Cannot create a server using the selected type
Older tomcat versions are available, though.
I guess I have to recreate some configuration setting. The question is which one? This seems to be some odd error as creating a new dynamic web project lets me configure tomcat for both of them
I had a similar problem, but my solution is a little simpler. The problem was causesd by renaming the original folder that was referenced by the server definition.
Go to Window/Preferences/Server/Runtime Environments, remove the broken reference. Then, click 'Add' to create a new reference, select the appropriate tomcat version, click next and you'll see the incorrect path reference. Fix it. Move on.
I had this same problem on Ubuntu 8.10 with Ganymede and Tomcat6. This appears to be some sort of bug with Eclipse. If you try and create a server, and it barfs, you can't create another tomcat6 server. To correct this problem, do the following:
close eclipse
go to the {workspace-directory}/.metadata/.plugins/org.eclipse.core.runtime/.settings directory and remove a file called org.eclipse.wst.server.core.prefs.
start eclipse
add your tomcat6 server in the server tab
kotfu
#id thanks for the solution but something is also hidden in org.eclipse.jst.server.tomcat.core.prefs
So in order to solve the problem
close eclipse
go to {workspace-directory}/.metadata/.plugins/org.eclipse.core.runtime/.settings
remove the files org.eclipse.wst.server.core.prefs and org.eclipse.jst.server.tomcat.core.prefs
Tomcat 5.5
I order to be able to use the tomcat5.5 server you need to have a writeable catalina.policy file as mentioned in
http://dev.eclipse.org/newslists/news.eclipse.webtools/msg16795.html (= add a READ and WRITE permissions to the files in directory "{$tomcat.home}/conf" (chmod -vR a+rw {$tomcat.home}/conf/*). To be more specific, on the file "catalina.policy". After that, the Tomcat server can be added in the Eclipse servers)
(dead link) http://webui.sourcelabs.com/eclipse/issues/239179
and to have the tomcat5.5 stopped before entering eclipse and started afterwards.
Tomcat 6
In order to be able to use the tomcat6 server the proper solution is to have a user instance of the tomcat6 server as described in
/usr/share/doc/tomcat6-common/RUNNING.txt.gz
RUNNING.txt (on the WEB)
My configuration is Debian/Sid, Eclipse 3.4.1. Ganymede
The error view really is key. There is a lot of detail in there -- if necessary, right-click on the entries and copy their contents into your favorite text editor. One problem that can come up, for instance, is that if you have a server configuration already in place, and one of the configuration XML files is unparseable, the server can't be added. This happened to me this evening -- my <Context> element had a linebreak in it, so it was <C(linebreak)ontext>. This prevented Eclipse from recreating the server configuration.
i finally got mine to work with the default Ubuntu 8.10 tomcat. (the debug command-line on eclipse is a wonderful thing) First i had to make a couple of symbolic links and then change the permissions to a file. (you might want to think twice about changing the permissions depending on your configuration, but if eclipse can't read the file it throws and exception and the gui won't let you continue)
sudo ln -s /etc/tomcat6 /usr/share/tomcat6/conf
sudo ln -s /etc/tomcat6/policy.d/03catalina.policy /usr/share/tomcat6/conf/catalina.policy
sudo chmod a+r /usr/share/tomcat6/conf/tomcat-users.xml
Hum it can tricky. Bring the "server" view. If your project has already been deployed, remove it from the server to clean the binding between your project and the server.
Or you can right-click on your project in the project explorer and choose debug on the server. If you don't done it already, Eclipse should ask you to create a server runtime and here you can specify Tomcat 6 and specify the location of your server installation.
You can also see the "problems" view to see any problm in the project imported like the JDK etc...
Look in the error view. If you tried to set one up once and failed, Eclipse seems to try and look there again later just before allowing you to create a new one. If you've deleted the folder or its not there any more, you need to replace it so that you can proceed.
The only way I found to use the Tomcat 6 is changing the ownership of the Tomcat directory to my user. It seems that is not enough to have r/w permissions.
BTW, removing org.eclipse.wst.server.core.prefs erases you workspace configuration.
I had had same problem until I went to tomcat6 configuration directory and added ownership to my user in addition to root:
cd /usr/share/tomcat6/conf
chown root:myusername ./*
chmod 777 ./*
You can choose some better chmod for security, 777 is just a quick brutal fix.
I have Eclipse 3.5 (Galileo) + Fedora 12 + Tomcat 6 extracted from tar(which is why Eclipse could not access it). Eclipse had been complaining "Cannot create a server using the selected type".
What version of Eclipse? Europa? Ganymede?
What do you mean by workspace? An Eclipse workspace is not something you deploy, it holds your projects.
You will need to generate a WAR file (or the folder of files that would comprise the WAR file), a project would typically include an ANT or Maven build script to do this, or if the project used Eclipse's Dynamic Web Project type there might be a 'generate WAR' option somewhere. Without further details I can't help any more.
Adding a new dynamic web project to the workspace seems to 'unlock' the feature.
Changing the ownership to my user worked for me.
In my case, it was the corrupted Tomcat configuration files. Eclipse log was saying:
org.eclipse.core.runtime.CoreException:
Could not load the Tomcat server configuration at
C:\Program Files\Apache Software Foundation\apache-tomcat-6.0.14\conf.
The configuration may be corrupt or incomplete.
Got a new Tomcat distribution, removed the old one and all good now.
Finally got this problem solved on my system.
1) got rid of the apt-gotten tomcats
2) installed a typical tomcat from bins at tomcat.apache.org
3) got rid of my openjdk
4) installed the sun jdk (apt-get)
5) removed my web projects in eclipse
6) noticed that when adding a web project you can set "Target Runtime" - I tried setting it to Tomcat 6 and it let me know there was a problem
Maybe none of the above mattered, but here's what might have mattered:
7) KICKER: Window -> Preferences -> Server - Runtime Environments. Removed any crappy runtime environments here, and added the path to my newly installed tomcat.
This Question is maybe old. But I just ran into this problem. My project was not recognized as a web project (no globe icon in Eclipse ).
Suppose you use maven plugin , it failed to convert to web project with command
mvn eclipse:eclipse -Dwtpversion=1.5
In package Explorer, right-click on the project / configure / Convert to Java Facets project/ Dynamic Web project in Eclipse
Et VoilĂ 
Check the .project file at the root before and after the convert.
You will see new natures.
<natures>
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
</natures>
Instead of deleting config settings files, just go to Preferences -> Server -> Runtime Environments and remove the "forgotten" environment....
Thanks a lot this answer working for me..
I had a similar problem, but my solution is a little simpler. The problem was causesd by renaming the original folder that was referenced by the server definition.
Go to Window/Preferences/Server/Runtime Environments, remove the broken reference. Then, click 'Add' to create a new reference, select the appropriate tomcat version, click next and you'll see the incorrect path reference. Fix it. Move on.