Securing class files

Hello,
I read all these topics about securing class-files,
and about encryptors and stuff like that
so I tought this could be possible :
I've made an application and you can run it by using an exe-file.
In the same directory you find the class-files.
Now I archived the class files with winrar, and set a password on it.
I tried to use the exe-file to run the application, but it can't.
Obvisiously, it can't find the mainclass.
So I was wondering if there is a way to make clear to the exe -file, that the main class is in that zip-file, and that you need <this password> to get in to the zip-file.
I think it's possible, but I don' know how to do it.
I thought Google would know it, but he don't.
...

The collision wasn't "stumbled" across it was found
because the researchers
found a way (from your link) to "reduce the search
space".I didn't say "the collision was "stumbled" across"...
>
This means that, under certain circumstances, inputs
producing the same hash
can be found for other inputs + hashes.That is what I said...
>
Did you have a look at the PDF ?
http://eprint.iacr.org/2004/199.pdf
This doesn't damage the use of MD% for verifyingthat
file contents are unchanged, so to OP - go aheadand
use it.Well, it does because it means that there is the
potential for another
file that is not the same to return the same
sum - hence the program
won't realise the difference.And the situation is no worse now that before the duplication was found. Any encryption/hashing routine can create duplicate hashes - because none of them have an infinitely large numberspace.

