Automatic copying of class file problem

I am using Weblogic 4.5.1 server on NT.
          I have a JSP "main.jsp" in which I am importing a user defined class
          "com.vt.Attribute".
          The Jsp is getting compiled into a servlet in
          "weblogic\myserver\classfiles\jsp_servlet\_jsp" directory. Also the file
          "Attribute.class" is getting placed automatically in directory
          "weblogic\myserver\classfiles\com\vt". Because of this, I am getting a
          ClassCastException, since the serial ids of the two class files will be
          different.
          How can I prevent the automatic copying of the "Attribute.class" into
          "weblogic\myserver\classfiles\com\vt" directory.
          Regards.
          

Remove the package statement in your source code.
          I think this could be the cause.
          Chandra
          "Raghav" <[email protected]> wrote in message
          news:[email protected]..
          > I am using Weblogic 4.5.1 server on NT.
          > I have a JSP "main.jsp" in which I am importing a user defined class
          > "com.vt.Attribute".
          >
          > The Jsp is getting compiled into a servlet in
          > "weblogic\myserver\classfiles\jsp_servlet\_jsp" directory. Also the file
          > "Attribute.class" is getting placed automatically in directory
          > "weblogic\myserver\classfiles\com\vt". Because of this, I am getting a
          > ClassCastException, since the serial ids of the two class files will be
          > different.
          >
          > How can I prevent the automatic copying of the "Attribute.class" into
          > "weblogic\myserver\classfiles\com\vt" directory.
          >
          > Regards.
          >
          >
          

