Loading jars with same class loader

Hi all,
I need to tell Weblogic to load various jars using same class loader.
"various jars" means jars that belong to different web applications. (weblogic 10)
Is that possible ?
PS: I can not change jar location, e.g. put them in common directory or so.

Hi,
If you don't want to change the JAR Locations then you can try the following..
Option1). Add the Jar Location with the Jar file name in the Server classpath...of your server startScript (like startWebLogic.sh)
CLASSPATH=${CLASSPATH}:/opt/app/myJars/first.jar:/opt/app/myJars/second.jar:
But in this case the Jars which are there in the classpath...will be loaded using System Classloaders and will be different from Application Classloaders...but the Classes belonging to these Jars will be available to your applications because final classpath will be the Summation of following:
Final Classpath = Bootstrap classloader (+) System ClassLoader (including Extended Classpath from Domain Lib) (+) Application ClassLoader (+) AppModule ClassLoader
Option2). If you dont want to add the Jars in the Server ClassPath then u can use "Optional Package" deployment feature provided by WebLogic...In this case you can deploy the JARs in WebLogic Server as Optional Packages from the Same Location where it is at present...(as you dont want to change the Jar locations) like following: http://jaysensharma.wordpress.com/2009/12/06/optional-packages/
Thanks
Jay SenSharma