Similar Messages

  • Jars and .class files - security of the source code

    Hi,
    I have an app that is in a jar file with the .class files (so no source code).
    I'm wondering how difficult it is to attain the source code from these .class files in my jar? Looking through the contents of the .class files it seems there is a large amount of readable text. For example I see method names, variables, etc.
    This leads me to believe these jars are not secure. What is a better way?
    Thanks!
    Edit:
    Looking around, I've noticed many java decompilers and Sun even supports a dissembler - javap. I think this is not cool, haha.
    What way can I protect my code? To me, the value of java just went way down due to the ease at attaining source code (based on what I read in the past hour or so. I have yet to try it myself). I wonder if this impacts companies reasons not to use java?
    Edit 2:
    I heard that there may be a way to make the jar closed, so you can't say, use winrar, to extract the class files. Does anyone know anything about this?
    Message was edited by:
    dayrinni
    Message was edited by:
    dayrinni

    Hi,
    I have an app that is in a jar file with the .class
    files (so no source code).
    I'm wondering how difficult it is to attain the
    source code from these .class files in my jar?
    Looking through the contents of the .class files it
    seems there is a large amount of readable text. For
    example I see method names, variables, etc.
    This leads me to believe these jars are not secure.
    What is a better way?
    Thanks!
    Edit:
    Looking around, I've noticed many java decompilers
    and Sun even supports a dissembler - javap. I think
    this is not cool, haha.
    What way can I protect my code? To me, the value of
    java just went way down due to the ease at attaining
    source code (based on what I read in the past hour or
    so. I have yet to try it myself). I wonder if this
    impacts companies reasons not to use java?All intellectual property stored in electronic form is vulnerable. Not just Java bytecode. You can use tools called obfuscators to make decompiling more difficult, which is usually good enough. The truth is, no matter how great you think your code is, it's of a lot less interest to others than you actually think. Unless you've got a particularly sexy argorithm or something, it's not really worth worrying too much about
    All you can do is make it more difficult for people to crack things, never prevent it. True of all languages, all electronic media

  • Security class requires java.security file???

    What is the use of java.security file? Which
    classes refer this file while creating the instance?
    Can we create a class file that will refer this security
    file?
    When the java program loads security class it needs java.security class?
    In what type situation security class look into java.security file???
    Pls help me
    regards,
    namanc

    Open the java.security file up in notepad or something.

  • Security for Class File

    How to protect the Class file from Decompling to the Source code..

    Balainet wrote:
    How to protect the Class file from Decompling to the Source code..How to search for answer to frequently asked question?
    How to post question into correct forum?

  • Secure the class-file - Make decompile impossible?

    Hi everybody!
    I have "basic" (?) question concerning Java-Class-Files.
    As our company is currently developing an Web-Intranet-Solution, we have to give the source-Code (class-files, jsp-pages and the jar-files) tio the customer.
    But our problem is, that we do not want him to be able to read the source or manipulate it. Now it is very easy to do so, I am just thinking of jad - a java decompiler, for example...
    How can we prevent this?
    What are common approaches for this problem?
    Thx in Advance!
    Stef

    You will be better off using obfustacting softwares, rather than customized class loader with encrypted classes as the nature of bytecodes will leave the decompiling process with an intercepting point always. Thaw will make the decompiling trivial regardless of the encryption strength you use.
    For obfuscation, Proguard is a GPL one, and Retroguard is suitable for commercial shipments, but I suppose there are more than a bunch of them out there, which I am not aware of.

  • Error while accessing secure store: File "SecStore.properties" does not exi

    Hi ,
    I have a java desktop application, and i am trying to get a connection from a datasource deployed on one SAP AS Java, I can get the datasource succsfullly but when i try to get a connection from the DS, it throughs this exception, I put the secstore..properties file in the classpath even after that it is not happy,
    any solution/hint/light please!!!!
    com.sap.sql.log.OpenSQLException: Error while accessing secure store: File "SecStore.properties" does not exist although it should..
         at com.sap.sql.log.Syslog.createAndLogOpenSQLException(Syslog.java:106)
         at com.sap.sql.log.Syslog.createAndLogOpenSQLException(Syslog.java:145)
         at com.sap.sql.connect.OpenSQLDataSourceImpl.setDataSourceName(OpenSQLDataSourceImpl.java:226)
         at com.sap.sql.connect.OpenSQLDataSourceImpl.setDataSourceName(OpenSQLDataSourceImpl.java:197)
         at com.sap.customcode.ConflictingActionFixture.(ConflictingActionFixture.java:53)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
         at java.lang.reflect.Constructor.newInstance(Unknown Source)
         at java.lang.Class.newInstance0(Unknown Source)
         at java.lang.Class.newInstance(Unknown Source)
         at fit.FixtureClass.newInstance(Unknown Source)
         at fit.FixtureLoader.instantiateFixture(Unknown Source)
         at fit.FixtureLoader.instantiateFirstValidFixtureClass(Unknown Source)
         at fit.FixtureLoader.disgraceThenLoad(Unknown Source)
         at fit.Fixture.loadFixture(Unknown Source)
         at fit.Fixture.getLinkedFixtureWithArgs(Unknown Source)
         at fit.Fixture.doTables(Unknown Source)
         at fit.FitServer.process(Unknown Source)
         at fit.FitServer.run(Unknown Source)
         at fit.FitServer.main(Unknown Source)
    Caused by: com.sap.security.core.server.secstorefs.FileMissingException: File "SecStore.properties" does not exist although it should.
         at com.sap.security.core.server.secstorefs.StorageHandler.openExistingStore(StorageHandler.java:372)
         at com.sap.security.core.server.secstorefs.SecStoreFS.openExistingStore(SecStoreFS.java:1946)
         at com.sap.sql.connect.OpenSQLConnectInfo.getStore(OpenSQLConnectInfo.java:802)
         at com.sap.sql.connect.OpenSQLConnectInfo.lookup(OpenSQLConnectInfo.java:783)
         at com.sap.sql.connect.OpenSQLDataSourceImpl.setDataSourceName(OpenSQLDataSourceImpl.java:209)
         ... 18 more
    caused by

    the SecStore.key file was not there, I changed the passwd and checked the 'Encryption' on, after that my sever instance is not starting.
    Any idea?
    -Puneet

  • How do I make a batch file if the .class file uses a foreign package?

    I am trying to make an MS-DOS batch file using the bytecode file from the Java source file, called AddFields.java. This program uses the package BreezySwing; which is not standard with the JDK. I had to download it seperately. I will come back to this batch file later.
    But first, in order to prove the concept, I created a Java file called Soap.java in JCreator. It is a very simple GUI program that uses the javax.swing package; which does come with the JDK. The JDK is currently stored in the following directory: C:\Program Files\Java\jdk1.6.0_07. I have the PATH environment variable set to the 'bin' folder of the JDK. I believe that it is important that this variable stay this way because C:\Program Files\Java\jdk1.6.0_07\bin is where the file 'java.exe' and 'javac.exe' are stored. Here is my batch file so far for Soap:
    @echo off
    cd \acorn
    set path=C:\Program Files\Java\jdk1.6.0_07\bin
    set classpath=.
    java Soap
    pause
    Before I ran this file, I compiled Soap.java in my IDE and then ran it successfully. Then I moved the .class file to the directory C:\acorn. I put NOTHING ELSE in this folder. then I told the computer where to find the file 'java.exe' which I know is needed for execution of the .class file. I put the above text in Notepad and then saved it as Soap.bat onto my desktop. When I double click on it, the command prompt comes up in a little green box for a few seconds, and then the GUI opens and says "It Works!". Now that I know the concept of batch files, I tried creating another one that used the BreezySwing package.
    After I installed my JDK, I installed BreezySwing and TerminalIO which are two foreign packages that make building code much easier. I downloaded the .zip file from Lambert and Osborne called BreezySwingAndTerminalIO.zip. I extracted the files to the 'bin' folder of my JDK. Once I did this, and set the PATH environment variable to the 'bin' folder of my JDK, all BreezySwing and TerminalIO programs that I made worked. Now I wanted to make a batch file from the program AddFields.java. It is a GUI program that imports two packages, the traditional GUI javax.swing package and the foreign package BreezySwing. The user enters two numbers in two DoubleField objects and then selects one of four buttons; one for each arithmetic operation (add, subtract, multiply, or divide). Then the program displays the solution in a third DoubleField object. This program both compiles and runs successfully in JCreator. So, next I moved the .class file from the MyProjects folder that JCreator uses to C:\acorn. I put nothing else in this folder. The file Soap.class was still in there, but I did not think it would matter. Then I created the batch file:
    @echo off
    cd \acorn
    set path=C:\Program Files\Java\jdk1.6.0_07\bin
    set classpath=.
    java AddFields
    pause
    As you can see, it is exactly the same as the one for Soap. I made this file in Notepad and called it AddFields.bat. Upon double clicking on the file, I got this error message from command prompt:
    Exception in thread "main" java.lang.NoClassDefFoundError: BreezySwing/GBFrame
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:12
    4)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
    at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
    Caused by: java.lang.ClassNotFoundException: BreezySwing.GBFrame
    at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
    ... 12 more
    Press any key to continue . . .
    I know that most of this makes no sense; but that it only means that it cannot find the class BreezySwing or GBFrame (which AddFields extends). Notice, however that it does not give an error for javax.swing. If I change the "set path..." command to anything other than the 'bin' folder of my JDK, I get this error:
    'java' is not recognized as an internal or external command,
    operable program or batch file.
    Press any key to continue . . .
    I know this means that the computer cannot find the file 'java.exe' which I believe holds all of the java.x.y.z style packages (native packages); but not BreezySwing or any other foreign packages. Remember, I do not get this error for any of the native Java packages. I decided to compare the java.x.y.z packages with BreezySwing:
    I see that all of the native packages are not actually visible in the JDK's bin folder. I think that they are all stored in one of the .exe files in there because there are no .class files in the JDK's bin folder.
    However, BreezySwing is different, there is no such file called "BreezySwing.exe"; there are just about 20 .class files all with names like "GBFrame.class", and "GBActionListener.class". As a last effort, I moved all of these .class files directly into the bin folder (they were originally in a seperate folder called BreezySwingAndTerminalIO). This did nothing; even with all of the files in the same folder as java.exe.
    So my question is: What do I need to do to get the BreezySwing package recognized on my computer? Is there possibly a download for a file called "BreezySwing.exe" somewhere that would be similar to "java.exe" and contain all of the BreezySwing packages?

    There is a lot of detail in your posts. I won't properly quote everything you put (too laborious). Instead I'll just put your words inside quotes (").
    "..there are some things about the interface that I do not like."
    Like +what?+ This is not a help desk, and I would appreciate you participating in this discussion by providing details of what it is about the 'interface' of webstart that you 'do not like'. They are probably misunderstandings on your part.
    "Some of the .jar files I made were so dangerously corrupt, that I had to restart my computer before I could delete them."
    Corrupt?! I have never once had the Java tools produce a corrupt Jar. OTOH, the 'cannot delete' problem might relate to the JRE gaining a file lock on the archive at run-time. If the file lock persisted after ending the app., it suggests that the JRE was not properly shut down. This is a bug in the code and should be fixed. Deploying as .class files will only 'hide' the problem (from casual inspection - though the Task Manager should show the orphaned 'java' process).
    "I then turned to batch files for their simple structure and portability (I managed to successfully transport a java.util containing batch file from my computer to another). This was what I did:
    - I created a folder called Task
    - Then I copied three things into this folder: 1. The file "java.exe" from my JDK. 2. The program's .class file (Count.class). and 3. The original batch file.
    - Then I moved the folder from a removable disk to the second computer's C drive (C:\Task).
    - Last, I changed the code in the batch file...:"
    That is the +funniest+ thing I've heard on the forums in the last 72 hours. You say that is easy?! Some points.
    - editing batch files is not scalable to 100+ machines, let alone 10000+.
    - The fact that Java worked on the target machine was because it was +already installed.+ Dragging the 'java.exe' onto a Windows PC which has no Java will not magically make it 'Java enabled'.
    And speaking of Java on the client machine. Webstart has in-built mechanisms to ensure that the end user has the minimum required Java version to run the app. - we can also use the [deployJava.js|http://java.sun.com/javase/6/docs/technotes/guides/jweb/deployment_advice.html#deplToolkit] on the original web page, to check for minimum Java before it puts the link to download/install the app. - if the user does not have the required Java, the script should guide them through installing it.
    Those nice features in deployJava.js are available to applets and apps. launched using webstart, but they are not available for (plain) Jar's or loose class files. So if 'ensuring the user has Java' is one of the requirements for your launch, you are barking up the wrong tree by deploying loose class files.
    Note also that if you abandon webstart, but have your app. set up to work from a Jar, the installation process would be similar to above (though it would not need a .bat file, or editing it). This basic strategy is one way that I provide [Appleteer (as a downloadable ZIP archive)|http://pscode.org/appleteer/#download]. Though I side-step your part 1 by putting the stuff into a Jar with the path Appleteer/ - when the user expands the ZIP, the parts of the app. are already in the Appleteer directory.
    Appleteer is also provided as a webstart launched application (and as an applet). Either of those are 'easier' to use than the downloadable ZIP, but I thought I would provide it in case the end user wants to save it to disk and transport the app. to a machine with no internet connection, but with Java (why they would be testing applets on a PC with no internet connection, I am not sure - but the option is there).
    "I know that .jar and .exe files are out because I always get errors and I do not like their interfaces. "
    What on earth are you talking about? Once the app. is on-screen, the end user would not be able to distinguish between
    1) A Jar launched using a manifest.
    2) A Jar launched using webstart.
    3) Loose class files.
    Your fixation on .bat files sounds much like the adage that 'If the only tool you have is a hammer, every job starts to look like a nail'.
    Get over them, will you? +Using .bat files is not a practical way to provide a Java app. to the end user+ (and launching an app. from a .bat looks quite crappy and 'second hand' to +this+ user).
    Edit 1:
    The instructions for running Appleteer as a Jar are further up the page, in the [Running Appleteer: Application|http://pscode.org/appleteer/#application] section.
    Edited by: AndrewThompson64 on May 19, 2009 12:06 PM

  • How to Load a class file base on .class file name???

    Hi,
    Can anyone help me?
    1) Based on filename (d:\temp\bla.class), I want to load this bla.class and get the actual package of this class.
    example:
    package something.temp;
    public class bla
    I want to load the file base on filename and get the package of the class. Is it possible ?
    Thank you.

    Hi nikki96,
    It will not work. I will get java.lang.NoClassDefFoundError eventhough I extends classloader to use the findClass(String filename);
    Example:
    import java.security.*;
    import java.util.Enumeration;
    import java.util.NoSuchElementException;
    import java.util.jar.Attributes;
    import java.util.jar.Manifest;
    import sun.misc.Resource;
    import sun.misc.URLClassPath;
    public class MyURLClassLoader extends ClassLoader
    String host;
    int port;
    public Class findClass(String name)
                   try
         byte[] b = loadClassData(name);
         return defineClass(name, b, 0, b.length);
                   } catch(Exception e)
                        e.printStackTrace();
                   return null;
    private byte[] loadClassData(String name) throws Exception
                   // load the class data from the connection
                   File file = new File(name);
                   InputStream is = new FileInputStream(file);
                   long length = file.length();
                   // You cannot create an array using a long type.
                   // It needs to be an int type.
                   // Before converting to an int type, check
                   // to ensure that file is not larger than Integer.MAX_VALUE.
                   if (length > Integer.MAX_VALUE) {
                        // File is too large
                   // Create the byte array to hold the data
                   byte[] bytes = new byte[(int)length];
                   // Read in the bytes
                   int offset = 0;
                   int numRead = 0;
                   while (offset < bytes.length
                        && (numRead=is.read(bytes, offset, bytes.length-offset)) >= 0) {
                        offset += numRead;
                   // Ensure all the bytes have been read in
                   if (offset < bytes.length) {
                        throw new IOException("Could not completely read file "+file.getName());
                   // Close the input stream and return bytes
                   is.close();
                   return bytes;
    Problem: The class file is not in the proper package (d:\temp\bla.class) where the proper package is d:\something\temp\bla.class.
    Objective: I just want to base on the bla.class (no matter where is it located), then get the package of the classfile (bla.class) like example something.temp.
    Simple as that but I don't know how to do :(.

  • How to restrict the .class file from decompilation

    Hi all,
    i got a security problem. i need all the java class files to be most secured. is there any to restriction on the java class files from decompilation. is that possible?. pls help me out. it's very urgent
    thanks in advance

    You can make it harder to understand the decompiled code if you use an obfuscator. (I don't have links to any, do a google search, or search these forums, it have been discussed here previously.)
    You cannot completely prevent decompilation, though. Obfuscating does not for example not mean that any passwords you have hardcoded in the source is secure.

  • How to 'deploy' an Applet when class files are on client machine?

    Hi all,
    I've searched through these forums and I can't find where my specific question has been asked before, so please accept my apologies for any duplication.
    I am trying to develop an applet for use on an intranet. (The specific requirement is that the applet must operate a scanner, and upload the scanned images to the database - we want it to be an applet so that it seamlessly integrates with the rest of the web application from the user's POV).
    Therefore the applet needs to run outside of the sandbox, but I don't want to go to all the hassle of getting a certificate from Verisign and signing the applet - that doesn't seem like it should be necessary, since there is no problem getting access to the client PC to install the class files by hand!
    I have read on this tutorial page that applets "that are loaded from the local file system (from a directory in the user's CLASSPATH) have none of the restrictions that applets loaded over the network do," so I don't think I am barking up the wrong tree:
    http://java.sun.com/docs/books/tutorial/deployment/applet/security.html
    That is exactly what I want to do! But whenever I try to run the applet, I get a no class definition found exception. However, if I run the applet as a standalone application (using its static main method) then the JRE has no trouble locating the class file - so I know that my CLASSPATH environment variable is set ok.
    Therefore I think the problem must be in my JNLP file. This is what mine looks like at present:
    <?xml version="1.0" encoding="UTF-8"?>
    <jnlp spec="1.0+" codebase="http://localhost:8080/JGNS008" href="http://localhost:8080/JGNS008/scanner-applet.jnlp">
        <information>
            <title>Scanner Applet Prototype</title>
            <vendor>Fooware</vendor>
        </information>
        <resources>
            <!-- Application Resources -->
            <j2se version="1.6+" href="http://java.sun.com/products/autodl/j2se" />
            <jar href="ScannerApplet.jar" main="false" />
        </resources>
        <applet-desc
             name="Scanner Applet Prototype"
             main-class="uk.co.fooware.ScannerApplet"
             width="72"
             height="20">
         </applet-desc>
         <update check="background"/>
    </jnlp>How do I rewrite this so that it doesn't try to download the class files from the network?
    Many thanks,
    Richard.

    richardwild wrote:
    ..I am trying to develop an applet for use on an intranet. (The specific requirement is that the applet must operate a scanner, and upload the scanned images to the database - we want it to be an applet so that it seamlessly integrates with the rest of the web application from the user's POV).
    Therefore the applet needs to run outside of the sandbox, but I don't want to go to all the hassle of getting a certificate from Verisign and signing the applet - that doesn't seem like it should be necessary,.. Code can be digitally signed without a 'verified' certificate from Versign.
    ..since there is no problem getting access to the client PC to install the class files by hand!
    I have read on this tutorial page that applets "that are loaded from the local file system (from a directory in the user's CLASSPATH) have none of the restrictions that applets loaded over the network do," so I don't think I am barking up the wrong tree:
    http://java.sun.com/docs/books/tutorial/deployment/applet/security.html
    Huh. I had never heard of that, but since I do not have access to my end user's classpath it is not that important to me.
    BTW - I am guessing they mean the path indicated by [http://pscode.org/prop/all.html?prop=java.class.path].
    And putting classes into JRE folders seems very hackish to me.
    That is exactly what I want to do! But whenever I try to run the applet, I get a no class definition found exception. However, if I run the applet as a standalone application (using its static main method) then the JRE has no trouble locating the class file - so I know that my CLASSPATH environment variable is set ok.Huh?
    Therefore I think the problem must be in my JNLP file. Huh?!? Why not deploy the applet using a standard applet element? The only way to configure an applet using a JNLP is ..
    a) If the applet is intended to be free floating.
    b) If the applet is intended to be embedded in a plug-in2 architecture JRE. Why impose that restriction, when it seems unnecessary and unproductive?
    Note that the second option is very new, and I would not expect all the things mentioned in the document you linked, to apply equally to JNLP embedded applets. If you want this applet embedded, I suggest you drop the entire JNLP approach and use a standard applet element.

  • Java wont open .class file

    ok i just started at this and found this web site http://java.sun.com/docs/books/tutorial/getStarted/cupojava/win32.html#1
    i copyed exactly what he says to copy:
    * The HelloWorldApp class implements an application that
    * displays "Hello World!" to the standard output.
    public class HelloWorldApp {
    public static void main(String[] args) {
    // Display "Hello World!"
    System.out.println("Hello World!");
    then put all that in notepad save it as "HelloWorldApp.java". i go to the msdos prompt type in javac HelloWorldApp.java it turns it in to a .class file and i type it
    java HelloWorldApp and it gives me an error:
    Exception in thread "main" java.lang.NoClassDefFoundError: helloworldapp (wrong
    name: HelloWorldApp)
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(Unknown Source)
    at java.security.SecureClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.access$100(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    What did I/He do wrong.

    thanks it worked. can you tell my why?

  • URGENT PLEASE:How can I run a a class file on the Apache server?

    Hi Guys and Gurus,
    I am seeking some favor all of experienced gurus, i.e.
    How can I run a a class file on the Apache server? Can I run through an Applet?
    How can I set Environment variables in Windows2000 Professional Environment?
    Actually, I want to extract some records from a MySQL Database running on Apache Server. I wrote a program just to select the columns and show them. It is now a Class file, Now how can I run this class file from the Server???
    The code is here
    import java.sql.*;
    public class RecordShow {
    public static void main(String args[]) {
    String url = "jdbc:mysql://localhost/myhost";
    Connection con;
    String query = "select mytable.column," +
    "from mytable " +
    "where mytable.column = 1";
    Statement stmt;
    try {
    Class.forName("com.mysql.jdbc.Driver");
    } catch(java.lang.ClassNotFoundException e) {
    System.err.print("ClassNotFoundException: ");
    System.err.println(e.getMessage());
    try {
    con = DriverManager.getConnection(url,
    "myuser", "mypassword");
    stmt = con.createStatement();
    ResultSet rs = stmt.executeQuery(query);
    ResultSetMetaData rsmd = rs.getMetaData();
    int numberOfColumns = rsmd.getColumnCount();
    int rowCount = 1;
    while (rs.next()) {
    System.out.println("Row " + rowCount + ": ");
    for (int i = 1; i <= numberOfColumns; i++) {
    System.out.print(" Column " + i + ": ");
    System.out.println(rs.getString(i));
    System.out.println("");
    rowCount++;
    stmt.close();
    con.close();
    } catch(SQLException ex) {
    System.err.print("SQLException: ");
    System.err.println(ex.getMessage());
    Please advise... THANKS
    VJ

    Ehm, I wasn't referring to you at all... read up,
    there's a comment by jschell saying that CGI might be
    easier/better for his purposes.
    Yep.
    I know PHP/Perl/whatever might be easier for some
    purposes, but only if you happen to know them and want
    to/are able to use them. Ok. But you aren't the one asking the question are you. And the person who asked the question seems to have absolutely no familiarity with Apache or applets.
    So whatever they do they are going to have to learn a lot.
    And that does indeed suggest that in all likelyhood they have not investigated the alternatives.
    And for the vast majority of internet applications, especially with smaller projects (obvious this person is not working with a large team), using perl, or something besides java, is going to be the best business solution. It is simpler, and more secure (probably due to the fact that it is simpler.)
    Since this is a Java forum, I
    answer under the assumption that people have made a
    choice one way or another to use a Java solution to
    their problem, so I try to solve it in Java first, and
    only when that fails (very seldom) do I turn to other
    solutions.You approach problems by arbritrarily deciding to try to solve it in java first and only if you fail do you then look to other solutions?
    My first step is to try to figure out which of the various avenues is going to cost less. (And a secondary, but non-trivial concern, is then to convince the customer that just because they have heard of a buzz word like 'enterprise bean' that it doesn't mean that is a cost effective solution.) We must come from different worlds.

  • Java.lang.AssertionError: WSDL not found in the class file "processes

    Hi,
    I am using WLI 10.3 workshop to build process application. I have designed one JPD which inturn call another process JPD. So i have used worklist process control to create the process and tried to access the process. When i am executing the code, i am getting below error message.
    13-Jun-2011 14:13:00 o'clock BST> <Error> <WLI> <BEA-000000> <Exception processing processes.ISPSSQMsgLisnt
    Java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
    at com.bea.wli.knex.runtime.core.dispatcher.DispUnit.loadDispFile(DispUnit.java:219)
    Truncated. see log file for complete stacktrace
    Java.lang.AssertionError: WSDL not found in the class file "processes.ISPSSQMsgLisnt", annotated class = processes.ISPSSQMsgLisnt
    --ClassAnnotations:
    --Method Annotations:
    --Field Annotations:
    can't continue
    at com.bea.wli.knex.runtime.jws.dispatcher.JwsDispClass.<init>(JwsDispClass.java:392)
    at com.bea.wli.bpm.runtime.JpdDispClass.<init>(JpdDispClass.java:65)
    at com.bea.wli.bpm.runtime.JpdDispClass.<init>(JpdDispClass.java:55)
    at com.bea.wli.bpm.runtime.JpdDispFile.createPrimaryDispClass(JpdDispFile.java:382)
    at com.bea.wli.knex.runtime.core.dispatcher.DispFile.<init>(DispFile.java:154)
    Truncated. see log file for complete stacktrace
    xception processing processes.ISPSSQMsgLisnt
    ava.lang.reflect.InvocationTargetException
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
    at com.bea.wli.knex.runtime.core.dispatcher.DispUnit.loadDispFile(DispUnit.java:219)
    at com.bea.wli.knex.runtime.core.dispatcher.DispUnit.<init>(DispUnit.java:153)
    at com.bea.wli.knex.runtime.core.dispatcher.DispCache.ensureDispUnit(DispCache.java:628)
    at com.bea.wli.knex.runtime.core.dispatcher.DispCache.ensureDispUnitForURI(DispCache.java:1029)
    at com.bea.wli.knex.runtime.core.dispatcher.DispCache.ensureDispUnitForURI(DispCache.java:950)
    at com.bea.wli.broker.JWSSubscriber.getDispClass(JWSSubscriber.java:231)
    at com.bea.wli.broker.JWSSubscriber.getRequest(JWSSubscriber.java:184)
    at com.bea.wli.broker.JWSSubscriber.doDispatch(JWSSubscriber.java:358)
    at com.bea.wli.broker.JWSSubscriber.doDispatch(JWSSubscriber.java:348)
    at com.bea.wli.broker.SubscriptionDispatcher.doDispatch(SubscriptionDispatcher.java:87)
    at com.bea.wli.broker.MessageBroker$PrivilegedSubscriptionDispatcher.run(MessageBroker.java:179)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
    at weblogic.security.service.SecurityManager.runAs(Unknown Source)
    at com.bea.wli.security.authentication.AuthenticationService.runAs(AuthenticationService.java:108)
    at com.bea.wli.broker.MsgBrokerSecurityHelper.doDispatch(MsgBrokerSecurityHelper.java:231)
    at com.bea.wli.broker.MessageBroker$PrivilegedSubscriptionDispatcher.doDispatch(MessageBroker.java:165)
    at com.bea.wli.broker.MessageBroker.publishMessage(MessageBroker.java:984)
    at com.bea.wli.mbconnector.jms.JmsConnMDB.publishMBMessage(JmsConnMDB.java:343)
    at com.bea.wli.mbconnector.jms.JmsConnMDB.onMessage(JmsConnMDB.java:475)
    at weblogic.ejb.container.internal.MDListener.execute(MDListener.java:466)
    at weblogic.ejb.container.internal.MDListener.transactionalOnMessage(MDListener.java:371)
    at weblogic.ejb.container.internal.MDListener.onMessage(MDListener.java:327)
    at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:4547)
    at weblogic.jms.client.JMSSession.execute(JMSSession.java:4233)
    at weblogic.jms.client.JMSSession.executeMessage(JMSSession.java:3709)
    at weblogic.jms.client.JMSSession.access$000(JMSSession.java:114)
    at weblogic.jms.client.JMSSession$UseForRunnable.run(JMSSession.java:5058)
    at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:516)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    aused by: java.lang.AssertionError: WSDL not found in the class file "processes.ISPSSQMsgLisnt", annotated class = processes.ISPSSQMsgLisnt
    --ClassAnnotations:
    --Method Annotations:
    --Field Annotations:
    can't continue
    at com.bea.wli.knex.runtime.jws.dispatcher.JwsDispClass.<init>(JwsDispClass.java:392)
    at com.bea.wli.bpm.runtime.JpdDispClass.<init>(JpdDispClass.java:65)
    at com.bea.wli.bpm.runtime.JpdDispClass.<init>(JpdDispClass.java:55)
    at com.bea.wli.bpm.runtime.JpdDispFile.createPrimaryDispClass(JpdDispFile.java:382)
    at com.bea.wli.knex.runtime.core.dispatcher.DispFile.<init>(DispFile.java:154)
    at com.bea.wli.knex.runtime.jws.dispatcher.JwsDispFile.<init>(JwsDispFile.java:24)
    at com.bea.wli.bpm.runtime.JpdDispFile.<init>(JpdDispFile.java:108)
    ... 34 more

    Hi
    Are you using wli process control?
    That uses wsdl and could cause the issue.
    I also saw couple of internal bugs CR264315 and CR288904 on the same issue on 9.2.
    Since this is a wli issue could you post in the wli newsgroup to get more answers http://forums.bea.com/forum.jspa?forumID=2047 ?
    Also you can open a BEA support case at http://support.bea.com and an wli support engineer would help you. Please refer to the Cr numbers above in your support case.
    Thanks
    Vimala

  • Problem with applet , Not able to detect class file

    Hello friends,
    I have a swing/applet class file, and i am trying to integrate it with Tomcat webapps
    My HTMl code goes like this...........
    <APPLET ALIGN="CENTER"
                   CODEBASE="/../../classes/org/jgraph/"
                   CODE="SimpleGraph.class"
                   WIDTH="800" HEIGHT="500">
                   </APPLET>
    My classes are found inside the code base URL............
    CODEBASE="/../../classes/org/jgraph/"
    My folder structure is like below.....in which "SimpleGraph.class" is found
    D:\June5WF\Archicentro\web\WEB-INF\classes\org\jgraph\SimpleGraph.class
    My HTML resides in the following directory structure...
    D:\June5WF\Archicentro\web\WEB-INF\jsp\secure\admin\ramesh.jsp
    But When I run the JSP page .... I am Getting Class not found exception..........
    Please can anyone tell me how to solve this problem....
    I have spent 4 hrs in this......PLZ help me out.....

    Hi,
    I did not mean file object. I meant workbook object. The problem is that I can not see from your code how do you get that OLE object reference. It should be something like this
    GET PROPERTY OF h_excel 'ActiveWorkbook' = h_workbook.
    CALL METHOD OF h_workbook 'SAVEAS' EXPORTING #1 = l_file
    Regards

  • Loading class file stored in BLOB field

    - I am able to store and retrieve Java files and XML files in and from a BLOB field, but when I store a class file and try and load it using Class Loader, it us unable to load the class. The size of the class file increases by 1 byte when I retrieve it from the database. Is this some security feature by the JVM? Is it not possible to store, retrieve and load a class file from a database table?
    Thanks
    Harini

    Hi,
    First, I would suggest you use fiddler (http://www.telerik.com/fiddler) to compare these two different client requests, second, please try to use Azure Storage Explorer (http://azurestorageexplorer.codeplex.com/) to do
    this instead of the Azure Web Storage Explorer. 
    Best Regards,
    Jambor
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

Maybe you are looking for

  • I NEED Firefox 3.6.25 for my MacBook Pro. The ftp site is gone. How can I get it? I can't upgrade because of my processor.

    The night that Firefox apparently stopped distributing Firefox for Mac 3.6.25, I had a computer crash that corrupted my copy of 3.6.25. I tried to go to the FTP site to get another copy to reload (using Safari) and the FTP site is apparently gone and

  • Problem with answers

    when I connect to Internet and use the Answers/Dashboards it's throwing error like "Internet Explorer cannot display the webpage " and "not supported xml"

  • Odiconsole deployment fails

                        Hi there,   I need your help in configuring my ODI J2EE agent on our FUSION R8 provisioned instance. The below are steps I have followed to configure ODIJ2EE agent however this deployment was never successful and I had experienced

  • Using watched folder

    Hi, I'm having problems with watched folder endpoint.<br /><br />I have a very simple process which consists of one activity - assign task and I want to start this process by copying a PDF to specified folder. I've added a watched folder endpoint for

  • Can we connect Mapview to multidimensional database and retrieve data

    I have zero knowledge on MapViewer and hence I am curious to know, if we can connect MapViewer to multidimensional database(Like Essbase etc...) and retrieve data from them ???