Similar Messages

  • RMI class file problem

    I have already write a RMI example for self-study successfully, but there are a little class file problem that I'm not able fix it.
    In my RMI example there are 3 .java files (RMIServer.java, RMIClient.java and a MethodImpl.java)
    After I have javac and rmic them, I got RMIServer_Skel.class, RMIServer_Stub.class, RMIClient.class and the MethodImpl.class
    In order to run the RMI in a local envirnment, I divide them into 2 folders as listed below:
    Server - RMIServer_Skel.class, RMIServer_Stub.class and the MethodImpl.class
    Client - RMIServer_Stub.class, RMIClient.class and the MethodImpl.class
    Then when I start to run them in a DOC envirnment...
    start rmiregistry........(run successful and another rmiregistry DOC window created)
    java RMIServer.........Exception in thread "main" java.lang.NoClassDefFoundError: RMIServer
    Oops? Class not found? How can that be? And after that, I tried something.......to add the RMIServer.class into the Server folder.
    Again, I start to run them in a DOC envirnment...
    start rmiregistry........(run successful and another rmiregistry DOC window created)
    java RMIServer.........The server is instantiated(run successful and print out a String)
    Um...is the RMI have to run with a RMIServer.class file? But the RMI notes I refered from is not seems to be telling me to do this, are there any one can give me a helping hand?

    please, go here, read thoroughly
    http://java.sun.com/docs/books/tutorial/getStarted/cupojava/index.html

  • Class files problem

    Hi All,
    I am getting a problem in Eclipse.
    Suddenly i am not able to generate the class files in the Eclipse.
    I have checked my build path,removed the jar files and then
    again added.
    But still i am not able to generate the class files.
    Please help

    yes i have unchecked the build
    automatically..........
    i normally right click on the nabigator view and
    then
    click bulid project......please help on what i am
    missingAnd that's suddenly stopped working? How do you know?

  • Class file problem

    i use JCreator LE my java file compiles and run well.......but if I try to run the class file through command prompt it gives an exception as follows......if I build class file using netbeans it works in command prompt
    Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad version n
    umber in .class file
    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)Any idea how to solve this problem??
    thanks

    Thanks now it doesn't give the exception java.lang.UnsupportedClassVersionError in command prompt.
    This time I am facing some different problem
    I made a program about file searching.....when I run this program(to search files in hardisk) in JCreator LE no exception is shown. But when I run this using command prompt at one stage it gives an java.lang.NullPointerException. I dont think there is a problem with the code.
    Any help will be appreciable.
    java version "1.6.0"
    Java(TM) SE Runtime Environment (build 1.6.0-b105)
    Java HotSpot(TM) Client VM (build 1.6.0-b105, mixed mode, sharing)
    Classpath is same for JCreator LE and command prompt

  • JWS is not automatically reload the class files

    Hi,
    My problem is whenever i deploy new code in the server, My client JVM is not taking the updated code. It uses the old classes from the JVM cache. How to solve this poblem? can anyone help me :)

    >
    My problem is whenever i deploy new code in the server, My client JVM is not taking the updated code. It uses the old classes from the JVM cache. How to solve this poblem? >Time stamps on servers can delay download. The new code will not run until the time after it is downloaded (and the program is restarted). Otherwise I have found automatic update to be quite reliable.
    Have you checked that your JNLP file is valid? What is the URL of the launch file?

  • Verifying .java and .class files match

    I have a bit of a strange situation in a team-working environment where many developers copy code to a production server. None of this code is in a Version Control System and I have been given the task of getting it into one (I've chosen Subversion, but that isnt important)
    The problem is, its not as simple as doing a full commit of the production server because developers may have copied edited .class files onto the server, but not copied edited .java (therefore the .java file is not the same as the .class file)
    Because the server has hundreds (if not thousands) or java and class files, I cant just decompile each of the class files and manually see if they match the java files, so I'm asking, is there a tool that can verify a java file matches a class file of the same name in terms of version (or if not is there an easier way of doing it than the decompile method)?
    Thanks in advance

    Years ago I had to do something very much like this...and now I'm trying to recall how we did it (and for that matter whether it worked)...and I'm having trouble recalling. Ah, that's what happens when you read forums out of insomnia.
    Of course, you can do a baseline check by just checking the file timestamps. Also instead of decompiling the class files you can try re-compiling the source code, and then generating checksums on both class files to see if they're the same.
    You might be able to use BCEL (http://jakarta.apache.org/bcel/) to extract some useful information out of the class files. As I recall I tried this but the data wasn't useful for this kind of project, but maybe I'm misremembering. It's worth looking into.

  • My server still taking old class file

    Hi,
    I have got a J2EE application.
    In that I have to modify a Java file.
    I made the required changes and check it in the local test environment and find that it is working fine and the changes are reflecting in my application.
    Then I copied the class file in the main server and deploy the server(i m using oracle9i server) .
    After successful depletion ''THE CHANGES WERE NOT REFLECTED IN THE APPLICATION ".
    I found the latest class file is copied in the application(checked the class file using D-Complier).
    MY PROBLEM IS : WHY THE SERVER IS NOT TAKING THE LATEST CLASS FILE ??
    IS THERE ANY PROBLEM OF WEB-CACHING ??
    kindly advise how can i rectify it.
    keep smiling.....
    Debasis

    The last response is correct. You have to stop the server and start it again to reflect the changes in the class file. Only the JSP files can be changed dynamically while server is running as the container compiles it if there is any change in the file. All other files need a server restart.
    Thanks

  • Unable to run a .class file w/ javaw

    I created a simple application which uses swing gui.
    This application works just fine when I click the "run" button in eclipse.
    But as soon as i copy the .class file from the eclipse project folder to somewhere else and try to run it with "javaw myclass" (the filename is myclass.class) nothing happens.
    No command not found error, no nothing.
    Its like javaw finds and executes the .class and then returns to the command prompt... But I dont see any windows or any sign of my program running.
    Thx in advance

    When run with just java I get this:
    C:\>java myclass
    Exception in thread "main" java.lang.NoClassDefFoundError: myclass$1
    at myclass.<init>(myclass.java:38)
    at myclass.<init>(myclass.java:28)
    But I Eclipse it works just fine...
    What does Eclipse do that I dont?

  • Is it possible to refer class files by mapping network drive?

    Hi,
    Is it possible to refer class files from the server(By mapping network of client's server) and specify this in project setting. If yes, how?
    Right now I copied all class file needed, to 'myclasses' directory of jdevhome. this approach is working fine but the page is taking 20 to 30 minutes to refresh.
    What could be probable reason for taking this much time to refresh a page? what could be alternative for this?
    Will the mapping of drive and referring it will improve the performance?
    I am connected to server through VPN and using Window based JDeveloper.
    Regards,
    Adarsh

    Hi Adarsh,
    For the first part of your query, You can create a new Library in Project Settings to refer to the server classes.
    As for the performance issue, there could be many reasons. Do you really think class loading is the only reason for the same? You might want to check in the Log window as to which process is eating up your time before loading the page.
    ~Srinath.

  • Getting Package Name From Class File Without Parsing File

    I am writing an application where I need to get the package name from a class file without parsing the class file itself.
    Basically, what happens is the user chooses a class file from anywhere in the file system. I then want to use reflection to get information about that class. To do that I need the fully qualified class name. I know that the package name is part or all of the path name but I don't know for sure which part it is. I don't want to parse the class file directly for the package name in case the class file spec is changed (that way I won't have to rewrite any code).
    Does Java have any way of getting this information without doing something stupid like gradually stripping off part of the pathname and trying it?

    The ClassLoader way seems to work fine, copy a class file to "A.class" and run this:import java.io.*;
    class ClassLoaderExample {
        public static void main(String[] args) throws Exception {
            class MyClassLoader extends ClassLoader {
                public Class load() throws IOException {
                    File f = new File("A.class");
                    byte[] classData = new byte[(int) f.length()];
                    new RandomAccessFile(f, "r").readFully(classData);
                    Class loaded = defineClass(null, classData, 0, classData.length);
                    resolveClass(loaded);
                    return loaded;
            Class c = new MyClassLoader().load();
            System.out.println(c);
            System.out.println(c.newInstance());
    }

  • Copying a new .class file for WLS to use, proper way?

    Hello. I'm doing some servlet development and I would like to know what is
    the proper way to deploy any .class files and servlets (also .class files)?
    If I just copy them into the proper directory, am I supposed to have to
    restart the server? Is that normal, or should WLS just pick up the new one?
    It does that with JSPs, can it do that with servlets and supporting classes?
    Thanks.

    I found out that I was copying the wrong file to the right place (.java
    instead of the .class :<). So once I fixed that small little :> problem, I
    was off and running. Thank you for your help! :>
    "Slava Imeshev" <[email protected]> wrote in message
    news:[email protected]..
    Hi Peter,
    Normally weblogic will redeploy automatically application, either web
    or ejb, without restarting the server, when it's copied to applications
    directory on the server. Applications should be properly packaged.Servlets
    and supported files should be in war file, ejb-s in ejb-jar files.
    I'm not sure if it would work right for plain unpacked class files.
    Regards,
    Slava Imeshev
    "PeterH" <!REMOVEBeforeSending! > wrote in message
    news:[email protected]..
    Hello. I'm doing some servlet development and I would like to know whatis
    the proper way to deploy any .class files and servlets (also .classfiles)?
    If I just copy them into the proper directory, am I supposed to have to
    restart the server? Is that normal, or should WLS just pick up the newone?
    It does that with JSPs, can it do that with servlets and supportingclasses?
    Thanks.

  • Create folder and copy files problem

    Hello all indesign script Members
    where I work we use a permanent folder structure for an example
    a jobnumber called "123123"
    I have wrote a little interface called interface.jsx, this file is saved and located in
    123123/scripts/interface
    I want my interface to navigate two folders up
    to 123123/source/ creates  a folder called "hej" so result is "123123/source/hej"
    then I can pick from a little dialog box the folder 123123/source/a/ copy all .indd files to the folder hej (or any other folder I choose from the dialog box)
    I want the script to know the active path instead of whole locations because, we have different project numbers all the time.
    then run an extern script called hej.jsx
    the best should be also if the script could chose 123123 as default jobnumber too.
    Please could  someone help me to script this?
    /get started I am very newbie
    Thank you so much in advance
    All Adobe Members

    Hi tjacobs01,
    Thanks for reply. I didnt include main method since i dont want to make the problem looks too complicated. I called both of the methods in main. The following is the simplified class code including main method.
    import java.io.File;
    import java.io.IOException;
    public class TestClass{
    public void buildFolder(){
    File f=new File("/documents/hospital_backup");
    if(f.exists()==false){
    f.mkdirs();
    public void copyFile(String file){
    String form_cmd="cp /job_holding/hospital/" + file + " /documents/hospital_backup/"+file;
    String[] command = new String[]{"sh", "-c", form_cmd};
    try{
    Runtime r=Runtime.getRuntime();
    Process p =r.exec(command);
    BufferedReader in = new BufferedReader(new InputStreamReader(p.getInputStream()));
    String line = null;
    while ((line = in.readLine()) != null) {
    System.out.println(line);}
    int exitVal=p.waitFor();
    System.out.println("Process exitValue:"+exitVal);
    }catch(Exception e){System.out.println(e);}
    public static void main(String[] args) {
    String dir_root="/job_holding/hospital/";
    File f=new File(dir_root);
    File[] fList = f.listFiles();
    for (int i=0; i<fList.length; i++)
    String file=dir_root+fList.getName();
    TestClass test = new TestClass();     
    test.buildFolder();
    test.CopyFile(file);

  • Problem in copy 2 WORD files to a new WORD file

    Hi
    I have a problem in copy 2 WORD files to a new WORD file -
    i.e. the text of the new WORD file suppose to be composed from the text of the 2 original WORD files.
    Unfotunately I get a new WORD file which i can't open, or a file which contains strange simbols in it.
    So far i succeded in copy one WORD file to a new WORD file , using - FileOutputStream and FileInputStream, the code is:
    import java.io.*;
    public class IOStreamDemo {
    public static void main(String[] args)throws IOException {
    InputStream in2 = new FileInputStream("fruit.doc");
    OutputStream out2 = new FileOutputStream("dst2.doc");
    // Transfer bytes from in2 to dst
    byte[] buf2 = new byte[1024];
    int len2;
    while ((len2 = in2.read(buf2)) > 0) {
    out2.write(buf2, 0, len2);
    in2.close();
    out2.close();
    Does sombody know how to do it properly?
    Thanks

    dear friend
    I just create two word file one is fruit.doc and other
    is dst2.doc
    after that i write some lines in fruit.doc
    then I just execute your code.
    after that I open dst2.doc
    then I found it as exact copy of fruit.doc
    I doesn't get any junk text.
    Your code is working absolutely fine.No it is not. Add som styling, headers, index etc to the docuements, and then try to run the code. It's not possible to just append two word documents. You have to parse the files and read relevant information, and then create a new valid document with that information.
    /Kaj

  • Purchased a song from iTunes, i tried to transfer it to my itouch, but i received an error "iTunes could not copy because the file could not be converted". how do i convert the song (well, i thought it will automatically be converted)?

    purchased a song from iTunes, i tried to transfer it to my itouch, but i received an error "iTunes could not copy because the file could not be converted". how do i convert the song (well, i thought it will automatically be converted)?

    Problem Fixed:
    Remove the song from your itunes library, then go to the itunes store and try to download it again. It will say something like "this song has already been purchased, would you like to download it again for free?". Click yes, and it will download again. This worked for me, hope it helped

  • Does itunes automatically copy files to its folder?

    If I download music from a website to my desktop, and then doubleclick the icon on my desktop, it starts playing in itunes. But it also looks like it saves a copy of the file in the itunes music folder. Can i just safely delete the files off my desktop now (and still play the music in future) because they have been automically copied into the itunes folder?
    Also, is there a way to turn this feature off, so that I can still play the music by clicking on the icons on the desktop, but itunes doesn't automatically copy the files into its folder?

    Hi Jeff,
    iTunes does put a copy of the song in your Music Folder, and yes, you can delete the file off your Desktop as soon as it opens in iTunes, I'll take a minute now to see if you can turn off the automatic copying feature.
    Edit:
    You can turn off the auto-copy setting by going to iTunes-Preferences-Advanced-uncheck the box next to "Copy files to iTunes Music Folder when adding to library"

Maybe you are looking for

  • Planned orders are not converted into process orders in ECC.

    Dear All, The issue is that Planned orders with conversion tick are not publishing in ECC as manufacturing orders. We did check the relevant master data consistency between APO and ECC and it seems fine. We have tried to send the conversion from APO

  • Help will not load games on new classic ipod

    I purchase a game that showes up in i tunes but will not load into my new i pod classic. when i pull it up in itunes above the game symbol it says I pod fifth gen. I have a grey ipod so i know it is a classic. it just dosen't load onto the ipod when

  • Facing problem with running exe from my java code

    Hello, I have to run the exe from java code for which I m using Runtime and Process classes. The exe runs in the following way on command line C:/ myexe -j [now press enter] input sentence followed by ! [now press enter] And after this exe gives the

  • Could not create WMI locator class (80040154) - Win7 x64 OSD

    Hello All, I'm attempting to deploy a Win7 x64 OS to a Dell Optiplex 3010 through SCCM 2012 via PXE, a process I've done many times in the last few months. All of a sudden, on this one machine, I can't get it to work. The first strange thing that hap

  • FileDialog() +how to remember the last location in Windows NTand Win98?

    Hi, folks: I used FileDialog() to open file, I need to remember the last location which is opened in the last time loaded. In windows 2000 and XP, it works fine. However, in Windows 98 and NT, it never remeber the last location, instead always return