Similar Messages

  • 2 Jars with same class name. NoSuchMethod. Can't change classpath

    I have overloaded a method in a class that came with an openSource package.
    Things were fine until I implemented my components in a new version of the Server application; when I discovered that the it uses the same openSource package bundled in its classpath.
    This results into a NoSuchMethod exception since I have overloaded the method with new argument types.
    1. I cannot remove or shuffle this JAR from the Server's classpath, since that would stop something else.
    2. I cannot change my code since it is implemented in a lot of places.
    Has anyone called a specific method of a jar? like E.g. "someJar.jar".SomeClass.someMethod (arg);
    If yes how?
    The above code is not possible syntactically, but I have put it for ease in interpreting the problem.
    Any input will be appreciated.
    NOTE: I cannot disclose the names of products for company policy issues.

    Just some ideas...
    1. I cannot remove or shuffle this JAR from the
    Server's classpath, since that would stop something
    else.Some servers allow for multiple classpaths - i.e. you can separately specify the classpath that the server itself uses from the one that your hosted applications will be using.
    Also, if your changes to the openSource code are only the addition of an overloaded method, why couldn't you just substitute your jar for the one the server is using, why would that break the server?
    2. I cannot change my code since it is implemented in
    a lot of places.That sounds lame. You can't do a global replace? How about just changing the package name?
    Has anyone called a specific method of a jar? like
    E.g. "someJar.jar".SomeClass.someMethod (arg);
    If yes how?Yes, but it's not as simple as your pseudo-code...
    You can use URLClassLoader to load a specific class from a specific jar file URL, and then use reflection to get the method you want from it, and then call it.
    good luck
    j

  • Class.forname - Unable to load class if two jars with same package name

    class.forname - Unable to load class if two jars contains same package name exists in classpath.
    JVM is stopping search for class one it finds the package name in the jar file that is ahead in classpath,
    JVM is not continuing search in the remaining jar files.
    For this , I put the jar file that contained class ahead of of ther jar file containing same package name, then it worked.
    Is this a JVM bug ? (JDK 1.5)

    I reported as bug to sun. I got auto email, looks they have not assigned any Bug ID so far.

  • How to create a Jar with only class files?

    Dear all,
    I want to create a jar file with only classes.My class files and java files are in different folders under com .
    say
    com
    in com there are two folders
    folder 1 -- subfolder 1
    folder 2 -- subfolder 2
    like this.
    If i want to create a jar file from com directory how should i give the jar command.Again my jar should contain only .class files.
    Any help will be appreciated
    Thanks
    lekshmi

    It doesn't work.Says "No such class or directory"
    Any other way Or is it possible to do so?Read the link I posted and create the statement to make your structure. I was thinking you were inside the com directory but if you are above it you will need something like this instead:
    jar -cf test.jar com\*.class com\subfolder1\*.class com\subfoler2\*.class
    But either way don't just copy and past this. Think about what is does so that you can make it work for you.
    Also, you might want to look into using Ant if you are going to be building this a lot.

  • Assembling jar with dependent classes

    For efficient Applet use I'd like to copy selectively into a jar my applet classes plus all classes they are dependent on from a set of libraries, thus producing the minimum jar library with which the applets can run (obviously classes which are part of the standard JRE are not to be included.
    Now I can see, in outline, how to write a program to achieve this, but I have this feeling I've read about such a facility somewhere. I thought it was in ANT but I can't find it in the ANT documentation now. If someone knows of a utility (preferably free) that can do this please can you save me the trouble.

    Well, I think I've found one on sourceforge: http://genjar.sourceforge.net/
    I've also found out how to get dependant classes from a .class file relatively simply. Class references are listed in the Constants Table which is near the start of the .class file format. I've written a piece of code which seems to fetch them OK.
    package org.igis.assjar;
    * <p>Read a class file stream and return all the referenced classes from the
    * class.</p>
    * @author  malcolmm
    public class GetClassRefs {
        private static final byte CONSTANT_Class = 7;
        private static final byte CONSTANT_FieldRef = 9;
        private static final byte CONSTANT_MethodRef = 10;
        private static final byte CONSTANT_InterfaceMethodRef = 11;
        private static final byte CONSTANT_String = 8;
        private static final byte CONSTANT_Integer = 3;
        private static final byte CONSTANT_Float = 4;
        private static final byte CONSTANT_Long = 5;
        private static final byte CONSTANT_Double = 6;
        private static final byte CONSTANT_NameAndType = 12;
        private static final byte CONSTANT_Utfs = 1;
        private static final int [] lengths = new int[13];
        static {
            lengths[CONSTANT_Class] = 3;
            lengths[CONSTANT_FieldRef] = 5;
            lengths[CONSTANT_MethodRef] = 5;
            lengths[CONSTANT_InterfaceMethodRef] = 5;
            lengths[CONSTANT_String] = 3;
            lengths[CONSTANT_Integer] = 5;
            lengths[CONSTANT_Float] = 5;
            lengths[CONSTANT_Long] = 9;
            lengths[CONSTANT_Double] = 9;
            lengths[CONSTANT_NameAndType] = 5;
            lengths[CONSTANT_Utfs] = 1;
        private final static int magic = 0xcafebabe;
        String mainClass;
        String [] refs;
        /** Creates a new instance of GetClassRefs */
        public GetClassRefs(java.io.InputStream ins) throws java.io.IOException,java.lang.ClassFormatError {
            java.io.DataInputStream in = new java.io.DataInputStream(ins);
            Object[] constTable;
            int nRefs;
            if(in.readInt() != magic)
                throw new ClassFormatError("Bad class magic");
            in.skipBytes(4);
            int cpCount = in.readUnsignedShort();
            constTable = new Object[cpCount];
            nRefs = 0;
            for(int i = 1; i < cpCount; i++) {
                int tag = in.readUnsignedByte();
                switch(tag) {
                    case CONSTANT_Utfs:
                        String clsName = in.readUTF();
                        if(clsName.length() > 0) {
                            if(clsName.charAt(0) == '[') {
                                do
                                    clsName = clsName.substring(1);
                                while(clsName.charAt(0) == '[');
                                if(clsName.charAt(0) == 'L' && clsName.endsWith(";"))
                                    clsName = clsName.substring(1, clsName.length() - 1);
                            constTable[i] = clsName;
                        break;
                    case CONSTANT_Class:
                        nRefs++;
                        constTable[i] = new Integer(in.readUnsignedShort());
                        break;
                    case CONSTANT_Long:
                    case CONSTANT_Double:
                        i++;
                        in.skipBytes(8);
                        break;
                    default:
                        if(tag < 0 || tag >= lengths.length || lengths[tag] == 0)
                            throw new ClassFormatError("Invalid constants tag " + tag);
                        in.skipBytes(lengths[tag] - 1);
                        break;
            in.skipBytes(2);
            int thisClass = in.readUnsignedShort();
            if(!(constTable[thisClass] instanceof Integer))
                throw new ClassFormatError("Invalid main class index");
            int cpp = ((Integer)constTable[thisClass]).intValue();
            if(!(constTable[cpp] instanceof String))
                throw new ClassFormatError("Invalid main class pointer");
            mainClass = (String)constTable[cpp];
            refs = new String[nRefs - 1];
            int j = 0;
            for(int i = 1; i < constTable.length; i++) {
                Object entry = constTable;
    if(entry instanceof Integer) {
    int idx = ((Integer)entry).intValue();
    if(idx < 1 || idx >= constTable.length)
    throw new ClassFormatError("Out of range class reference");
    if(constTable[idx] instanceof String) {
    if(i == thisClass)
    mainClass = (String)constTable[idx];
    else
    refs[j++] = (String)constTable[idx];
    else
    throw new ClassFormatError("Class reference not string");
    public String getMainClass() {
    return mainClass;
    public String[] getRefs() throws ClassFormatError {
    return refs;

  • Creating a JAR with main class def.

    Hello Amigos,
    I am having problems creating a jar file. My problem is that when I create the jar file and insert this line in my manifest file
    Main-Class: classnamewhere classname is what ever class you want as explain here:
    http://java.sun.com/developer/Books/javaprogramming/JAR/basics/run.html
    Then I have the jar file and double click it and get the Fail to load Main-Class error.
    This is what I am typing in the command line:
    jar cmf MANIFEST.MF myapp.jar *.class
    When I go back and extract all the files out of the jar file the manifest files looks like this:
    Manifest-Version: 1.0
    Created-By: 1.3.1 (IBM Corporation)Thanks in advance

    No ofense but... You got to be kidding me!?!?!Not kidding at all. Had you read the online tutorial, you'd have found the following line:
    Warning: The text file must end with a new line or carriage return. The last line will not be parsed properly if it does not end with a new line or carriage return.
    Have you tried it yet?

  • Classes12.jar with connection.class file

    Hi All,
    I want to download classes12.jar file which contains connection.class which is used for datasoruce.Can you please get me the download URL for the same.Please help me out as i got classes12.jar file but it doesnt contain the connection.class,if it doesnt have the connection.class it gives me a JMS:112 error which says invalid connection.
    Do please help me out in getting the classes12.jar file link for download.
    Thnaks in advance.
    Regards,
    Kalyan

    What is the Oracle database version? What is the JDK version? Various versions of classes12.jar are available.
    Please download classes12.jar from
    http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/index.html

  • Reflection - Two packages/classes with same name

    Hi There !
    I am in a situation and I need some help, if anyone can help me.
    I have two tools to work with different version of a server application. Now, the admin wants to have only one tool to work with both server app.
    The problem is that the server app has a jar file with the API to be used to access it. One jar for each version.
    Inside those jars files I have the same package and the same class ! But the implementation is diferent. So I will need to access one jar when accessing the old server app and another jar to access the new server app.
    I have no idea how to do it.
    I search arround google and I found that I can load a class at runtime and then with Reflection call its methods.
    I made a test app (simple, just 2 different jars with same package and class name just printing a Hello World and Bye World) and it worked very well.
    But when I tried to apply this to my code, I realize that one class need the reference of the other class...
    For example, I have a class named Server and other called ServerStatus.
    The Server class do the connection to the server and the ServerStatus get some server information. But the method that give me this information has a argument asking for an object of Server... like this:
    Server serv = new Server();
    serv.connect();
    ServerStatus servStat = new ServerStatus();
    servStat.getServerStatus(serv);I tried to do this with reflection but in the part that I need to invoke the method getServerStatus, I do not have the name of the class that is the argument (in this case Server).
    Something like this:
       Method  m = serverClass.getMethod("getServerStatus", new Class[] {?????.class});
             result = (Boolean)m.invoke(server, new Object[] {serverStatus});Do you have any ideiias to resolve this ?
    Or something different from reflection to access two different implementations with same package and class name ?
    If you need any other information, please ask me..
    Thank you so much !
    Regards,
    Thiago

    Thiago wrote:
    Hi.
    But now, how can I handle the object (because the newInstance() return a Object object.... not the class that I want (Server, for example)).
    When you declare a reference to be something more narrow than "Object" you're telling the compiler what methods and fields the referenced object supports. With a dynamically loaded class you can't do that at compile time, because the nature of the class isn't known until you load it at runtime.
    That's why it's very handy if you know that the class you are to load implements some interface which is known at compile time. Then you can access the object through a reference to that interface.
    Otherwise there's really no option but to handle the object through reflection. Find methods with getMethod() on the Class object and invoke them with Method.invoke().
    There are tricks to impose an interface onto a dynamically loaded class at runtime, but they are just neat ways of working through reflection.

  • Help Needed on a similar but not same class loader problem

    Hi,
    Please help...
    There is a ClassLoader called MyLoader that overrides default findClass() method to decrypt already encrypted class files available in a separate jar file.
    MyClass also contains a public static method launchMe() method that starts off with a call similar to loadClass("ApplicationMainClass");
    The MyLoader class is also encrypted
    I modified the default launcher (c) code to:
    First find the encrypted MyLoader file then decrypt it and create a byte array.
    The byte array, along with the system class loader and other required arguments, is passed to DefineClass native method (defined in jvm.dll)
    Note: The system class loader class has been instantiated using static method ClassLoader.getSystemClassLoader() through Java's invocation API.
    The DefineClass succeeds and I'm able to instantiate MyLoader and later call launchMe() to start application.
    Now i come to the problem:
    I'm not able to use any class other that those in rt.jar (i.e.standard classes) in MyLoader class. I end up with a runtime error ClassDefNotFoundError while trying to load any third party jar.
    The classes i need are present in class path and also in the local jre's ext that i use to launch my app.
    Although i can avoid using third party jar in MyLoader but if there is any way...
    Piyush

    make sure that third party jar resides in your library.....
    or else put rt.jar and external jars under same folder
    this is matter of path.... no else than this.......
    cheers
    Rajesh42

  • I got both a PC version and a mac version in my purchase but once i loaded to my PC it will not allow me to load to my Mac with same redemption number. Is there a way to do that?

    i got both a PC version and a mac version in my purchase but once i loaded to my PC it will not allow me to load to my Mac with same redemption number. Is there a way to do that?

    I was going to ask a similar question - we bought the boxed version of PSE11 with mac and pc disc - can we install the program on our mac as well as our PC? It's already on the PC but would be very handy to have it on Mac also. Thanks

  • Can I dinamicly load a class with custom class loader ?

    Can I dinamicly load a class with custom class loader ?

    Hi,
    I was wondering if you found answer to your question, and also were you using your custom class loader inside a signed applet as I am in a similar situation, and was wondering if you could help me. An example would be great...
    Thanks a lot.
    Regards.

  • Help - loading updated files with same name

    CS4
    When updating files with same name my CS4 automatically puts an extension _000
    I think it should ask me if I want to replace the existing file.  Is there a switch or setting that I need to change?
    Thanks.
    Alan

    Please find the solution in thread, http://forums.adobe.com/thread/707897?tstart=0.
    Hope this helps you.

  • Why the same function ToolTipText behaves differently in Jar and in Class

    Hi All! In my applet I use two similar statements from javax.swing:
    jListTeaSortSelect.setToolTipText("To stop the alarm just click over here.");
    jProgressBar1.setToolTipText("To stop the alarm just click over here.");
    Both work correctly when I run my applet from classes.
    Problem: When I run it from jar, composed from the same classes, second tool tip does not appear.
    I have no idea on where to get a hint to the solution. Could that be that the problem is caused by other graphical components or by the layout of the container?
    The applet and JAR in question with source code can be found on
    http://www.kobylkin.net/TeaTimer.htm , and the source code is included below in this letter as well..
    Thanks!
    Egor
    I do not include GNU GPL here, for histerical reasons [:-)]
    * TeaTimerJApplet.java
    * Created on 19. Januar 2002, 18:56
    * Tea timer with sound alarm to brew your tea right for the best taste.
    * Copyright Kobylkin Egor 2002. [email protected] www.kobylkin.net
    * This program is free software; you can redistribute it and/or
    * modify it under the terms of the GNU General Public License
    * as published by the Free Software Foundation; either version 2
    * of the License, or (at your option) any later version.
    * This program is distributed in the hope that it will be useful,
    * but WITHOUT ANY WARRANTY; without even the implied warranty of
    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    * GNU General Public License for more details.
    * You should have received a copy of the GNU General Public License
    * along with this program; if not, write to the Free Software
    * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
    USA.
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.applet.*;
    import java.applet.Applet;
    import java.net.*;
    public class TeaTimerJApplet extends javax.swing.JApplet {
    /** Creates new form TeaTimerJApplet */
    public TeaTimerJApplet() {
    initComponents();
    /** This method is called from within the constructor to
    * initialize the form.
    * WARNING: Do NOT modify this code. The content of this method is
    * always regenerated by the Form Editor.
    private void initComponents() {//GEN-BEGIN:initComponents
    java.awt.GridBagConstraints gridBagConstraints;
    jListTeaSortSelect = new javax.swing.JList();
    jButtonTimerStart = new javax.swing.JButton();
    jProgressBar1 = new javax.swing.JProgressBar();
    getContentPane().setLayout(new java.awt.GridBagLayout());
    jListTeaSortSelect.setBorder(new
    javax.swing.border.TitledBorder("Select the tea type"));
    jListTeaSortSelect.setModel(new javax.swing.AbstractListModel() {
    String[] strings = { "Test................10sec.", "Green
    tea.........3min.", "Black tea...........4min.", "Black
    tea...........5min.", "Mint, Coffee......8min." };
    public int getSize() { return strings.length; }
    public Object getElementAt(int i) { return strings; }
    jListTeaSortSelect.setToolTipText("To stop the alarm just click
    over here.");
    jListTeaSortSelect.setName("jListTeaSort");
    jListTeaSortSelect.setSelectedIndex(2);
    jListTeaSortSelect.setSelectionBackground(java.awt.Color.yellow);
    jListTeaSortSelect.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
    jListTeaSortSelect.setAutoscrolls(false);
    jListTeaSortSelect.addMouseListener(new
    java.awt.event.MouseAdapter() {
    public void mousePressed(java.awt.event.MouseEvent evt) {
    jListTeaSortSelectMousePressed(evt);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    getContentPane().add(jListTeaSortSelect, gridBagConstraints);
    jButtonTimerStart.setBackground(java.awt.Color.lightGray);
    jButtonTimerStart.setText("Start the timer");
    jButtonTimerStart.setToolTipText("<html>Visit me at
    www.kobylkin.net <br> Copyright Kobylkin Egor 2002 under GNU GPL</html>");
    jButtonTimerStart.setDoubleBuffered(true);
    jButtonTimerStart.setMaximumSize(new java.awt.Dimension(180, 90));
    jButtonTimerStart.setMinimumSize(new java.awt.Dimension(120, 27));
    jButtonTimerStart.setNextFocusableComponent(jListTeaSortSelect);
    jButtonTimerStart.setPreferredSize(new java.awt.Dimension(140,
    27));
    jButtonTimerStart.addActionListener(new
    java.awt.event.ActionListener() {
    public void actionPerformed(java.awt.event.ActionEvent evt) {
    jButtonTimerStartActionPerformed(evt);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 1;
    getContentPane().add(jButtonTimerStart, gridBagConstraints);
    jProgressBar1.setToolTipText("To stop the alarm signal just click
    over here.");
    jProgressBar1.setMinimumSize(new java.awt.Dimension(140, 14));
    jProgressBar1.setPreferredSize(new java.awt.Dimension(140, 14));
    jProgressBar1.addMouseListener(new java.awt.event.MouseAdapter() {
    public void mousePressed(java.awt.event.MouseEvent evt) {
    jProgressBar1MousePressed(evt);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 2;
    getContentPane().add(jProgressBar1, gridBagConstraints);
    }//GEN-END:initComponents
    private void jListTeaSortSelectMousePressed(java.awt.event.MouseEvent
    evt) {//GEN-FIRST:event_jListTeaSortSelectMousePressed
    // Add your handling code here:
    if ( timerIsRunningFlag == false )
    jListTeaSortSelect.setBackground(java.awt.Color.white);
    so.stop();
    }//GEN-LAST:event_jListTeaSortSelectMousePressed
    private void jProgressBar1MousePressed(java.awt.event.MouseEvent evt)
    if ( timerIsRunningFlag == false )
    jListTeaSortSelect.setBackground(java.awt.Color.white);
    so.stop();
    private void
    jButtonTimerStartActionPerformed(java.awt.event.ActionEvent evt)
    {//GEN-FIRST:event_jButtonTimerStartActionPerformed
    //set the controls in dumb state:
    jButtonTimerStart.setEnabled(false);
    jListTeaSortSelect.setEnabled(false);
    jListTeaSortSelect.setBackground(java.awt.Color.white);
    switch ( jListTeaSortSelect.getSelectedIndex() ) {
    case 0 : timerDelay = 500; break; //Test 10 sec.
    case 1 : timerDelay = 9000; break; //Green tea 3 min.
    case 2 : timerDelay = 12000; break; //Black tea 4 min.
    case 3 : timerDelay = 15000; break; //Black tea 5 min.
    case 4 : timerDelay = 24000; break; //Mint tea 8 min.
    // every "timerDelay/100" seconds the progress bar status will be
    set to be -5% less by timerTaskPerformer.
    // After 20 times timerDelay will be less than 5% so the
    timerTaskPerformer fires the alarm.
    timer = new javax.swing.Timer(timerDelay, timerTaskPerformer);
    timer.setRepeats(true);
    timer.start();
    timerIsRunningFlag = true;
    progressBarStatus = 100;
    jProgressBar1.setValue( progressBarStatus );
    jButtonTimerStart.setLabel("Timer started");
    so.stop();
    }//GEN-LAST:event_jButtonTimerStartActionPerformed
    private ActionListener timerTaskPerformer = new ActionListener() {
    public void actionPerformed(ActionEvent evt) {
    if (progressBarStatus > 5){ progressBarStatus-=5;
    jProgressBar1.setValue(progressBarStatus);
    }else{
    timer.stop();
    timerIsRunningFlag = false;
    //user alarm actions
    jListTeaSortSelect.setBackground (java.awt.Color.red);
    Toolkit.getDefaultToolkit().beep();
    so=getAudioClip(getCodeBase(), "spacemusic.au");
    so.loop();
    /* "Server not found" IE error.
    open pop-up explorer window to alert user
    try {
    AppletContext ac = getAppletContext();
    ac.showDocument( new URL( getCodeBase() +
    "teaReady.html" ), "_self");
    catch (MalformedURLException exc) {
    showStatus("Cannot find file teaReady.html");
    progressBarStatus = 0;
    jProgressBar1.setValue( progressBarStatus );
    //return to the initial state
    jButtonTimerStart.setText("Start the tea timer");
    jButtonTimerStart.setEnabled(true);
    jListTeaSortSelect.setEnabled(true);
    //Variables declaration
    private int progressBarStatus = 100;
    public boolean timerIsRunningFlag = false;
    public int timerDelay;
    private javax.swing.Timer timer;
    public AudioClip so;
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButtonTimerStart;
    private javax.swing.JList jListTeaSortSelect;
    private javax.swing.JProgressBar jProgressBar1;
    // End of variables declaration//GEN-END:variables

    Hi
    What i understand from u'r problem is that when a jar is created and run under browser, ToolTipText for progress panel is not shown? is so is the case - i had no problems..
    The code given was compiled and created a jar successfully..
    this is how i created the jar..(under WindowsNT and MSIE)
    jar cf TeaTimer.jar TeaTimerJApplet.class
    TeaTimer.html
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
    <HEAD>
    <TITLE> New Document </TITLE>
    <META NAME="Generator" CONTENT="EditPlus">
    <META NAME="Author" CONTENT="">
    <META NAME="Keywords" CONTENT="">
    <META NAME="Description" CONTENT="">
    </HEAD>
    <BODY BGCOLOR="#FFFFFF">
    <APPLET CODE="TeaTimerJApplet" archive="TeaTimer.jar" WIDTH="200" HEIGHT="200">
    </APPLET>
    </BODY>
    </HTML>
    cheers
    Mohan

  • Deployed EJB.jar has some classes with zero bytes

    Has anyone hit a situation where Windows Jdev 902 puts class files into the ....EJB.jar file with zero bytes? In my case, the eight zero length classes are: seven My...Row.class files and the MyApplicationModule.class file. They all are in the /mypackage/common/ package and are in the ...classes/mypackage/common/ file folder.
    I can use PKZIP to delete the zero length classes and add them back into the .jar and everything works as expected.
    There are no error messages generated during the deployment that creates the .jar file that has the problem.

    This was posted on another thread by jdev team...
    We have been following this issue in support TAR 2274825.996. I sent some technical detail to the support rep on July 10, but it looks like that information never got added to the TAR. Well, FWIW, here it is:
    The user may be running out of open files. The
    stdio library which underlies Win32 programs (like the JVM) has a
    limit on the number of files that can be open concurrently. The
    limit is around 2000-2100 open files (I tested this on NT, 2000, and
    XP), and the limit is on a per-process basis. If the user is running
    into this limit because JDev has too many open files, then the utility
    methods we use to open JAR files or other streams could be receiving
    a java.io.FileNotFoundException exception with the message "Too many
    open files". To verify this: go to the Windows Task Manager, go to
    View | Select Columns... and be sure the "Handle Count" checkbox is
    checked. Does the jdev.exe process have a disproportionately higher
    number of handles than other processes? If the Handle Count is above
    2000 (approx), JDev might be running out of open files. (I say "might" because
    the Handle Count is for many different kinds of Win32 kernel objects,
    not just for file handles.) If the Handle Count is the problem, then
    it would explain the transient, nondeterministic behavior that the
    user is reporting. Because the Handle limit is per-process, it would
    explain why the user is able to use PKZIP or WinZip to repair the JAR
    file. Try closing editors before deploying and see if that helps.
    If the user confirms that the Handle Count is excessive, then we may
    have a Handle leak of some kind in the product that will need to be
    fixed.
    Also try running JDev using "jdev -hotspot" on the command line instead
    of just "jdev" and see if the behavior changes.
    Hope that helps. We are monitoring the TAR, but no one has been able to reproduce the problem you are reporting, even with the files attached to the TAR, and yours is the only report so far that we've received about this specific problem.
    I have added several more entities and views into app module. As I added each one, the list of zero byte jar classes would change, but always about 7-8 bad ones. Now that I am no longer adding new entities/views, the problem has become stable and repeatable. The same classes ALWAYS show up with zero bytes.
    I monitored jdevw.exe while doing the deploy, and the number of handles never went above 675. I ran with jdevw.exe -hotspot and the results were exactly the same.
    thanks,
    Roger

  • How to pack .class or .jar with jvm into an exe file?

    In fact, .class or .jar files are middle layer files who need JVM to explain and run them. Sometimes it's unconvenient. Why not provide some tools to pack .class or .jar with jvm into exe file?

    because java should be able to run on any OS. That is why SUN doesn't provide such tool. There are other company's who does provide such tool. Like JBuilder enterprise

Maybe you are looking for