Need to know the jar file...?
Hi,Iam writing an java program which is going to send messages to the remote websphereMQ server,program compiled successfully while in execution it throws error.The prgram is
com/ibm/jvm/ExtendedSystem/*
Use source code downloads, example commands,
and any other techniques at your own risk.
No warranty is provided.
import java.util.Properties;
import javax.jms.JMSException;
import javax.jms.TextMessage;
import javax.jms.Queue;
import javax.jms.QueueConnection;
import javax.jms.QueueConnectionFactory;
import javax.jms.QueueSender;
import javax.jms.QueueSession;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import java.util.Hashtable;
public class Sender {
String url_;
String name_;
QueueConnection conn = null;
QueueSession session = null;
Queue queue = null;
public Sender(String url, String name) throws JMSException, NamingException {
url_ = url;
name_ = name;
this.initializeSender();
private void initializeSender() throws JMSException, NamingException {
/* Properties props = new Properties();
props.setProperty("java.naming.factory.initial","org.jnp.interfaces.NamingContextFactory");
props.setProperty("java.naming.factory.url.pkgs", "org.jboss.naming");
props.setProperty("java.naming.provider.url", url_); */
String icf = "com.ibm.websphere.naming.WsnInitialContextFactory";
//String url="iiop://192.168.2.45:1421";
// Initialise JNDI properties
Hashtable env = new Hashtable();
env.put("java.naming.factory.initial",icf);
env.put("java.naming.factory.url.pkgs","com.ibm.ws.naming");
env.put("org.omg.CORBA.ORBClass","com.ibm.rmi.iiop.ORB");
env.put("org.omg.CORBA.ORBSingletonClass","com.ibm.rmi.corba.ORBSingleton");
env.put("javax.rmi.CORBA.UtilClass","com.ibm.rmi.javax.rmi.CORBA.Util");
env.put("javax.rmi.CORBA.StubClass","com.ibm.rmi.javax.rmi.CORBA.StubDelegateImpl");
env.put("javax.rmi.CORBA.PortableRemoteObjectClass","com.ibm.rmi.javax.rmi.PortableRemoteObject");
env.put("java.naming.provider.url",url_);
InitialContext context = new InitialContext(env);
QueueConnectionFactory qcf = (QueueConnectionFactory) context.lookup("QCF");
conn = qcf.createQueueConnection();
queue=(Queue)context.lookup(name_);
session = conn.createQueueSession(false,QueueSession.AUTO_ACKNOWLEDGE);
conn.start();
public void send(String text) throws JMSException, NamingException {
QueueSender send = session.createSender(queue);
TextMessage tm = session.createTextMessage(text);
send.send(tm);
send.close();
public void disconnect() throws JMSException {
if(conn != null) {
conn.stop();
if(session != null) {
session.close();
if(conn != null) {
conn.close();
public String getTopicName() {
return name_;
public String getTopicURL() {
return url_;
public static void main(String args[]) throws Exception {
System.out.println("Starting JMS Example Sender");
Sender sender = new Sender("iiop://192.168.2.45:1421", "ASMQUEUE");
System.out.println("Sending list of data");
sender.send("Krishna Moorthy");
sender.disconnect();
System.out.println("JMS Example Sender Complete - list sent");
}During Execution followng error occurs,
D:\jboss-4.0.5.GA\WebSphere_JMS>java Listener
Starting JMS Example Listener
performing lookup...
Error creating listener: javax.naming.NamingException: Failed to initialize the
ORB [Root exception is org.omg.CORBA.INITIALIZE: can't instantiate default ORB i
mplementation com.ibm.CORBA.iiop.ORB vmcid: 0x0 minor code: 0 completed: No]
javax.naming.NamingException: Failed to initialize the ORB [Root exception is or
g.omg.CORBA.INITIALIZE: can't instantiate default ORB implementation com.ibm.COR
BA.iiop.ORB vmcid: 0x0 minor code: 0 completed: No]
at com.ibm.ws.naming.util.Helpers.getOrb(Helpers.java:293)
at com.ibm.ws.naming.util.WsnInitCtxFactory.getInitialContextInternal(Ws
nInitCtxFactory.java:365)
at com.ibm.ws.naming.util.WsnInitCtx.getContext(WsnInitCtx.java:102)
at com.ibm.ws.naming.util.WsnInitCtx.getContextIfNull(WsnInitCtx.java:40
8)
at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:131)
at javax.naming.InitialContext.lookup(InitialContext.java:351)
at Listener.initializeListener(Listener.java:78)
at Listener.<init>(Listener.java:31)
at Listener.main(Listener.java:112)
Caused by: org.omg.CORBA.INITIALIZE: can't instantiate default ORB implementatio
n com.ibm.CORBA.iiop.ORB vmcid: 0x0 minor code: 0 completed: No
at org.omg.CORBA.ORB.create_impl(ORB.java:297)
at org.omg.CORBA.ORB.init(ORB.java:336)
at com.ibm.ws.orb.GlobalORBFactory.init(GlobalORBFactory.java:77)
at com.ibm.ejs.oa.EJSORBImpl.initializeORB(EJSORBImpl.java:174)
at com.ibm.ejs.oa.EJSClientORBImpl.<init>(EJSClientORBImpl.java:98)
at com.ibm.ejs.oa.EJSClientORBImpl.<init>(EJSClientORBImpl.java:74)
at com.ibm.ejs.oa.EJSORB.init(EJSORB.java:386)
at com.ibm.ws.naming.util.Helpers.getOrb(Helpers.java:284)
... 8 more
Caused by: java.lang.NoClassDefFoundError: com/ibm/jvm/ExtendedSystem
at com.ibm.rmi.util.JDKBridge.setCodebaseProperties(JDKBridge.java:226)
at com.ibm.rmi.util.JDKBridge.<clinit>(JDKBridge.java:205)
at com.ibm.rmi.util.RepositoryId.<clinit>(RepositoryId.java:122)
at com.ibm.rmi.iiop.CDROutputStream.<clinit>(CDROutputStream.java:1077)
at com.ibm.rmi.corba.ORB.<init>(ORB.java:250)
at com.ibm.rmi.iiop.ORB.<init>(ORB.java:166)
at com.ibm.CORBA.iiop.ORB.<init>(ORB.java:521)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstruct
orAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingC
onstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
at java.lang.Class.newInstance0(Class.java:350)
at java.lang.Class.newInstance(Class.java:303)
at org.omg.CORBA.ORB.create_impl(ORB.java:295)
... 15 more
Done listening
In my application classpath following jars are used : jms.jar,naming.jar,namingClient.jar,ibmorb.api,ibmorbapi.jar,jndi.jar
I need to know the jar file name for this class : com/ibm/jvm/ExtendedSystem.And also tell me the solution to solve the above error.Anyone know the solution please reply as early as possible..Thanks in advance
Have you checked if any of the jar files in your class path contains the missing class ?
Similar Messages
-
Why need to sign the jar files ????
Hi
Why does i have to sign the jar files to run my app ??
are not another away to run the app???U just have to sign your jar if your application needs full access to the client-resources.
http://java.sun.com/products/javawebstart/docs/developersguide.html
andreas -
Where i will get the .jar files for JDBC connector for MSSQL Server
Hi,
i am trying to configure the JDBC connector for the MSSQL server. For this we need to add the .jar files for MSSQL Server. Can any body tell , where i will will get the jar files to finish this connection.
Database version is MS SQL Server 2000
Portal version is Portal7.0 sp9
Regards
vijayHi Vijay,
If you are looking for the exact steps as to how we can configure the JDBC Connector for accessing the MS SQL Server, have a look at this document:
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/b00917dc-ead4-2910-3ebb-b0a63e49ef10
Follow the steps till page 12 of this doc.
Bye
Ankur
Do reward points for helpful as well as solved answers!! -
Alternative to specify the jar file location other than server classpath.
Hi,
We use weblogic 8.1 for our development purpose... and mostly work on ejb's. Every time a new ear file is created and deployed we need to specify the jar files needed to run that application in server classpath.... is there any alternate way so that v can avoid specifying these jar files in server classpath...vinod hadlee wrote:
Hi,
We use weblogic 8.1 for our development purpose... and mostly work on ejb's. Every time a new ear file is created and deployed we need to specify the jar files needed to run that application in server classpath.... is there any alternate way so that v can avoid specifying these jar files in server classpath...One alternative is you could bundle the jars in the EAR itself in APP-INF/lib.
Gerald -
How to modify the jar files information for Script Assets??
Hi,
I am using Open Script 9.2. We can add the external JAR files using Script->Script Properties--> Script Assets. I need to change the jar files when ever i am going to execute no of scripts. How can I modify them using JAVA Coding without manual handling. Is there any specific methods existed in OpenScript to serve the above scenario.
Thanks in Advance.
Thanks & Regards,
Siva ThotaHi,
When you say alter the jar file, do you mean alter the contents of the java code within the jar. If this is yes then the simple answer is no. As you are probably aware, a jar file contains pre-compiled java code, which you will not be able to alter. What is it you are trying to achieve?
A simple answer maybe to use a child script which you can include into your main script. You can then change the code in the child script, and when you play back, this 'new' code will be compiled, and included within the replay.
Regards
Wayne. -
The jar files needed to use MQ Sonique driver
Hi,
I am using the Sun JMS adapter
and the driver is Sonique MQ Series
can I know what jar files are needed to make the set up
in to the XI server?
Thanks & Regards
RanjitHi,
Add sonic_Client.jar.
Regards,
sudheer. -
What are the jar files needed for HTMMLB?
Hi,
I have imported a HTMLB comp par file into my NWDS.
it is showing me some errors like com.sapportals.htmlb cannot be resolved...what may be the prob...do i need to import any jar files regarding this.
Plz help..
Thanks,
ViswesHi,
Please see this helpful link
New Reference for Portal APIs
Ramganesan Karuppaiyah -
Help need in Adding External jar files.
Hi all,
Iam developing ADF application using JDEV 11.1.1.3.0.
I need to move files from one directory to another so i have used external jar "commons-io-1.4.jar" file.
i did this by going to the project properties -->Libraries and Classpath -->Add Library
added the jat file.
In java class i have used the function
File.copyFileToDirectory(reQueueFile, TargetLocation,false);
it was working fine when i tried in IntegratedWeblogic server but when i deploy in Standalone Weblogic server its not getting the jar file.
Its throwing me the exception
javax.el.ELException: java.lang.NoSuchMethodError: org/apache/commons/io/FileUtils.moveFileToDirectory(Ljava/io/File;Ljava/io/File;Z)V
at com.sun.el.parser.AstValue.invoke(AstValue.java:161)
at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:283)
at org.apache.myfaces.trinidad.component.UIXComponentBase.broadcastToMethodExpression(UIXComponentBase.java:1303)
Please let me know is there a way of adding the lib to the project.
Regards,
Suresh kumar.kFirst you should check that the library has the checkbox 'Deploy by default' is checked for your library.
The you open the project properties of the view controller project, select Deployments, edit the deployment descriptor. Select the Node 'File Groups'->'WEB-INF/lib'->'Contributors'. this should give you a list of libraries your project uses. Check if your library has the checkbox checked (is selected fro deployment). If it's not checked, set it.
This should include the library.
Timo -
Protecting the jar files from being web access
I have a jnlp file which is put under tomcat webapps folder, say (\webapps\TEST\launch.jnlp), with the jar and lib files put in the subfolder (\webapps\TEST\folder1\*.jar AND \webapps\TEST\folder1\lib\*.jar).
My question is how can i prevent user from direct access to the jar files via typing http://www.someip.com/TEST/folder1/main.jar ? I tried the following methods but it seemed not working:
1. Change the folder permisson in \webapps\TEST\*.*, but when user type the above hyperlink they can still get the jar file
2. put the jar and related files under \WEB-INF\, but now this time running the launch.jnlp, it returns an error saying that it can't access/find the WEB-INF.
Is there any method? Or should I say, when you published jnlp to web, the related jar files are forced to be accessed by everyone.Sounds easy to me: encrypt your xml, then instead of just storing your key as plain bytes do some reversable operations on it (xor masks, reversions, whatever you like), just do them in many different points (and classes) of your code, have some parts done by methods that actually check application is running under JWS with proper codebase, scramble it all, and suddently the whole stealing operation won't be worth the effort. Obviously you should have many private (and package protected) methods, seal packages and so on. Maybe, somehow, you can even use reflection to identify calling classes (not sure, never looked for anything similar).
What else? write down some c++ code into your own dll/JNI library and make it do something too, so they'll even need to decompile the dll. If you know first execution is always online you can send another xor key and store it with persistence service or write it down to windows registry. You can keep making it harder as much as you like, even just with silly code like
Math.ceil((new GregorianCalendar.getField(Calendar.YEAR)%2000)/1000)*((int)('c'-'a'))just to retrieve the number 2. If you distribute such code through many lines and methods, once you scramble it, most people will give up.
Bye. -
How to determine the path of the jar file cache of javawebstart?
Hello, I need to know how to determine where the java web start application
file jar cache is stored on windows system hard drive.
I would have launch of the inner processes
I have need to know the path of file jar .
example if my application is myAppliation.jar
in code generic class of myAppliation.jar i have the command runtime
String strCmd =
System.getProperties().getProperty("java.home") + "\\bin\\java" +
" -cp " +
System.getProperties().getProperty("java.class.path") + ";"
+ " anotherClass.class ";
Runtime.getRuntime().exec(strCmd);
the anotherClass.class has need
of the contained library in myAppliation.jar.Thanks i have tried this metod and function
java.net.URL resource = classLoader.getResource("myResource");
if (resource != null) {
String s = resource.toString();
if (s.startsWith("jar:")) {
int index = s.indexOf("!");
if (index > 4) {
String fileurl = s.substring(4, index);
if (fileurl.startsWith("file:")) {
String path = fileurl.substring(5);
// now path is the path to the jar file in the cache containing the resource
System.out.println("file jar: "+path);
} -
Adding Classes to the JAR File's Classpath
Ques 1- Can I use the wildcard * symbol in Manifest file to add classes/othes jar files to the JAR File's Classpath.I have folder named - Lib . where there are many jar files.Now,do I have to add each jar file by- Class-Path: Lib/jar1-name Lib/jar2-name . Instead, can I do this- Class-Path: Lib/*.jar OR Class-Path: Lib/*.class
RIDICULOUS....105 views has been made but YET NO ANSWER. Isn't there anybody who knows the answer.
Edited by: Tanvir007 on Apr 30, 2008 2:21 AMQues 1- Can I use the wildcard * symbol in Manifest file to add ... other jar files ...?No. You could, however, place all your needed JARs in JavaHome/jre1.x.x/lib/ext - if this is a way for you.
Ques 2 ??
RIDICULOUS....105 views has been made but YET NO ANSWER.What hindered you to test it yourself?
And the things we don't know far exceed the things we know. Why do you wonder?
Have a nice day
J�rg -
can you please tell me,
the name of the JAR file where this class "'com.ibm.ejs.ns.jndi.CNInitialContextFactory' " exists .
Thanksin fact, i need to know the name of the JAR file
because i am getting exceptions,
...classnotfound......i want to put that JAR file
in the classpath to avoid classnotfound exception.Uhm... if the stuff is not in your classpath, then you have no choice but to run through your file system and look into every JAR you can find.
so, if i get to know the name of the JAR file
.....i would be able to remove the runtime error.Doubt it. Websphere doesn't care for your classpath, it uses its own. So if it doesn't find the class, it's not there. -
How to extract the contents of the Jar file?
Hello,
Can anyone tell me how to extract the contents of the Jar file?
An example will be highly appreciated.
Thanks.From command line, or from within a java application?
Kaj
Btw. Why do you need to do it. You do know that you can add jars to the classpath and read resources from them without extracting the file? -
ODI - Multi development environment how to share the JAR files
Hi,
For some of our functionality, existing KM not sufficient so we created with our own KM and we have called some jave code which we created and place inside lib directory of ODI as a JAR file. there are four people in the development work. so we have four development environment(all are complete installation, i.e while installing we choosing Complete Option).
One of our developer created the our own KM and he placed the jar file in his own Dev environment's lib Directory. Since four Dev environment shares the some work rep we could see the new KM and all the ODI object in all the dev env. but if we run the the ODI interface which use the new KM from other Dev environment where we dint place the jar we are getting Error.
if we keep the jar file in all the other three Dev environment's LIB directory then respective interface working.
here my doubt, is there any other way to share the JAR file to all the Environment without copying into everywhere?
Thanks
KnidhiThanks you verymuch Cezar and Ratish, now almost i got the answer for my question.
i installed ODI Server into separate machine. it has folder structure as follows
Directory: D:/ODIServer/oracledi/ has the following subfolder
1.bin 2.drivers 3.lib 4.tools.
here i need to keep my Jar files under the lib folder. am i right?
and bin directory contains only Agent related batch files. (agent.bat, agentscheduler.bat,agentservice.bat,agentstop.bat,agentstart.bat,agentweb.bat and jython.bat and respective .sh files)
here dont know how to precede the following things
1. how to configure the Master and Work Repository information with ODI Server?(MR and WR i already created with the help of one the ODI Client)
2. how to configure the Client machine to Server?
3. Since ODI Server not having the Topology, how to create the Agent? do i need to use any one of the ODI Client for this task?
--Thanks
Knidhi -
Need help compiling external jar files into my one jar file from cmd line
Here is my problem, let me see if I can explain it right:
I am making a jar file on my development computer that will run my java project. In this java project, it references a couple Java3D jar files. On my development computer, I create the jar file and it runs correctly, but when I move that jar file over to the test computer, the parts of the application needing those Java3D jars are not found in my jar I created. I isolated the problem and it is because those Java3D jar files I needed are not on my test machine. But that is the way I need it to be. I need it so that when I compile all my code on the development machine, I need it to also compile those two Java3D files into my one jar that I move to the test machine. You get what I'm saying? I must do all the compiling from the command line and have only one jar file to put on the test machine that contains all my compiled code and the two Java3D files needed to run some of the applications in the project.
Here a brief sample of what I'm doing:
To compile my java files in my project, I simply to this for all my files:
javac file.java
javac file2.java... and so on for all my java files.
Then I create my jar file:
jar -cfm MyJar.jar manifest.mf file.class
jar -fmu MyJar.jar manifest.mf file2.class... and so on for all my class files.
Also when compiling my jar file, I do this thinking that it would include the two Java3D jars into my one jar file:
jar -fmu MyJar.jar manifest.mf jars/j3d-org-images.jar
jar -fmu MyJar.jar manifest.mf jars/j3d-org.jar
My manifest file looks something like this:
Manifest-Version: 1.0
Main-Class: Main
Class-Path: jars/j3d-org.jar jars/j3d-org-images.jar
Do I have to have that Class-Path in there pointing to those jar files? Those jar files will not exist on my test machine because the directory structure will not be the same. I've tried a manifest without specifying my Class-Path to those jar files, but I get the same problem when I run my application on the part that needs the Java3D files.
The error I am getting is that there is a RasterTextLabel class inside one of those Java3D jar files that my application cannot access because those jar files are not on my test machine.
So basically what I really need to know is how I get those two Java3D jar files compiled into my one jar file that I move to a test machine and run with the following command:
java -jar MyJar.jar
Can anyone help me??
Thanks.Here what you need is to have all the files present in a single jar file, and the classpath is set properly to the required jar files.
Do the following in steps:
1)
Create a custom manifest file,say mymanifest.mf, with the following contenets, put it in current directory:
Manifest-Version: 1.0
Created-By: 1.4.0_01 (Sun Microsystems Inc.)
main-Class: Main
Class-Path: jars/j3d-org.jar jars/j3d-org-images.jar <press ENTER key>
2)
jar -cfm MyJar.jar manifest.mf file.class
jar -fmu MyJar.jar manifest.mf file2.class... and so on for all class files.
3)
jar -fmu MyJar.jar manifest.mf jars/j3d-org.jar
jar -fmu MyJar.jar manifest.mf jars/j3d-org-images.jar
(Make sure that j3d-org-images.jar and j3d-org.jar are present in a subdirectory called 'jars')
Now you would be able to run,
java -jar myjar.jar
Maybe you are looking for
-
My IPhone 4 will not charge sine the update.
First it started to just die really quickly not it will not charge past 2%.
-
Link to photo on Dropbox will not open
I have been sent an email that contains a link to a picture that sender has stored on Dropbox. The link worked fine on my laptop, but will not open the jpg on my Playbook. What I see, is a rectangular grey image with break therough the corner. Maybe
-
Can't drag and drop on desktop and I've tried all suggestions from previous threads
Yesterday I found that I can't drag and drop any files on my desktop. I get the white circle with a line through it when I try to drag anything. I can drag off of my desktop to my HD and to the trash but I can't drag anything back. I've read all of t
-
Transport Basics: Can you explain this to me?
Hello Experts, In Transport Organizer: Requests (se09), I double clicked on a Transport request and I could see a display of the Transport Request number (Request/Task: BWIK ..) and 3 tabs (Properties, Objects, Documentation). 1. Under Objects tab I
-
I need help re-installing CS6 on my computer.