Deploying a JAR file from Forte
I have written an application using the Forte CE IDE. Now I want to deploy it to other PCs running JRE1.3, so I used the JAR packager to create a JAR file and I ensured the manifest had the Start class specified. Unfortunately, when I try to run this application via the command line on either another machine or my own (outside of Forte), I get the message
Exception in thread "main" java.lang.NoClassDefFoundError: <start class name>
I have used the "java -jar" command.
The start class is in the jar file.
The start class name is in the manifest.
I must have missed something, and I am at my wits end.
Has anyone else had similar problems deploying applications from Forte? Or can anyone offer advice or a link to some comprehensive documentation on how to accomplish deployment? The help function in Forte was no help at all.
Thanks.
Are you sure that there is a newline after your lines in the manifest?
Hit return after each line to make sure!
Similar Messages
-
Why aren't deployed jar files from forte for java CE recognized by iplanet server?
At 09:33 AM 4/20/01, Rottier, Pascal wrote:
Forte 4GL is:
1) A language, TOOL (Compare to Java)
2) An IDE (Compare to e.g. JBuilder or FJCE)
3) A collaborative development environment, with central repository (Compare
to ????)
4) A distributed application server / object request broker (Compare to J2EE
servers and/or CORBA)Let's not forget WebEnterprise, Express, and especially Fusion.
I think, SUN is not al all interested in TOOL.If TOOL were just a language and had no market yet, you are probably
right. But, not only is TOOL the key to the Forte environment, but it has
an existing and profitable market. Sun still sells FORTRAN, after all, and
continues to put money into ADE development for all its language
products. The real kicker, though, is that I think iPlanet is very clear
that Fusion, now iIS, is a very key product for them. There may be those
who wish it were written in Java and who might lobby for doing a Java
version, but it was clear at the conference that the iPlanet management
recognize that Java just isn't up to the task at this point. It isn't as
if all the iPlanet tools are actually written in Java, after all.
They will only support them for as long as they need.Or, more likely, for as long as they make money.
Now, in response to Microsofts .NET stratagy. We have yet to see how
succesfull this will be, but I expect Microsoft to push this down the
throats of developers and companies quite succesfully.Like they did DCOM?
=========================================================================
Thomas Mercer-Hursh, Ph.D email: [email protected]
Computing Integrity, Inc. sales: 510-233-9329
550 Casey Drive - Cypress Point support: 510-233-9327
Point Richmond, CA 94801-3751 fax: 510-233-6950 -
Error in deploying .jar file from JDeveloper 10.1.3.5
Hello,
I want to deploy .jar file in a machine, instead of having to install JDeveloper to run the application (it contains: Web Services and Data Base).
I have followed the following steps in JDeveloper to create the .jar file:
1) Right click over the project: New... --> General (All Technologies option selected) --> Deployment Profiles --> JAR File
2) I have selected "Include Manifest File" option specifying the application's main class
3) In JAR Deployment Profile Properties window: File Groups --> Project Output --> Contributors are selected: "Project Output Directory" and "Project Dependencies"
4) With the previous steps, JDeveloper generates a .deploy file. It is created in Resources folder. From this folder, I have selected the .deploy file and right click and I have selected "Deploy to JAR file"
The .jar is created succesfully. In this point, I try to execute with the command:
java -jar NAME_OF_THE_DIRECTORY_WHERE_THE FILEIS_DEPLOYED\NameFile.jar
and I have the following error:
Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/rpc/ServiceFactory
at project.proxy.AccountClient.<init><AccountClient.java>
at project.proxy.AccountClient.main<init><AccountClient.java>
The Manifest File content is:
Manifest-Version: 1.0
Created-By: Oracle JDeveloper 10.1.3.5.0
Main-Class: project.proxy.AccountClient
I have tested with differents variables to create the .jar file, but always the error is the same. And I haven't found information to solve it. For this reason, I appreciate any help.
Thank you and regards.
Edited by: user1634407 on 31-mar-2010 8:27
Edited by: user1634407 on 31-mar-2010 8:47If you are just building a client that access a Web service you need a JAR and not a WAR.
Ok!
One thing to try is look at the command line that JDeveloper uses to run your client (it's in the log window) - specifically look at the classpath used.
Then try and run the same thing from a command line and see if it works.
Nowadays, the application is running with a .BAT file, it contains the statement released from the JDeveloper console, and it is working perfectlly.
I try to do the same from a command line, and it works too.
Assuming it is - you can either use that, or you'll need to make sure that your JAR includes all the mentioned jars that were in the class path - this is done through the library type file group.
To create the .JAR file I have choosen the following options (JAR Deployment Profile Properties):
1) Include Manifest File --> I have selected the class that contains the main class (from the Browse option)
2) I left the default File Groups (Project Output) --> it has: Project Output Directory + Project Dependencies
3) As you said me, I have created a new File Group (type: Libraries) --> and here, I have selected all the possible Contributors. These match those specified in the project (Oracle XML Parser v2, J2EE, JAX-RPC Client, Commons Logging 1.0.3, Ojdbc14.jar).
4) Deployment to JAR File successfully.
The resulting MANIFEST.MF is:
Manifest-Version: 1.0
Created-By: Oracle JDeveloper 10.1.3.5.0
Main-Class: project.proxy.Execution
It hasn't definied "Class-Path", althought to especified a new File Group with the libraries... Is it an error?
If I extract the .JAR file, I see all libraries, and I have two folders: one with .class files of my project and other one is META-INF with MANIFEST.MF file.
5) From command line I executed:
C:\jdevstudio10135\jdk\bin > java -jar C:\jdevstudio10135\jdev\mywork\project\project\deploy\NameFile.jar
And the result is an error:
Exception in thread "main": java.lang.NoClassDefFoundError: javax/xml/rpc/ServiceFactory
I think the error is because it can not find the library ServiceFactory, but it is especified inside JAX-RPC Client library. What is wrong?
*6)* I have tried too to insert in "JAR Deployment Profile Properties" (in JAR options) an additional Manifest File to merge into MANIFEST.MF, to include "Class-Path" with all libraries's project (the same JAR from the statement released from the JDeveloper console), but I think that it is a limit, because if I insert all libraries the "Class-Path" doesn't inserted in MANIFEST.MF. The maxim is:
Class-Path: C:\jdevstudio10135\jdev\mywork\project\project\classes C:\jdevstudio10135\lib\xmlparserv2.jar C:\jdevstudio10135\lib\xml.jar C:\jdevstudio10135\j2ee\home\lib\activation.jar C:\jdevstudio10135\j2ee\home\lib\ejb.jar C:\jdevstudio10135\j2ee\home\lib\jms.jar C:\jdevstudio10135\j2ee\home\lib\jta.jar C:\jdevstudio10135\j2ee\home\lib\mail.jar C:\jdevstudio10135\j2ee\home\lib\servlet.jar C:\jdevstudio10135\webservices\lib\jaxrpc-api.jar
The following libraries afther the previous one aren't allowed to include because I think that is exceeding the maximum size.
I have tested to create various MANIFEST.MF with different PATHs libraries, but it isn't work to include in the MANIFEST.MF file all libraries...
(C:\jdevstudio10135\webservices\lib\wsclient.jar
C:\jdevstudio10135\webservices\lib\wsserver.jar
C:\jdevstudio10135\webservices\lib\wssecurity.jar
C:\jdevstudio10135\webservices\lib\wsdl.jar
C:\jdevstudio10135\webservices\lib\orasaaj.jar
C:\jdevstudio10135\webservices\lib\saaj-api.jar
C:\jdevstudio10135\webservices\lib\orawsdl.jar
C:\jdevstudio10135\webservices\lib\orawsrm.jar
C:\jdevstudio10135\webservices\lib\jaxr_api.jar
C:\jdevstudio10135\webservices\lib\orajaxr.jar
C:\jdevstudio10135\webservices\lib\relaxngDatatype.jar
C:\jdevstudio10135\webservices\lib\jaxb-impl.jar
C:\jdevstudio10135\webservices\lib\jaxb-libs.jar
C:\jdevstudio10135\webservices\lib\xsdlib.jar
C:\jdevstudio10135\webservices\lib\mdds.jar
C:\jdevstudio10135\jlib\jaxen.jar
C:\jdevstudio10135\jlib\oraclepki.jar
C:\jdevstudio10135\jlib\ojpse.jar
C:\jdevstudio10135\jlib\osdt_core.jar
C:\jdevstudio10135\jlib\osdt_cert.jar
C:\jdevstudio10135\jlib\osdt_xmlsec.jar
C:\jdevstudio10135\jlib\osdt_wss.jar
C:\jdevstudio10135\jlib\osdt_saml.jar
C:\jdevstudio10135\jlib\repository.jar
C:\jdevstudio10135\jlib\ojmisc.jar
C:\jdevstudio10135\j2ee\home\lib\http_client.jar
C:\jdevstudio10135\j2ee\home\jazncore.jar
C:\jdevstudio10135\j2ee\home\oc4jclient.jar
C:\jdevstudio10135\rdbms\jlib\xdb.jar
C:\jdevstudio10135\diagnostics\lib\ojdl2.jar
C:\jdevstudio10135\jakarta-taglibs\commons-logging-1.0.3\commons-logging-api.jar
C:\jdevstudio10135\jakarta-taglibs\commons-logging-1.0.3\commons-logging.jar
C:\oracle\product\10.2.0\client_1\jdbc\lib\ojdbc14.jar
C:\oracle\product\10.2.0\client_1\jdbc\lib\ojdbc14_g.jar
C:\oracle\product\10.2.0\client_1\jdbc\lib\ojdbc14dms.jar
C:\oracle\product\10.2.0\client_1\jdbc\lib\ojdbc14dms_g.jar)
With this .MF file (or including only "C:\jdevstudio10135\jdev\mywork\project\project\classes") I have solved the other problem (not found the libraries), but it still not working, the error is a little different:
Exception in thread "main": java.lang.NoClassDefFoundError: project/proxy/Execution
The path where the main class is: C:\jdevstudio10135\jdev\mywork\project\project\classes\project\proxy\Execution.class
I have tried to insert directlly the following paths in "Main Class" option of "Include Manifest File":
C:\jdevstudio10135\jdev\mywork\project\project\classes\project\proxy\Execution
C:\\jdevstudio10135\\jdev\\mywork\\project\\project\\classes\\project\\proxy\\Execution
And with these values, the error is the same: Exception in thread "main": java.lang.NoClassDefFoundError
I am not sure if the error is a bug of JDeveloper 10.1.3.5 or it is something that I don't correctly. Any idea?
Thank you again and regards.
Edited by: user12085357 on 08-abr-2010 1:31
Edited by: user12085357 on 08-abr-2010 1:38
Edited by: user12085357 on 08-abr-2010 6:58 -
Error while deploying a JAR-File into 8i !
Hello to all Oracle experts,
At the attempt to deploy a Jar file into the 8i the following
error message comes onto Shell level:
initialization complete
loading : com/sun/xml/tree/XmlDocumentBuilder
ORA-01536: space quota exceeded for tablespace 'PROCON_DATA'
Error while loading com/sun/xml/tree/XmlDocumentBuilder
ORA-06502: PL/SQL: numeric or value error
ORA-06512: at "SYS.DBMS_LOB", line 700
ORA-06512: at "PROCON.LOADLOBS", line 1
ORA-06512: at line 1
creating : com/sun/xml/tree/XmlDocumentBuilder
Error while creating class com/sun/xml/tree/XmlDocumentBuilder
ORA-29509: incorrectly formed Java binary class definition
The command was:
loadjava -user procon/procon@t2srv1:1521:PROCON -thin -verbose -schema PROCON xml_un.jar
It would please me if somebody has an idea to this error !
nullHi Olivier,
you could try the following approach:
1. Package your JAR files as J2EE Engine libraries and deploy them on it as described here: <a href="http://help.sap.com/saphelp_nw04/helpdata/en/9f/2ade3fc6c6ec06e10000000a1550b0/frameset.htm">Working with J2EE Libraries</a>.
2. Set reference to this library from the application that use them. Depending on your application, refer to the appropriate documentation:
-- reference from a J2EE app -> see <a href="http://help.sap.com/saphelp_nw04/helpdata/en/15/d5d93fe80fed06e10000000a1550b0/frameset.htm">Referencing Libraries in Applications</a>
-- reference from a portal app -> see <a href="http://help.sap.com/saphelp_nw04/helpdata/en/02/788540ae1dbb4de10000000a1550b0/frameset.htm">Referencing Elements</a>
Hope that helps! -
Hi,
I need some help.
Product=weblogic5.1.0
Revision=(Release Level)=
Problem Description=
I am doing cluster of weblogic server, I have no problem to set up the
cluster and to run servlet and EJB examples.
However, on my command line for startcluster I got a lot of message as
followed:
Fri Aug 18 11:31:44 EDT 2000:<E> <MulticastSocket> Multicast socket receive
error: java.lang.RuntimeException: I/O error opening JAR file from
file:/D:/weblogic/mycluster/server86/tmp_deployments/ejbjar-17327.jar
java.util.zip.ZipException: error in opening zip file
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java, Compiled Code)
at java.util.zip.ZipFile.<init>(ZipFile.java, Compiled Code)
at weblogic.boot.ServerClassLoader.deploy(ServerClassLoader.java,
Compiled Code)
at
weblogic.cluster.AnnotatedServiceOffer.expandClassPath(AnnotatedServiceOffer
.java, Compiled Code)
at
weblogic.cluster.AnnotatedServiceOffer.readObject(AnnotatedServiceOffer.java
, Compiled Code)
at
weblogic.common.internal.WLObjectInputStreamBase.readPublicSerializable(WLOb
jectInputStreamBase.java, Compiled Co
de)
at
weblogic.common.internal.WLObjectInputStreamBase.readLeftover(WLObjectInputS
treamBase.java, Compiled Code)
at
weblogic.common.internal.WLObjectInputStreamBase.readObjectBody(WLObjectInpu
tStreamBase.java, Compiled Code)
at
weblogic.common.internal.WLObjectInputStreamBase.readObject(WLObjectInputStr
eamBase.java, Compiled Code)
at
weblogic.common.internal.WLObjectInputStreamBase.readObjectWL(WLObjectInputS
treamBase.java, Compiled Code)
at
weblogic.common.internal.WLObjectInputStreamBase.readArrayList(WLObjectInput
StreamBase.java, Compiled Code)
at weblogic.cluster.StateDump.readObject(StateDump.java, Compiled
Code)
at
weblogic.common.internal.WLObjectInputStreamBase.readPublicSerializable(WLOb
jectInputStreamBase.java, Compiled Co
de)
at
weblogic.common.internal.WLObjectInputStreamBase.readLeftover(WLObjectInputS
treamBase.java, Compiled Code)
at
weblogic.common.internal.WLObjectInputStreamBase.readObjectBody(WLObjectInpu
tStreamBase.java, Compiled Code)
at
weblogic.common.internal.WLObjectInputStreamBase.readObject(WLObjectInputStr
eamBase.java, Compiled Code)
at
weblogic.common.internal.WLObjectInputStreamBase.readObjectWL(WLObjectInputS
treamBase.java, Compiled Code)
at weblogic.cluster.TMSocket.execute(TMSocket.java, Compiled Code)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled
Code)
The message freshed about every 20 seconds.
Another question, I used a iplanet web server as a proxy server with a
cluster of two weblogic servers pluged in, although I set
weblogic.properties to round-robin, however, when I run a fibonacci servlet,
it does not do the round-robin. It always go to one machine for a lot of
times. Any idea?
Thank you for your help.
Tom
May i presume that your cluster is configured on a shared file system?.
I have seen this problem only if you cluster is configured on different machines
and if the directory structure is not identical.
let us know..
Kumar
Cameron Purdy wrote:
> First, update to SP4 (or SP5 if it is out now). Second, follow the cluster
> instructions on setting up deployments for a cluster. The only
> implementation that I have used is the single shared location that all the
> servers load from.
>
> --
>
> Cameron Purdy
> http://www.tangosol.com
>
> "Tom Gan" <[email protected]> wrote in message
> news:[email protected]...
> > Hi,
> > I need some help.
> >
> > Product=weblogic5.1.0
> > Revision=(Release Level)=
> > Problem Description=
> > I am doing cluster of weblogic server, I have no problem to set up the
> > cluster and to run servlet and EJB examples.
> > However, on my command line for startcluster I got a lot of message as
> > followed:
> > Fri Aug 18 11:31:44 EDT 2000:<E> <MulticastSocket> Multicast socket
> receive
> > error: java.lang.RuntimeException: I/O error opening JAR file from
> > file:/D:/weblogic/mycluster/server86/tmp_deployments/ejbjar-17327.jar
> > java.util.zip.ZipException: error in opening zip file
> > at java.util.zip.ZipFile.open(Native Method)
> > at java.util.zip.ZipFile.<init>(ZipFile.java, Compiled Code)
> > at java.util.zip.ZipFile.<init>(ZipFile.java, Compiled Code)
> > at weblogic.boot.ServerClassLoader.deploy(ServerClassLoader.java,
> > Compiled Code)
> > at
> >
> weblogic.cluster.AnnotatedServiceOffer.expandClassPath(AnnotatedServiceOffer
> > .java, Compiled Code)
> > at
> >
> weblogic.cluster.AnnotatedServiceOffer.readObject(AnnotatedServiceOffer.java
> > , Compiled Code)
> > at
> >
> weblogic.common.internal.WLObjectInputStreamBase.readPublicSerializable(WLOb
> > jectInputStreamBase.java, Compiled Co
> > de)
> > at
> >
> weblogic.common.internal.WLObjectInputStreamBase.readLeftover(WLObjectInputS
> > treamBase.java, Compiled Code)
> > at
> >
> weblogic.common.internal.WLObjectInputStreamBase.readObjectBody(WLObjectInpu
> > tStreamBase.java, Compiled Code)
> > at
> >
> weblogic.common.internal.WLObjectInputStreamBase.readObject(WLObjectInputStr
> > eamBase.java, Compiled Code)
> > at
> >
> weblogic.common.internal.WLObjectInputStreamBase.readObjectWL(WLObjectInputS
> > treamBase.java, Compiled Code)
> > at
> >
> weblogic.common.internal.WLObjectInputStreamBase.readArrayList(WLObjectInput
> > StreamBase.java, Compiled Code)
> > at weblogic.cluster.StateDump.readObject(StateDump.java, Compiled
> > Code)
> > at
> >
> weblogic.common.internal.WLObjectInputStreamBase.readPublicSerializable(WLOb
> > jectInputStreamBase.java, Compiled Co
> > de)
> > at
> >
> weblogic.common.internal.WLObjectInputStreamBase.readLeftover(WLObjectInputS
> > treamBase.java, Compiled Code)
> > at
> >
> weblogic.common.internal.WLObjectInputStreamBase.readObjectBody(WLObjectInpu
> > tStreamBase.java, Compiled Code)
> > at
> >
> weblogic.common.internal.WLObjectInputStreamBase.readObject(WLObjectInputStr
> > eamBase.java, Compiled Code)
> > at
> >
> weblogic.common.internal.WLObjectInputStreamBase.readObjectWL(WLObjectInputS
> > treamBase.java, Compiled Code)
> > at weblogic.cluster.TMSocket.execute(TMSocket.java, Compiled Code)
> > at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled
> > Code)
> >
> > The message freshed about every 20 seconds.
> >
> > Another question, I used a iplanet web server as a proxy server with a
> > cluster of two weblogic servers pluged in, although I set
> > weblogic.properties to round-robin, however, when I run a fibonacci
> servlet,
> > it does not do the round-robin. It always go to one machine for a lot of
> > times. Any idea?
> > Thank you for your help.
> > Tom
> >
> >
> >
-
Hi,
I need some help.
Product=weblogic5.1.0
Revision=(Release Level)=
Problem Description=
I am doing cluster of weblogic server, I have no problem to set up the
cluster and to run servlet and EJB examples.
However, on my command line for startcluster I got a lot of message as
followed:
Fri Aug 18 11:31:44 EDT 2000:<E> <MulticastSocket> Multicast socket receive
error: java.lang.RuntimeException: I/O error ope
ning JAR file from
file:/D:/weblogic/mycluster/server86/tmp_deployments/ejbjar-17327.jar
java.util.zip.ZipException: error in opening zip file
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java, Compiled Code)
at java.util.zip.ZipFile.<init>(ZipFile.java, Compiled Code)
at weblogic.boot.ServerClassLoader.deploy(ServerClassLoader.java,
Compiled Code)
at
weblogic.cluster.AnnotatedServiceOffer.expandClassPath(AnnotatedServiceOffer
.java, Compiled Code)
at
weblogic.cluster.AnnotatedServiceOffer.readObject(AnnotatedServiceOffer.java
, Compiled Code)
at
weblogic.common.internal.WLObjectInputStreamBase.readPublicSerializable(WLOb
jectInputStreamBase.java, Compiled Co
de)
at
weblogic.common.internal.WLObjectInputStreamBase.readLeftover(WLObjectInputS
treamBase.java, Compiled Code)
at
weblogic.common.internal.WLObjectInputStreamBase.readObjectBody(WLObjectInpu
tStreamBase.java, Compiled Code)
at
weblogic.common.internal.WLObjectInputStreamBase.readObject(WLObjectInputStr
eamBase.java, Compiled Code)
at
weblogic.common.internal.WLObjectInputStreamBase.readObjectWL(WLObjectInputS
treamBase.java, Compiled Code)
at
weblogic.common.internal.WLObjectInputStreamBase.readArrayList(WLObjectInput
StreamBase.java, Compiled Code)
at weblogic.cluster.StateDump.readObject(StateDump.java, Compiled
Code)
at
weblogic.common.internal.WLObjectInputStreamBase.readPublicSerializable(WLOb
jectInputStreamBase.java, Compiled Co
de)
at
weblogic.common.internal.WLObjectInputStreamBase.readLeftover(WLObjectInputS
treamBase.java, Compiled Code)
at
weblogic.common.internal.WLObjectInputStreamBase.readObjectBody(WLObjectInpu
tStreamBase.java, Compiled Code)
at
weblogic.common.internal.WLObjectInputStreamBase.readObject(WLObjectInputStr
eamBase.java, Compiled Code)
at
weblogic.common.internal.WLObjectInputStreamBase.readObjectWL(WLObjectInputS
treamBase.java, Compiled Code)
at weblogic.cluster.TMSocket.execute(TMSocket.java, Compiled Code)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled
Code)
The message freshed about every 20 seconds.
Another question, I used a iplanet web server as a proxy server with a
cluster of two weblogic servers pluged in, although I set
weblogic.properties to round-robin, however, when I run a fibonacci servlet,
it does not do the round-robin. It always go to one machine for a lot of
times. Any idea?
Thank you for your help.
TomHi,
I need some help.
Product=weblogic5.1.0
Revision=(Release Level)=
Problem Description=
I am doing cluster of weblogic server, I have no problem to set up the
cluster and to run servlet and EJB examples.
However, on my command line for startcluster I got a lot of message as
followed:
Fri Aug 18 11:31:44 EDT 2000:<E> <MulticastSocket> Multicast socket receive
error: java.lang.RuntimeException: I/O error ope
ning JAR file from
file:/D:/weblogic/mycluster/server86/tmp_deployments/ejbjar-17327.jar
java.util.zip.ZipException: error in opening zip file
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java, Compiled Code)
at java.util.zip.ZipFile.<init>(ZipFile.java, Compiled Code)
at weblogic.boot.ServerClassLoader.deploy(ServerClassLoader.java,
Compiled Code)
at
weblogic.cluster.AnnotatedServiceOffer.expandClassPath(AnnotatedServiceOffer
.java, Compiled Code)
at
weblogic.cluster.AnnotatedServiceOffer.readObject(AnnotatedServiceOffer.java
, Compiled Code)
at
weblogic.common.internal.WLObjectInputStreamBase.readPublicSerializable(WLOb
jectInputStreamBase.java, Compiled Co
de)
at
weblogic.common.internal.WLObjectInputStreamBase.readLeftover(WLObjectInputS
treamBase.java, Compiled Code)
at
weblogic.common.internal.WLObjectInputStreamBase.readObjectBody(WLObjectInpu
tStreamBase.java, Compiled Code)
at
weblogic.common.internal.WLObjectInputStreamBase.readObject(WLObjectInputStr
eamBase.java, Compiled Code)
at
weblogic.common.internal.WLObjectInputStreamBase.readObjectWL(WLObjectInputS
treamBase.java, Compiled Code)
at
weblogic.common.internal.WLObjectInputStreamBase.readArrayList(WLObjectInput
StreamBase.java, Compiled Code)
at weblogic.cluster.StateDump.readObject(StateDump.java, Compiled
Code)
at
weblogic.common.internal.WLObjectInputStreamBase.readPublicSerializable(WLOb
jectInputStreamBase.java, Compiled Co
de)
at
weblogic.common.internal.WLObjectInputStreamBase.readLeftover(WLObjectInputS
treamBase.java, Compiled Code)
at
weblogic.common.internal.WLObjectInputStreamBase.readObjectBody(WLObjectInpu
tStreamBase.java, Compiled Code)
at
weblogic.common.internal.WLObjectInputStreamBase.readObject(WLObjectInputStr
eamBase.java, Compiled Code)
at
weblogic.common.internal.WLObjectInputStreamBase.readObjectWL(WLObjectInputS
treamBase.java, Compiled Code)
at weblogic.cluster.TMSocket.execute(TMSocket.java, Compiled Code)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled
Code)
The message freshed about every 20 seconds.
Another question, I used a iplanet web server as a proxy server with a
cluster of two weblogic servers pluged in, although I set
weblogic.properties to round-robin, however, when I run a fibonacci servlet,
it does not do the round-robin. It always go to one machine for a lot of
times. Any idea?
Thank you for your help.
Tom -
Error while deploying a PAR file from NWDS into an ECC.
Hi all,
I am getting this error while deploying a PAR file from NWDS into an ECC.
Operation Failed: Please make sure the server is running or check the log (sap-plugin.log) for
more detail.
My server is running properly
1 - Where is sap-plugin.log file? I don´t find it.
2 - Could there be another file with another name with information about the error?
3 - Is there another way to deploy the file directly from the ECC?
Regards,Hi,
Just make sure you have maintained correct server setting to check the same open the NWDS and follow this path
Windows/ Prefereces / SAP Enterprise Portal
Check the following enteries
Alias
Host
Port
Login etc.
Regards, -
Unable to deploy a par file from NWDS
Hi experts ,
Im getting the below error on deploying a par file from my nwds studio ,
please suggest a solution
createDeployArchive:
[copy] Copying 1 file to E:\sap_ep_prog\dc\.dtc\1\DCs\***\portal_dev\***_logon\_comp\gen\default\local
Error: E:\sap_ep_prog\dc\.dtc\1\DCs\***\portal_dev\***_logon\_comp\gen\default\logs\build.xml:341: Failed to copy E:\sap_ep_prog\dc\.dtc\1\t\7FEDA11250B7CF9AB991A30B09B76536\com.***.par to E:\sap_ep_prog\dc\.dtc\1\DCs\***\portal_dev\***_logon\_comp\gen\default\local\com.***.par due to E:\sap_ep_prog\dc\.dtc\1\DCs\***\portal_dev\***_logon\_comp\gen\default\local\com.***.par (Access is denied)
at org.apache.tools.ant.taskdefs.Copy.doFileOperations(Copy.java:628)
at org.apache.tools.ant.taskdefs.Copy.execute(Copy.java:421)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
at org.apache.tools.ant.Task.perform(Task.java:364)
at org.apache.tools.ant.Target.execute(Target.java:341)
at org.apache.tools.ant.Target.performTasks(Target.java:369)
at org.apache.tools.ant.Project.executeTarget(Project.java:1214)
at com.sap.tc.buildplugin.techdev.ant.util.AntRunner.run(AntRunner.java:116)
at com.sap.tc.buildplugin.DefaultAntBuildAction.execute(DefaultAntBuildAction.java:58)
at com.sap.tc.buildplugin.DefaultPlugin.handleBuildStepSequence(DefaultPlugin.java:196)
at com.sap.tc.buildplugin.DefaultPlugin.performBuild(DefaultPlugin.java:168)
at com.sap.tc.buildplugin.DefaultPluginV3Delegate$BuildRequestHandler.handle(DefaultPluginV3Delegate.java:66)
at com.sap.tc.buildplugin.DefaultPluginV3Delegate.requestV3(DefaultPluginV3Delegate.java:48)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.sap.tc.buildtool.v2.impl.PluginHandler2.maybeInvoke(PluginHandler2.java:350)
at com.sap.tc.buildtool.v2.impl.PluginHandler2.request(PluginHandler2.java:99)
at com.sap.tc.buildtool.v2.impl.PluginHandler2.build(PluginHandler2.java:73)
at com.sap.tc.buildtool.PluginHandler2Wrapper.execute(PluginHandler2Wrapper.java:59)
at com.sap.tc.devconf.impl.DCProxy.make(DCProxy.java:1750)
at com.sap.tc.devconf.impl.DCProxy.make(DCProxy.java:6004)
at com.sap.portal.developmentTools.ideSpecific.eclipse.dcutils.DCBuildWrapper.run(DCBuildWrapper.java:49)
at com.sap.portal.developmentTools.ideSpecific.eclipse.wizards.sapmakepar.SAPMPWizard$1.run(SAPMPWizard.java:252)
at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:302)
at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:252)
at org.eclipse.jface.wizard.WizardDialog.run(WizardDialog.java:758)
at com.sap.portal.developmentTools.ideSpecific.eclipse.wizards.sapmakepar.SAPMPWizard.performFinish(SAPMPWizard.java:531)
at org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDialog.java:608)
at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:321)
at org.eclipse.jface.dialogs.Dialog$1.widgetSelected(Dialog.java:423)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:89)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:81)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:840)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:2022)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1729)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:583)
at org.eclipse.jface.window.Window.open(Window.java:563)
at com.sap.portal.developmentTools.ideSpecific.eclipse.wizards.actions.WizardInvokeAction.invokeWizardInANewDialog(WizardInvokeAction.java:179)
at com.sap.portal.developmentTools.ideSpecific.eclipse.wizards.actions.WizardInvokeAction.run(WizardInvokeAction.java:84)
at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:251)
at org.eclipse.ui.internal.WWinPluginAction.runWithEvent(WWinPluginAction.java:207)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:456)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent(ActionContributionItem.java:403)
at org.eclipse.jface.action.ActionContributionItem.access$0(ActionContributionItem.java:397)
at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent(ActionContributionItem.java:72)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:81)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:840)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:2022)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1729)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1402)
at org.eclipse.ui.internal.Workbench.run(Workbench.java:1385)
at com.tssap.util.startup.WBLauncher.run(WBLauncher.java:79)
at org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoader.java:858)
at org.eclipse.core.boot.BootLoader.run(BootLoader.java:461)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.sap.ide.eclipse.startup.Main.basicRun(Main.java:291)
at com.sap.ide.eclipse.startup.Main.run(Main.java:789)
at com.sap.ide.eclipse.startup.Main.main(Main.java:607)
Caused by: java.io.FileNotFoundException: E:\sap_ep_prog\dc\.dtc\1\DCs\***\portal_dev\***_logon\_comp\gen\default\local\com.***.par (Access is denied)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.java:179)
at java.io.FileOutputStream.<init>(FileOutputStream.java:131)
at org.apache.tools.ant.util.FileUtils.copyFile(FileUtils.java:628)
at org.apache.tools.ant.util.FileUtils.copyFile(FileUtils.java:309)
at org.apache.tools.ant.taskdefs.Copy.doFileOperations(Copy.java:617)
... 62 more
--- Nested Exception ---
java.io.FileNotFoundException: E:\sap_ep_prog\dc\.dtc\1\DCs\***\portal_dev\***_logon\_comp\gen\default\local\com.***.par (Access is denied)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.java:179)
at java.io.FileOutputStream.<init>(FileOutputStream.java:131)
at org.apache.tools.ant.util.FileUtils.copyFile(FileUtils.java:628)
at org.apache.tools.ant.util.FileUtils.copyFile(FileUtils.java:309)
at org.apache.tools.ant.taskdefs.Copy.doFileOperations(Copy.java:617)
at org.apache.tools.ant.taskdefs.Copy.execute(Copy.java:421)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
at org.apache.tools.ant.Task.perform(Task.java:364)
at org.apache.tools.ant.Target.execute(Target.java:341)
at org.apache.tools.ant.Target.performTasks(Target.java:369)
at org.apache.tools.ant.Project.executeTarget(Project.java:1214)
at com.sap.tc.buildplugin.techdev.ant.util.AntRunner.run(AntRunner.java:116)
at com.sap.tc.buildplugin.DefaultAntBuildAction.execute(DefaultAntBuildAction.java:58)
at com.sap.tc.buildplugin.DefaultPlugin.handleBuildStepSequence(DefaultPlugin.java:196)
at com.sap.tc.buildplugin.DefaultPlugin.performBuild(DefaultPlugin.java:168)
at com.sap.tc.buildplugin.DefaultPluginV3Delegate$BuildRequestHandler.handle(DefaultPluginV3Delegate.java:66)
at com.sap.tc.buildplugin.DefaultPluginV3Delegate.requestV3(DefaultPluginV3Delegate.java:48)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.sap.tc.buildtool.v2.impl.PluginHandler2.maybeInvoke(PluginHandler2.java:350)
at com.sap.tc.buildtool.v2.impl.PluginHandler2.request(PluginHandler2.java:99)
at com.sap.tc.buildtool.v2.impl.PluginHandler2.build(PluginHandler2.java:73)
at com.sap.tc.buildtool.PluginHandler2Wrapper.execute(PluginHandler2Wrapper.java:59)
at com.sap.tc.devconf.impl.DCProxy.make(DCProxy.java:1750)
at com.sap.tc.devconf.impl.DCProxy.make(DCProxy.java:6004)
at com.sap.portal.developmentTools.ideSpecific.eclipse.dcutils.DCBuildWrapper.run(DCBuildWrapper.java:49)
at com.sap.portal.developmentTools.ideSpecific.eclipse.wizards.sapmakepar.SAPMPWizard$1.run(SAPMPWizard.java:252)
at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:302)
at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:252)
at org.eclipse.jface.wizard.WizardDialog.run(WizardDialog.java:758)
at com.sap.portal.developmentTools.ideSpecific.eclipse.wizards.sapmakepar.SAPMPWizard.performFinish(SAPMPWizard.java:531)
at org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDialog.java:608)
at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:321)
at org.eclipse.jface.dialogs.Dialog$1.widgetSelected(Dialog.java:423)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:89)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:81)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:840)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:2022)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1729)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:583)
at org.eclipse.jface.window.Window.open(Window.java:563)
at com.sap.portal.developmentTools.ideSpecific.eclipse.wizards.actions.WizardInvokeAction.invokeWizardInANewDialog(WizardInvokeAction.java:179)
at com.sap.portal.developmentTools.ideSpecific.eclipse.wizards.actions.WizardInvokeAction.run(WizardInvokeAction.java:84)
at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:251)
at org.eclipse.ui.internal.WWinPluginAction.runWithEvent(WWinPluginAction.java:207)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:456)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent(ActionContributionItem.java:403)
at org.eclipse.jface.action.ActionContributionItem.access$0(ActionContributionItem.java:397)
at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent(ActionContributionItem.java:72)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:81)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:840)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:2022)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1729)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1402)
at org.eclipse.ui.internal.Workbench.run(Workbench.java:1385)
at com.tssap.util.startup.WBLauncher.run(WBLauncher.java:79)
at org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoader.java:858)
at org.eclipse.core.boot.BootLoader.run(BootLoader.java:461)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.sap.ide.eclipse.startup.Main.basicRun(Main.java:291)
at com.sap.ide.eclipse.startup.Main.run(Main.java:789)
at com.sap.ide.eclipse.startup.Main.main(Main.java:607)
Ant runtime 8.863 seconds
Ant build finished with ERRORS
Failed to copy E:\sap_ep_prog\dc\.dtc\1\t\7FEDA11250B7CF9AB991A30B09B76536\com.***.par to E:\sap_ep_prog\dc\.dtc\1\DCs\***\portal_dev\***_logon\_comp\gen\default\local\com.***.par due to E:\sap_ep_prog\dc\.dtc\1\DCs\***\portal_dev\***_logon\_comp\gen\default\local\com.***.par (Access is denied)
Error: Build stopped due to an error: Failed to copy E:\sap_ep_prog\dc\.dtc\1\t\7FEDA11250B7CF9AB991A30B09B76536\com.***.par to E:\sap_ep_prog\dc\.dtc\1\DCs\***\portal_dev\***_logon\_comp\gen\default\local\com.***.par due to E:\sap_ep_prog\dc\.dtc\1\DCs\***\portal_dev\***_logon\_comp\gen\default\local\com.***.par (Access is denied)
Build plugin finished at 2014-07-15 18:36:07 GMT+05:30 (IST)
Total build plugin runtime: 9.113 seconds
Build finished with ERROR
Regards
GovardanHi Talviv ,
The folder where Par file is residing has read only property i.e
gen->local .
but we should not change this property of a DC folder i guess , im getting this error sometimes and some times im able to deploy with out any error.
Regards
Govardan -
Can't run JavaFX app as a jar file from command line
I'm trying to build a JavaFX app from scratch (that is, by including the jar file from the JavaFX SDK rather than by using the special JavaFX project type from NetBeans). It runs fine in NetBeans. However, when I try to launch it as a jar file from the command line (using "java -jar dist\TestApp") I get the following. Has anybody seen this before, and if so how can I fix it?:
*** Fallback to Prism SW pipeline
Exception in thread "main" java.lang.RuntimeException: java.lang.UnsatisfiedLink
Error: Can't load library: C:\dev\TestApp\dist\bin\mat.dll
at com.sun.javafx.tk.quantum.QuantumToolkit.startup(QuantumToolkit.java:
289)
at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:68)
at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherIm
pl.java:145)
at com.sun.javafx.application.LauncherImpl.access$000(LauncherImpl.java:
27)
at com.sun.javafx.application.LauncherImpl$1.run(LauncherImpl.java:97)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.UnsatisfiedLinkError: Can't load library: C:\dev\RedactionT
oolPrototype\RedactionToolPrototype.Core\dist\bin\mat.dll
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.load0(Unknown Source)
at java.lang.System.load(Unknown Source)
at com.sun.glass.utils.NativeLibLoader.loadLibraryFullPath(NativeLibLoad
er.java:155)
at com.sun.glass.utils.NativeLibLoader.loadLibraryInternal(NativeLibLoad
er.java:85)
at com.sun.glass.utils.NativeLibLoader.loadLibrary(NativeLibLoader.java:
30)
at com.sun.glass.ui.Application$1.run(Application.java:28)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.glass.ui.Application.loadNativeLibrary(Application.java:26)
at com.sun.glass.ui.win.WinApplication.<clinit>(WinApplication.java:33)
at com.sun.glass.ui.win.WinPlatformFactory.createApplication(WinPlatform
Factory.java:20)
at com.sun.glass.ui.win.WinPlatformFactory.createApplication(WinPlatform
Factory.java:17)
at com.sun.glass.ui.Application.Run(Application.java:51)
at com.sun.javafx.tk.quantum.QuantumToolkit.startup(QuantumToolkit.java:
279)
... 5 moreUnsatisfied link means that Java is trying to access a native library, but it cannot be found. As to why this error is being thrown, here is my guess:
If you open up one of the sample jars with a zip viewer, you will see that the Manifest file has the following entries:
>
Manifest-Version: 1.0
JavaFX-Version: 2.0
implementation-vendor: Oracle
implementation-title: BrickBreaker
implementation-version: 1.0
JavaFX-Application-Class: brickbreaker.Main
Created-By: JavaFX Packager
Main-Class: com/javafx/main/Main
>
In other words, a JavaFX project works a bit differently than a normal Java project. com/javafx/main/Main is used as the Main class and your "Main" class is called later.
If you are trying to build this from a normal Java project, then com/javafx/main/Main will not be created and it will call your Main class right away. Thus, whatever setup is needed to run JavaFX will not occur. -
Multiple jar files from different locations
Hello,
I am having an applet that access code from two different jar files. Of them one is a common jar file for many applets. So I couldn't place it in the local dir as that of the applet's html. I am not using any web server.
Just to give you a feel of it :
<PARAM NAME = archive VALUE = "DVApplet.jar,DVVP.jar" > are the jar files my applet is dependant on. But DVVP.jar has to be accessed from a dir different from local dir.
Will be glad if someone can throw some light on accessing different jar files from different dirs.
Thanks for your time.
Regards,
Anantha[url=
http://forum.java.sun.com/thread.jsp?forum=421&thread=425724&tstart=0&trange=100
]This question is a bit similar
You can use a class loader to do such things. -
How to call a jar file from oracle forms (6i)
Hi,
I'm working with oracle 6i. I want to know that how to call a .jar file from forms menu. when I use HOST('<path>\test.jar') it is working in 'Client Server' any way. but the problem is I use application server in order to run my form. so my form is in the server and I run the form via clients web browser. in that case above solution will not work. if any body knows how to overcome this problem please reply.
thanks.
dumindaI created a bean area and set the class name as implementation class. within that java bean class I called to a bat file which consists of the execution command of the jar file ( because i don't know how to call .jar file from my bean class directly).
then i tried to run it in application server. its still not running.
can you tell me what i have to do within my bean class? or can you suggest any solution?
thank you. -
How to call a .jar file from a java bean?
any body knows how to call a .jar file from a java bean?
Crosspost!
http://forum.java.sun.com/thread.jspa?messageID=4349619 -
Error during deploying mapbuilder.jar file in oracle application server
hi all,
Iam trying to deploy mapbuilder.jar file in oracle 10g enterprise manager oc4j environment. It is giving an error that
" An error occurred when processing the data submitted. Find the appropriate field and enter the correct information as noted next to each field.
Archive Location - Failed in uploading archive. Invalid archive file: Unsupported archive type. unknown'
i have deployed in the same way for mapviewer.ear. It was successfully deployed.
plz any body tell me what would be the reason. I there any other way to deploying .jar file in oracle 10g enterprise manager
thnx in advance...
Regards,
srinivasHi Srinivas,
There is no need to deploy MapBuilder in an Application Server. You can start it at the command line with for example:
java -jar mapbuilder.jar -noconnect
Joao -
Running a jar file from java code
Hi!
Im trying to run a jar file from my code.
I've tried Classloader, but that doesnt work because it doesnt find the images (also embedded in the 2nd jar file).
WHat I would like to do is actually RUN the 2nd jar file from the first jar file. There must be a way to do this right?
any ideas?ok, I found some wonderful code (see below) that will try to start the jar. But it doesn't. What it does is produce the following error when my application runs...
So it's not finding the images in the jar file that I am trying to run? Strange. I checked the URL that sending, but it seems ok....
I think I will check the url again to make sure......
any ideas?
Uncaught error fetching image:
java.lang.NullPointerException
at sun.awt.image.URLImageSource.getConnection(Unknown Source)
at sun.awt.image.URLImageSource.getDecoder(Unknown Source)
at sun.awt.image.InputStreamImageSource.doFetch(Unknown Source)
at sun.awt.image.ImageFetcher.fetchloop(Unknown Source)
at sun.awt.image.ImageFetcher.run(Unknown Source)
the code....
/* From http://java.sun.com/docs/books/tutorial/index.html */
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.net.JarURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.jar.Attributes;
* Runs a jar application from any url. Usage is 'java JarRunner url [args..]'
* where url is the url of the jar file and args is optional arguments to be
* passed to the application's main method.
public class JarRunner {
public static void main(String[] args) {
URL url = null;
try {
url = new URL(args[0]);//"VideoTagger.jar");
} catch (MalformedURLException e) {
System.out.println("Invalid URL: ");
// Create the class loader for the application jar file
JarClassLoader cl = new JarClassLoader(url);
// Get the application's main class name
String name = null;
try {
name = cl.getMainClassName();
} catch (IOException e) {
System.err.println("I/O error while loading JAR file:");
e.printStackTrace();
System.exit(1);
if (name == null) {
fatal("Specified jar file does not contain a 'Main-Class'"
+ " manifest attribute");
// Get arguments for the application
String[] newArgs = new String[args.length - 1];
System.arraycopy(args, 1, newArgs, 0, newArgs.length);
// Invoke application's main class
try {
cl.invokeClass(name, newArgs);
} catch (ClassNotFoundException e) {
fatal("Class not found: " + name);
} catch (NoSuchMethodException e) {
fatal("Class does not define a 'main' method: " + name);
} catch (InvocationTargetException e) {
e.getTargetException().printStackTrace();
System.exit(1);
private static void fatal(String s) {
System.err.println(s);
System.exit(1);
* A class loader for loading jar files, both local and remote.
class JarClassLoader extends URLClassLoader {
private URL url;
* Creates a new JarClassLoader for the specified url.
* @param url
* the url of the jar file
public JarClassLoader(URL url) {
super(new URL[] { url });
this.url = url;
* Returns the name of the jar file main class, or null if no "Main-Class"
* manifest attributes was defined.
public String getMainClassName() throws IOException {
URL u = new URL("jar", "", url + "!/");
JarURLConnection uc = (JarURLConnection) u.openConnection();
Attributes attr = uc.getMainAttributes();
return attr != null ? attr.getValue(Attributes.Name.MAIN_CLASS) : null;
* Invokes the application in this jar file given the name of the main class
* and an array of arguments. The class must define a static method "main"
* which takes an array of String arguemtns and is of return type "void".
* @param name
* the name of the main class
* @param args
* the arguments for the application
* @exception ClassNotFoundException
* if the specified class could not be found
* @exception NoSuchMethodException
* if the specified class does not contain a "main" method
* @exception InvocationTargetException
* if the application raised an exception
public void invokeClass(String name, String[] args)
throws ClassNotFoundException, NoSuchMethodException,
InvocationTargetException {
Class c = loadClass(name);
Method m = c.getMethod("main", new Class[] { args.getClass() });
m.setAccessible(true);
int mods = m.getModifiers();
if (m.getReturnType() != void.class || !Modifier.isStatic(mods)
|| !Modifier.isPublic(mods)) {
throw new NoSuchMethodException("main");
try {
m.invoke(null, new Object[] { args });
} catch (IllegalAccessException e) {
// This should not happen, as we have disabled access checks
} -
Access jar file from in-memory classes...
I have some classes that I compile to memory and everything works fine until one class that must access some external jar files. I have been unable to access those jar files from disk after trying every suggestion using URLClassLoader. I even tried someone's example to hack the SystemClassLoader which properly adds the jar file paths, but still they can't be seen. The only way it works is if I put the files in the jdk/jre/lib/ext directory. Then everything works fine. There must be a way to load the jar files in memory as well as the class files so they can be accessible. Has anyone done anything like this? Is it possible? Even though the class files are in memory, why would the jar files not be seen even when they are added to the same URLClassLoader's URL's. Thanks.
Sorry that wasn't clear. What I mean is that the classes are compiled to byte code directly to memory and no physical .class file is created. Yes, I'm using my own ClassLoader that extends URLClassLoader and I'm setting the parent to ClassLoader.getSystemClassLoader(). I also should mention that I'm doing this inside a Netbeans module that is part of a Netbeans Platform application. I don't know why that should matter though, since I'm trying to do everything in memory without creating the physical files. Thanks.
Maybe you are looking for
-
anyone had trouble syncing a bluetooth headset to an ipod nano 7th gen ? I was able to sync to my iphone6 , but no luck with the ipod, even after a reset & several attempts
-
How to get value and name of the n'th parameter in a pl/sql funct./proced.
procedure test(name varchar2, birthdate date, zip number, country varchar2); in procedure x I do test('Michael Postmann', to_date('03.01.1983', 'DD.MM.YYYY'), 7461, 'AUSTRIA'); And this should htp.print the following: test: name=Michael Postmann,birt
-
Mass extention of service entry sheet condition record validity date
Hi all, I have immediate requirement. i need to extend the validity date for condition record related to the Service entry sheet. This has to done mass sheet changes. I am looking for Any bapi or Standard function module or any config chan
-
Does the iWeb gallery have a 500 photo limit?
I know I'll have to find another server for my websites, but iWeb currently will NOT take any additional photos for my Moth Field Guide (http://web.me.com/rwolfert/NJNatureNotesWebsite/Moth_Field_Guide.htm). I'm at 500 and that seems to be it! With t
-
Flash Player 10 causing a Google Analytics Admin Problem
Since I upgraded to Flash Play 10, inside the admin of Google Analytics is not working. When I log in to Google Analytics, Flash Play 10 is a part of adjusting the dates and it is causing some type of error that I can't figure out. All I want to do