How to access the database jar file using the derby 10.2.1.6 database ?
Hi,
How to access the database jar file using the derby 10.2.1.6 database ?
I have used like below. And i am getting the following the error:
"org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot load JDBC driver class 'org.apache.derby.jdbc.EmbeddedDriver'
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1136)"
My context.xml file looks like this:
<Context crossContext="true">
<Resource name="jdbc/derby" auth="Container"
type="javax.sql.DataSource" driverClassName="org.apache.derby.jdbc.EmbeddedDriver"
url="jdbc:derby:jar(\CalypsoDemo\database.jar)samples"
username="xxx" password="xxx" maxActive="20" maxIdle="10"
maxWait="-1"/>
</Context>
What could be the reason.?
Any suggestions will be appriciated.
Thanks in Advance,
Gana.
ya, I have restarted. Can you please tell me whether the path which i am giving is right or not in the context file?
Thanks,
Gana.
Similar Messages
-
How to access additional supporting jar files from EJB JAR?
Hi,
How can we access additional supporting jar files as part of my EJB JAR .
I don't want to keep them in the top level because other EJB JAR files also has
the same jar files(code in the classes in the jar is slightly different)
can I keep the additional jar files in my EJB JAR?
Thanks
NLBInclude the supporting jar files in the Ejb jar file.
Specifiy the jar files in the Ejb jar manifest file.
Manifest-Version: 1.0 [CRLF]
Class-Path: utility.jar [CRLF]
thanks,
Deepak
"NLB" <[email protected]> wrote:
>
Hi,
How can we access additional supporting jar files as part of my EJB JAR
I don't want to keep them in the top level because other EJB JAR files
also has
the same jar files(code in the classes in the jar is slightly different)
can I keep the additional jar files in my EJB JAR?
Thanks
NLB -
How can i rename a jar file using only java code
i have tried everything i can think of to accomplish this but nothing works.
ghostbust555 wrote:
In case you geniuses haven't realized I said I tried everything I can think of not that I tried everything. So help or shut up I realize that I didn't try everything but if you can't figure it out either DO NOT POST.
And the question is how can i rename a jar file using java code? As it says in the title. Read.I would tell you to use the File.renameTo method, but surely that would have been obvious, and you would have tried it already? But maybe you didn't. You were kind of lacking in details in what you tried.
And yes, I am a genius. Just don't confuse "genius" with "mind-reader". -
Create a jar file using the jar tool
Hello all,
can somebody help me with this situation:
I use the following comand
jar cfm Seti.jar manifest.mf SetiSeti.jar is the name of the file I want to create and Seti is the name of the folder where I have the class files, the manifest file and the Seti.java. The manifest file is also out of this folder (exactly the folder were I use the command on the command line).
After creating the jar... I try to run it but it gives an error message: "can't find the main class..."
The content of the manifest file is:
"Manifest-Version: 1.0
Main-Class: Seti
I'd never created a jar file before and have already read all the usefull information here and at sun... I'm very preoccupied with this..
Can you help?
ThanksRuiAranhaJava wrote:
How do I do this?
"And you have to name that package as well when you name the main class in the manifest. "
But, as I have told the name of the package is SetiNo, you just told us that the name of your class is Set. You never told us about the name of the package.
Simples question possible: Does your class look something like this:
package Seti;
// maybe there are some import statements here, maybe not
public class Seti {
// maybe there's something here, maybe not
public static void main(String[] args) {
// anything
}If so, then the fully qualified name of your class is "Seti.Seti" and you need to write that into the Main-Class attribute. (*)
If there is no package-Statement, then the fully qualified name of your class is simply "Seti" and the Main-Class attribute is correct, but your classes are in the wrong place.
Edit:
(*) Please note that package names should generally be all-lowercase, so it should be "seti" instead of "Seti". This helps distinguish it from the simple names of classes, so it's easy to see what you are talking about at a glance: "seti" would be the package, "Seti" the class name. -
How do I add a jar file into the build path of the compiler?
Hey,
I'm trying to import a jar file into the build path of the compilation process, but it does not find the packages or the classes that are in it.
I think I don't add it right...
ArrayList<String> options=new ArrayList<String>();
options.add("-d");
options.add(targetDirectory);
options.add("-classpath");
for(String str:includeDirectory)
options.add(str);
if (!compiler.getTask(writer, fileManager, diagnostics, options, classes, compilationUnits).call());
....and I've tried this way:
public void setTargetDirectory(String targetDirectory) {
this.targetDirectory = "-d " + targetDirectory;
private void compile(Iterable<? extends JavaFileObject> compilationUnits) throws Exception {
ArrayList<String> options = new ArrayList<String>();
options.add(targetDirectory);
String classPath="-cp ";// tried this also with "-classpath"
for (String str : includeDirectory)
classPath+=str+":";
options.add(classPath);
if (!compiler.getTask(writer, fileManager, diagnostics, options, classes, compilationUnits).call())
// throw new Exception("Compilation Error");
}Thanks in advance,
Adam.
Edited by: Adam-Z. on Feb 24, 2010 5:41 AM
Edited by: Adam-Z. on Feb 24, 2010 5:42 AMThank you for your reply,
Q: Are there .class files in that directory in that jar file? (the compiler doesn't ( can't )) look for directories, it can just look for specific files , and scan to get a list of all files matching certain criteria. So if there are no class files, it will say the package doesn't exist, even if there is a directory, possibly containing other files.yes there are class files in the jar, the tree structure:
j2MeDataChunkGenerator_Plugin\(lots of class files)
META-INF\manifest.mf
and thats it.
, your code will only work on windows because other platforms use a different path separator. You should use java.io.File.pathSeparator not explicit ';" when building your classpath. (this is unrelated to your problem, but you should correct it)will do, thanks.
Q: Is that error in your post formatted by your own diagnostics? (we could possibly help you better if we didn't have to guess!!)I would not post my own error code, this text is generated by the compiler diagnostic.
{code}
System.err.println(" Error details: " + diagnostic.getMessage(null));
{code}
Q: Is line 3 of ImageCroper_Editor.java (sic) an import statement? (we could possibly help you better if we didn't have to guess!!)it is an import error... didn't the error message stated that it is an import problem? wired, I'm sure before it did. anyway it is an import error.
Also you don't show us what the variable includeDirectory is in terms of type, and contents, that might be helpful. (we could possibly help you better if we didn't have to guess!!)It has only one String object: "D:\%Important Documents\WorkSpaces\PacMan\ApplicationManager\Plug-in\Data Chunk Designer.jar"
the last file on the classpath list.
Q: Have you proven this? that i did post, in this long line of text.
Q: Is the compiler finding other classes (in other packages) in that same jar file?No. all the class files are in the jar, they all have entries that start with "j2MeDataChunkGenerator_Plugin\*.class", and since I get 47 errors I guess it does not load any other class.
thank you for you comments, the problem with having these errors, is that I can't even get a piece of information where this error is coming from, only that it is an import loading error package not found, what does that mean? that the jar was not loaded in compilation(no error about this), that the jar is corrupted(no error about this), that the path is incorrect(it is correct I made sure), that there is no such package in the jar(There is), that the compiler does not load the package(does it even do that?), really I can't even guess why this happens, I've been at this on and of all day today, really annoying.
Thanks,
Adam. -
Deploying 2 entity beans in the same jar file using jboss
i have beans namely savings entity bean, checkings entity beans and teller session beans, i'm trying to deploy it with in the same jar file. but im getting an error 'savings bean : bean expects one persistance-type'. i hope someone could help me about this. its urgent. thanks
Although I am not super familiar with Jboss, my guess is that looks like the ejb xml sheet is not specifying the persistance type correctly for an entity bean. Take a look at your ejb xml sheet or post it if necessary.
-Dat -
How to sign multiple jar files using the same certificate..?
hi,
I want to run my application using Java Web Start.. i am using around 16 different jar files out of which around 13 are 3rd party component jars. I want to sign these jars using the same certifcate..., i am using the follwing code to sign the jars:
(for the jar file ischeduler.jar)
keytool -genkey -alias signFiles91 -keystore dtss -keypass dtss1351 -dname "cn=dtss" -storepass decisioncraft
jarsigner -keystore dtss -storepass decisioncraft -keypass dtss1351 -signedjar signedischeduler.jar ischeduler.jar signFiles91
keytool -export -keystore dtss -storepass decisioncraft -alias signFiles91 -file ischeduler.cer
keytool -import -alias DCA2 -file ischeduler.cer -keystore Impischeduler -storepass ischeduler
(for the jar file ischedulerclient.jar)
keytool -genkey -alias signFiles92 -keystore dtss -keypass dtss1351 -dname "cn=dtss" -storepass decisioncraft
jarsigner -keystore dtss -storepass decisioncraft -keypass dtss1351 -signedjar signedischedulerclient.jar ischedulerclient.jar signFiles92
keytool -export -keystore dtss -storepass decisioncraft -alias signFiles92 -file ischeduler.cer
keytool -import -alias DCA3 -file ischeduler.cer -keystore Impischeduler -storepass ischeduler
but when i use the above signed jars in my application i get an error saying:
"jars not signed by the same certificate"
can someone plz tel me wher is the error....thanx
andyWell for mulitple signing of jar files you can use ANT tool. Its easier and faster.
Regarding the present problem -- hmm.. well it looks like you are using 2 different alias names for signing the jar file. Try using the same alias name and that might solve your problem.
regards
Saby -
How to access classes in jar files
hi I have added a jar file to my project in eclipse.How to access the classes in that jar file?
cu is right.
classloader returns the URL of your resource. You can the jar using something like the following...
ClassLoader classloader = this.getClassLoader();
url = classloader.getResource("your_resouces...");
if(url == null)
System.out.println("cannot find resource ");
return null;
String jar = url.getFile();
jar = jar.substring(jar.indexOf("/")+1, jar.lastIndexOf("!")).replace('/', '\\');
obviously, this code snippet works on windows only. Now you have the jar file path. I use Jar file classes to access the jar file. (e.g. you can search for each class files)
Ming -
How to access picture in jar file?
i,ve made a jar file containing folder named frame\\data
and the folder data containing picture and sound
and i want to call\access the picture and the sound to make them appear to the user how?
this is my code
import java.io.*;
import java.net.URL;
import java.awt.*;
import javax.swing.ImageIcon;
import javax.swing.*;
import javax.swing.JOptionPane;
import javax.swing.JButton;
import javax.swing.AbstractButton;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.awt.event.ActionEvent;
import javax.swing.JFrame;
import javax.sound.sampled.*;
import java.awt.event.*;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;
public class MyFrame extends JFrame
ImageIcon img =new ImageIcon("src\\frame\\data\\heart7.png");
JButton btn=new JButton("Press Me", img);
MyInner inner;
MyInner4 inner4;
MyFrame ()
setupGUI();
private void setupGUI()
JFrame f =new JFrame();
// f.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE);
f.setTitle("Window Event");
f.setSize(550,350);
f.setResizable(false);
f.setLayout(new BorderLayout());
f.add("Center",btn);
btn.setVerticalTextPosition(AbstractButton.BOTTOM);
btn.setHorizontalTextPosition(AbstractButton.CENTER);
f.setVisible(true);
inner=new MyInner();
inner4=new MyInner4();
f.addWindowListener(inner);
f.addWindowListener(inner4);
class MyInner extends WindowAdapter
public void windowClosing(WindowEvent ee)
Toolkit tool = Toolkit.getDefaultToolkit();
tool.beep();
JOptionPane.showMessageDialog(null, "Better Work!","Bye Bye",JOptionPane.INFORMATION_MESSAGE,img);
// JOptionPane.showMessageDialog(null, "Text", "Title", JOptionPane.Type, icon);
System.exit(0);
class MyInner4 extends WindowAdapter
public void windowOpened(WindowEvent ex)
try {
// From file
AudioInputStream stream = AudioSystem.getAudioInputStream(new File("src\\frame\\data\\BraveHeart.wav"));
// From URL
//stream = AudioSystem.getAudioInputStream(new URL("http://hostname/audiofile"));
// At present, ALAW and ULAW encodings must be converted
// to PCM_SIGNED before it can be played
AudioFormat format = stream.getFormat();
if (format.getEncoding() != AudioFormat.Encoding.PCM_SIGNED) {
format = new AudioFormat(
AudioFormat.Encoding.PCM_SIGNED,
format.getSampleRate(),
format.getSampleSizeInBits()*2,
format.getChannels(),
format.getFrameSize()*2,
format.getFrameRate(),
true); // big endian
stream = AudioSystem.getAudioInputStream(format, stream);
// Create the clip
DataLine.Info info = new DataLine.Info(
Clip.class, stream.getFormat(), ((int)stream.getFrameLength()*format.getFrameSize()));
Clip clip = (Clip) AudioSystem.getLine(info);
// This method does not return until the audio file is completely loaded
clip.open(stream);
// Start playing
clip.start();
// Play and loop forever
clip.loop(Clip.LOOP_CONTINUOUSLY);
/* Play and repeat for a certain number of times
int numberOfPlays = 3;
clip.loop(numberOfPlays-1);
catch (IOException e) {
} catch (LineUnavailableException e) {
} catch (UnsupportedAudioFileException e) {
public static void main(String[]args)
MyFrame frame=new MyFrame ();
}Instead of doing like this,
ImageIcon img =new ImageIcon("src\\frame\\data\\heart7.png");
JButton btn=new JButton("Press Me", img); use this code,and then prepare the jar
try{
URL pathShell = null;
Object dummy = new Object(){
public String toString() { return super.toString(); }
ClassLoader cl = dummy.getClass().getClassLoader();
pathShell = cl.getResource("src\\frame\\data\\heart7.png");
image = new ImageIcon(pathShell);
JButton btn=new JButton("Press Me", imgage);
catch (Exception e) {} -
Hello,
I use Entity Framework code first approach.
My project is working fine with SQL Server. But, I want to access Oracle too. I want to switch SQL Server and Oracle in run time.
I am able to access Oracle using "Oracle.ManagedDataAccess.EntityFramework.dl" in a new project.
But, Is this possible to access SQL Server and Oracle in the same project.
Thanks,
MuruganThis should be possible with a Code-First workflow. In Code-First the database mapping layer is generated at runtime.
David
David http://blogs.msdn.com/b/dbrowne/ -
How to make changes to .fmx file using the form builder
Hi all
I have a .fmx form in the AR_TOP directory of the Oracle E-business suite.Now I need to make some changes to the form and compile it and place it back .But the .fmx file didnot open using the form builder 6i .So is there any way that i can convert the .fmx to .fmb so that I can open the form using the Form builder 6i??
I have the toad s/w installed but I dont know how to open the form using the Toad.
ThanksI have a .fmx formYou cannot open a fmx-file with any developer tool. To make changes to the source-code you need the fmb-file and open it witj Forms-builder
AR_TOP -directory of the Oracle E-business suiteBe careful when changing source-code in the ebusiness-suite. If its a module from oracle i don't if its supported if you do changes in it.
I have the toad s/w installed but I dont know how to open the form using the Toad.Toad is definitely the wrong tool for forms-modules. -
How to Run teststand sequence file using the LabVIEW
Hi
I want the execute the Teststand Sequence file using the LabVIEW .Net containers.I didnt find out the Execution Parameter in the .Net Container.Do you any suggestion regarding this question.Please let me know.
JayavelTestStand comes with loads of Operator Interface examples some simple, some full fledged. You can find it in teststand public folder win7 path here:C:\Users\Public\Documents\National Instruments\TestStand 2010 SP1\UserInterfaces
You can take these examples or use ideas from here, also read the teststand reference manual. It has a section about Operator Interfaces.
Beginner? Try LabVIEW Basics
Sharing bits of code? Try Snippets or LAVA Code Capture Tool
Have you tried Quick Drop?, Visit QD Community. -
How to load an applet jar file?
Hello everyone,
I have an applet that uses my own jar file and approximately 6 third party jar files. I set up jar indexing (jar -i) which will download the jar files when they are needed. All seems to work well, but now I want to manually load the jar files which I cannot get working.
When the applet starts, about 1/2 of the jar files are downloaded (because they are needed at startup). I then want to load the additional jar files in the background, after the gui is initialized. I have tried this using the below thread which is executed from within the applet's start method:
// Try to load additional jar files in background by loading a class from each jar file.
Thread loadClass = new Thread() {
public void run() {
System.out.println("Loading classes...");
try {
// Tried loading classes this way, doesn't work.
getClass().getClassLoader().loadClass("pkg1.Class1");
getClass().getClassLoader().loadClass("pkg2.Class2");
getClass().getClassLoader().loadClass("pkg3.Class4");
getClass().getClassLoader().loadClass("pkg4.Class4");
/* Loading classes this way doesn't work either.
Class.forName("pkg1.Class1");
Class.forName("pkg2.Class2");
Class.forName("pkg3.Class3");
Class.forName("pkg4.Class4");
catch(ClassNotFoundException e) {
// First attempt to load a class (pkg1.Class1) throws exception.
System.out.println("Can't find class: " + e.getMessage());
loadClass.start();As you can see from above I am trying to load a class from each of the jar files so that the jar files would load into memory/cache. Unfortunately, it cannot find the classes. These are the errors from the java console:
Loading classes...
Loading: pkg1.Class1
Connecting http://my.server.com/my_dir/pkg1/Class1.class with no proxy
Connecting http://my.server.com/my_dir/pkg1/Class1.class with cookie "JSESSIONID=some_big_long_char_list"
Can't find class: pkg1.Class1
So it appears the jar file is not being downloaded. When I take away the dynamic jar loading (removing the "jar -i" & adding them all to the applet archive list) the thread executes correctly. So I know the class names, etc, are correct. How does one load an applet jar file?
Any help/suggestions are appreciated.The above error I posted was because I forgot to index the jar files. That is why it couldn't find the jar file. I thought I was getting farther along with my problem, but I apparently just forgot to index the jars. I am now getting the problem that I got yesterday...
The applet freezes/hangs when it hits the thread. The GUI never opens (even though I'm running this thread right after the gui shows). The java console quits responding and the applet just stays the grey screen. I also tried the invoke later that you suggested.
public void start() {
// ...initialize gui...
// Applet freezes and remains grey, also the java console freezes.
javax.swing.SwingUtilities.invokeLater(new Runnable() {
public void run() {
System.out.println("Loading classes...");
try {
// When I comment out the below forName calls, the thread will still run evidenced through the done print statement.
Class.forName("pkg1.Class1");
Class.forName("pkg2.Class2");
Class.forName("pkg3.Class3");
Class.forName("pkg4.Class4");
System.out.println("...Done loading classes");
catch(Exception e) {
System.out.println("Can't find class: " + e.getMessage());
} -
Why is the application caching the old jar file
Hi all
I have an application that is caching the old jar file.
even when i reboot.
when the application starts up it appears to pick up the old jar file.
any idea on how i can let it pick up the new jar file ?
stevI'm pretty sure that it is just this one .jar file.
You see I changed a Servlet class in the jar file and messed up the application.
Now I'm putting back the old jar file and guess what
it's somehow hanging on to this old servlet class. and showing the same error. What is unique is that I did the same thing on another PC a server edition and it let go of the old Servlet with no problem
but on my PC a professional edition it is hanging onto that old Servlet even though I deleted every instance of it on the PC , shut down the PC and restart the app. I even deleted the old jar file from the recycle bin. the jar file has a very distinct name so i can easily search for it and
This app uses tomcat as well - not that that's related.
I have had this problem happen to me before at home with applet. I would change something and it would just hang on to it forever.
Anybody has any idea how to go into the registry or some other place and get rid of this servlet class or jar file ?
stev -
Is there a way to share ai or psd files using the cloud with non-cloud clients?
I am interested in sharing the progress of a work in progress. I have not used the cloud file storage yet and was wondering if there is a way to give clients access to a specific files using the cloud.
Yes. Files are either Private or Public. Once a file is made Public anyone with that url can see the page for the file. You can control whether comments or dowloading of the original file is allowed.
Your client does not need an Adobe ID to view the page, just a web browser.
Maybe you are looking for
-
Event ID 2115 A Bind Data Source in Management Group
Hi All, I have some issue's with Microsoft System Center Operations manager 2012 R2. The issue is the following: A Bind Data Source in Management Group XXXXXXX has posted items to the workflow, but has not received a response in 2100 seconds. This i
-
N85 is slow - tried various kinds of resets
My N85 is ridiciously slow, I've tried *#7370# and *#7780#. Doesn't solve my problem. Apparently there is a third way to reset the phone, holding down *, 3 and the green button while booting up - but my phone prompts for the pin-code, and I can't bot
-
How to copy DVD so it will play on a Windows PC?
I have a home made DVD that plays fine on both a Windows XP PC and my Mac OS X 10.4.11 system. I have used Disk Utilites to duplicate the disk, following the directions in the Help System for copying a DVD. All seems to work fine on my Mac, the copy
-
Latest java JDK7 launcher runtime Error Cocoa AWT: Running on AppKit thread
Just tested the latest release. got this error in the console 28/07/2012 08:12:15.465 JavaAppLauncher[11751]: Cocoa AWT: Running on AppKit thread 0 when not expected. ( 0 liblwawt.dylib 0x000000010ec1ca97 Java_sun_java2d_opengl_CGLLayer_nativeCr
-
TS3999 iCloud Outlook Addin not found
The 'iCloud Outlook Addin' is not installing to Outlook 2007 Trust Center when iCloud Setup installs. I have done all the troubleshooting and followed suggestions to re-install iTunes, Quicktime, then icloud setup BUT the addin 'iCloudOutlookaddin' d