FileSaveService and StringBufferInputStream and jdk1.5

For anyone who's seen the examples,
What do we do about the deprecation of th StringBufferInputStream for jdk1.5? None of the examples I've found show an alternative to StringBufferInputStream for saving data through the FileSaveService.
Any help is greatly appreciated as I'd like to run my app under jdk1.5.
Cheers,
Steve

You have to use a ByteArrayInputStream together with the method String.getBytes() to do that.
String contents= new String("File Contents");
ByteArrayInputStream inputStream = new ByteArrayInputStream(contents.getBytes());
And it should works fine.

Similar Messages

  • JDeveloper 3.1 and JDK1.2.2: are they REALLY compliant?

    Hi,
    I've already been developing in JDev 3.0 using Java 1.1.8 for a few months and have a number of EJB's deployed in an Oracle8i 8.1.5 database. These are accessed by a servlet which is called from a C++ application in order to populate the db tables. I'm using Java Webserver 2.0 and everything works fine.
    I've been upgrading to Java 2 with JDev 3.1, Oracle 8i R2, and JDK1.2.2. Everything again works fine when I am testing and debugging in the JDev 3.1 IDE but when I deploy to the Web server, my context lookup for the EJB published name freezes, returns an error status to the C++ app but does not display any error/exception msgs in the server console/log files.
    On investigating I found that the java.exe bundled with JDev 3.1 as the JDK1.2.2 version is actually NOT the java.exe that has been dispatched with the release version of JDK1.2.2! There are however two files in the bin directory of the JDK1.2.2 called oldjava.exe and oldjavaw.exe which correspond to the ones bundled with JDev 3.1?
    Could someone please explain what is going on? As it stands at the moment the version of java.exe with JDK1.2.2 does not work for my EJB's but if I replace it with the oldjava.exe, it works fine. Does this mean that JDev 3.1 is NOT actually JDK1.2.2 compliant or have I done something wrong?
    This is potentially a major problem for our projects so if anyone at Oracle has any info it would be greatly appreciated.
    Cheers
    Dave

    David,
    I changed Sun Java 1.2.2 VM to JDeveloper 3.0 1.1.8 VM and now I get this:
    [Root exception is java.lang.ClassNotFoundException: EJBBibles.BibleSearchHomeHelper]javax.naming.Na
    mingException: Unknown reasons
    at oracle.aurora.jndi.sess_iiop.SessionCtx._activate(SessionCtx.java:82)
    at oracle.aurora.jndi.sess_iiop.SessionCtx.activate(SessionCtx.java:276)
    at oracle.aurora.jndi.sess_iiop.ServiceCtx.lookup(ServiceCtx.java:320)
    at oracle.aurora.jndi.sess_iiop.sess_iiopURLContext.lookup(sess_iiopURLContext.java:215)
    at oracle.aurora.jndi.sess_iiop.sess_iiopURLContext.lookup(sess_iiopURLContext.java:201)
    at javax.naming.InitialContext.lookup(InitialContext.java:288)
    at EJBBiblesServlet.Servlet1.init(Servlet1.java:36)
    at org.apache.tomcat.core.ServletWrapper.initServlet(ServletWrapper.java:315)
    at org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java:445)
    at org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java:597)
    at org.apache.tomcat.servlets.InvokerServlet.service(InvokerServlet.java:257)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java:503)
    at org.apache.tomcat.core.ContextManager.service(ContextManager.java:559)
    at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHand
    ler.java:160)
    at org.apache.tomcat.service.TcpConnectionThread.run(SimpleTcpEndpoint.java:338)
    at java.lang.Thread.run(Thread.java:466)
    If I use JDev 1.2 VM, I get this:
    javax.naming.NotContextException: fumaca:2481:eatg/test/BibleSearchRemote
    java.lang.Object oracle.aurora.jndi.sess_iiop.sess_iiopURLContext.lookup(javax.naming.Name)
    java.lang.Object oracle.aurora.jndi.sess_iiop.sess_iiopURLContext.lookup(java.lang.String)
    java.lang.Object javax.naming.InitialContext.lookup(java.lang.String)
    void EJBBiblesServlet.Servlet1.init(javax.servlet.ServletConfig)
    void org.apache.tomcat.core.ServletWrapper.initServlet()
    void org.apache.tomcat.core.ServletWrapper.handleRequest(org.apache.tomcat.core.Request, org
    .apache.tomcat.core.Response)
    void org.apache.tomcat.core.ServletWrapper.handleRequest(org.apache.tomcat.core.HttpServletR
    equestFacade, org.apache.tomcat.core.HttpServletResponseFacade)
    void org.apache.tomcat.servlets.InvokerServlet.service(javax.servlet.http.HttpServletRequest
    , javax.servlet.http.HttpServletResponse)
    void javax.servlet.http.HttpServlet.service(javax.servlet.ServletRequest, javax.servlet.Serv
    letResponse)
    void org.apache.tomcat.core.ServletWrapper.handleRequest(org.apache.tomcat.core.Request, org
    .apache.tomcat.core.Response)
    void org.apache.tomcat.core.ContextManager.service(org.apache.tomcat.core.Request, org.apach
    e.tomcat.core.Response)
    void org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(org.apache.tomca
    t.service.TcpConnection, java.lang.Object[])
    void org.apache.tomcat.service.TcpConnectionThread.run()
    void java.lang.Thread.run()
    Which means that there is a difference relative to the VM version.
    All the names are correct on 8i deployment. And all necessary files are on classpath, (including the EJB source and generated jars, that are also in the /lib on the context dochome).
    Any thoughts?
    Thanks,
    Eduardo
    null

  • Log4j and jdk1.5

    log4j-1.2.8 and jdk1.5
    they don't seem to work together? too many errors/warnings
    any solutions?

    hehe
    thats a good solution thnx :)
    what i actually meant to ask was ... is there a way for jdk1.5 to work with log4j

  • Weblogic NT Service 4.5.1 and Jdk1.2.2

    I am trying to set up the Weblogic NT Service with 4.5.1 SP9 and
    jdk1.2.2.
    When I use t3config to set up my JAVA_HOME with e:\jdk1.2.2 instead of
    using the -jre 1.2 I get an error saying that javai.dll can't be found.
    The problem is javai.dll is a jdk1.1.7B module. Has anyone else had
    this problem.
    Thanks,
    Mike Ball
    [email protected]

    It doesn't even get that far, java.exe can't start because it is looking for
    a jdk1.1.7b dll
    Mauricio Del Moral wrote:
    Trying setting
    -Djava.library.path=d:\weblogic\bin
    when server starts.
    I think you had jdk1.1.7B installed before, right?.
    Michael Ball <[email protected]> wrote:
    I am trying to set up the Weblogic NT Service with 4.5.1 SP9 and
    jdk1.2.2.
    When I use t3config to set up my JAVA_HOME with e:\jdk1.2.2 instead of
    using the -jre 1.2 I get an error saying that javai.dll can't be found.
    The problem is javai.dll is a jdk1.1.7B module. Has anyone else had
    this problem.
    Thanks,
    Mike Ball
    [email protected]

  • Difference between jdk1.3 and jdk1.4 and jdk1.5

    Hi All
    1: I wud like to know the difference between jdk1.3 and jdk1.4 and jdk1.5. I could not recoginze the correct answer for this.. mostly i need the added advantages for version of JDK..
    2: I wud also like to know difference in J2SE and J2EE.
    Thanks in advance

    while I can't tell you exclusively the differences, other than more methods have been added and some have been deprecated, from version to version, that is at least one difference.
    I know several like me are reluctant at the moment to jump on up to 1.5, for fear of (and reasonably so) making their current apps go haywire!
    Mine did just the other day when I tried to upgrade the JDK from 1.4.0 to 1.4.2.12!! It hosed everything.
    J2SE is the Standard Environment, and J2EE is the Enterprise environment, which at the very least allows for things like the java Mail interface, using servlets and classes with the HTTP environment!
    I'm sure many other posters could more accurately and specifically give you some other criterion of differences and advantages.

  • JDev 10.1.3 and JDK1.2.2 use javac problem

    I have an old application that I need to compile in 1.2.2, and have tried the "use javac" checkbox on the project properties compile page. The compiler seems to run, but there is an intential error in the code. I put it there, because the class file didn't seem to get generated. I tried this on command line, and apparently '-source' is an invalid option in 1.2.2.
    E:\jdk1.2.2\bin\javac.exe -J-mx512m -verbose -source 1.2 -target 1.2 -encoding Cp1252 -g -classpath E:\jdk1.2.2\jre\lib\rt.jar;E:\jdk1.2.2\jre\lib\i18n.jar;E:\jdk1.2.2\jre\classes;E:\app\codebase;E:\oracle\jdev1013\j2ee\home\lib\ojsp.jar;E:\oracle\jdev1013\j2ee\home\jsp\lib\taglib\ojsputil.jar;E:\oracle\jdev1013\j2ee\home\oc4j.jar;E:\oracle\jdev1013\j2ee\home\lib\oc4j-internal.jar;E:\oracle\jdev1013\j2ee\home\lib\servlet.jar;E:\oracle\jdev1013\jdev\lib\ojc.jar -sourcepath E:\app\src -d E:\PTC\Windchill\codebase @C:\DOCUME~1\gteft\LOCALS~1\Temp\javac30279.tmp
    [1:53:55 PM] Successful compilation: 0 errors, 0 warnings.
    Has anyone else run into this?
    Any help or thoughts on how to adjust this behavior for 1.2.2's javac would be appreciated.

    Thank you for responding. I am aware of (and frustrated by) issues and limitations due to this application's dependancies on an aging platform, and would upgrade if it were my choice. The dependancy is in the vendor's API, and not in code that I can change.
    As the invalid option was not captured as a message or counted as an error, I thought that perhaps this could be a potential issue for using javac with any version.
    I was hoping to see if there were additional settings controlling the command line options that I couldn't find.
    Thanks,
    Greg

  • Installation failed with Windows Vista and JDK1.602

    Hi All,
    Appreciate any help to resolve the following installation error on my Windows Vista system with JDK1.602
    Pop-up Error Message:
    The installer is unable to run graphical mode. Please check the value of the DISPLAY environment varibale.
    Thanks,
    CP

    JSE8.1 (based on NetBeans 5.0) is not supported on Vista. You may want to consider using the latest NetBeans 5.5.1. (NetBeans is where all future development is planned for).
    http://forum.java.sun.com/thread.jspa?threadID=5192837
    From the release notes of NB551:
    # Issue #85361: NetBeans 5.5 installer does not start on Windows Vista.
        Description: On systems running Windows Vista, the NetBeans 5.5 installer fails to start
    and a message suggesting running with the "silent" or "console" flag appears.
        Workaround: To correct this, run the installer on JDK 6.0 build 96 or newer.
        If you encounter further difficulties, disable Compatibility Mode manually. You can do
    this by right-clicking the .exe installer file and choosing Properties from the pop-up menu,
    then deselecting Compatibility Mode in the Compatibility tab of the File Properties dialog.
    Note that if Compatibility Mode was turned on automatically, it is necessary to disable it
    for both the current user AND all users. To do so, click the "Show Settings for All Users"
    button, then deselect the Compatibility Mode checkbox in the "Compatibility for All Users"
    dialog.You can try the same workaround for installing jse8.1, to see if that works. But, it is an older version that is not supported on vista and hence my suggestion to consider a later version of NB.

  • EJB and Jdk1.5 problem

    We are trying to migrate jdk 1.4 (wl 8.1) to jdk1.5 (wl 9.1), when we complie Java source code and build EJB ( using Ant/build.xml), we got following error and can not proceed any further.
    [java] /home/fipdev/DeltaOne/newproductimport/ejbcgen/com/leh/deltaone/ejb/business/newproductimport/DONewProductImportAccessor_41o8gs_Impl.java:12: cannot access com.leh.deltaone.ejb.business.newproductimport.DONewProductImportAccessorBean
    [java] bad class file: /home/fipdev/DeltaOne/newproductimport/ejbcgen/com/leh/deltaone/ejb/business/newproductimport/DONewProductImportAccessorBean.class
    [java] class file has wrong version 49.0, should be 48.0
    [java] Please remove or make sure it appears in the correct subdirectory of the classpath.
    [java] extends DONewProductImportAccessorBean
    [java] ^
    [java] 1 error
    [java] Exec failed .. exiting
    [java] Java Result: 1
    49.0 means using jdk1.5 and 48.0 means using jdk1.4, we do use jdk 1.5 in our development server and could verify by
    bash-2.03$ java -version
    java version "1.5.0_06"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
    Java HotSpot(TM) Server VM (build 1.5.0_06-b05, mixed mode)
    do you know why?
    Michael Zou

    Much appreciated your reply, I used both Windows and Unix system and Ant to build EJB, both CLASSPATH and PATH are configured to Jdk 1.5 version.
    CLASSPATH=C:\bea\jdk150_06\lib and PATH=C:\bea\jdk150_06\bin, and verify that it is 1.5 not 1.4 version.
    C:\Eclipse_WorkSpace\DeltaOne\ant>java -version
    java version "1.5.0_16"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16-b02)
    Java HotSpot(TM) Client VM (build 1.5.0_16-b02, mixed mode, sharing)
    but still getting error, any an idea? thank you again.
    Michael

  • JDeveloper 10.1.3.5.0 and jdk1.7.0_06

    Hi,
    I'm trying to use JDeveloper 10.1.3.5.0 with jdk1.7.0_06 and i'm getting the error "Unable to launch the Java Virtual Machine" at path... when trying to launch JDeveloper.
    I checked the path and jvm.dll is on the right path : path\jdk1.7.0_06\jre\bin\client\jvm.dll.
    I changed the jdev.conf with SetJavaHome set to path\jdk1.7.0_06.
    What other configuration should I make ?
    How do I know which Java version is supported by this version of JDeveloper ?
    Thank you for your help...
    Cheuyi

    Read the install guide for your version and you'll see that 10.1.3 is not certified with JDK 1.7
    Try using JDeveloper 11.1.1.6 instead.

  • How to connect oracle10g and jdk1.6.0_15

    Hi All,
    I'm using jdk1.6.0_15 and oracle10g.When i trying to connect using the following JDBC connection code:
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    con=DriverManager.getConnection("jdbc:odbc:dsn name","userid","pwd");
    I got the SQLException like:
    Specified driver could not be loaded due to system error 1114 (Oracle in OraClient10g_home2).
    Any help to resolve this.?
    Thanks in advance..!
    regards
    sowm

    Hi,
    How to use the oracle.jdbc.OracleDriver driver.? Do i have to download this driver and initialize.?
    Need help on how to set this driver.?
    regards
    sowm

  • JTable 's tableChanged() works differently in jdk1.2.2 and jdk1.3

    While updating the contents of the jtable I am using the following
    table.tableChanged(new TableModelEvent(model));
    table.repaint();
    In jdk1.2.2, this updates the contents and repaints the table without clearing the row selection
    But the same in jdk1.3 updates and repaints the table but clears the row selection.
    How can I overcome with problem.
    I also tried model.fireTableStructurChanged();
    along with this but it works in jdk1.2.2 and not in jdk1.3.
    Any suggestion is greatly appreciated.
    Thanks

    They have fixed a bug. If you are replacing the whole table, then the row selection for the old table doesn't mean anything for the new table. In fact, that row might not even exist any more.

  • Is it j2ee.jar and jdk1.5.0.jar same

    when i search for j2ee.jar in google it is showing jdk1.5
    but link is j2ee.jar download.
    is it same.in my tutorial they are saying download j2ee.jar
    if it differ ples send me link for download.

    Check that Eclipse itself is running with the right VM.
    This is from the Windows readme (but Linux is similar) "Here is a typical
    Eclipse command line:
    eclipse -vm c:\jdk1.4.2\jre\bin\javaw -vmargs -Xmx256M
    Tip: It's generally a good idea to explicitly specify which Java VM to use when
    running Eclipse. This is achieved with the "-vm" command line argument as
    illustrated above. If you don't use "-vm", Eclipse will look on the O/S path. When
    you install other Java-based products, they may change your path and could
    result in a different Java VM being used when you next launch Eclipse."
    In your case you would give it the path to your new java executable.
    (I am assuming you can compile OK from the command line.)

  • 10g and jdk1.5

    1) is it possible to use the generic compiler with 10g preview ?
    2) will the release version have some support for jdk1.5 ?
    I think it could attract many people to 10g to have support for jdk1.5 VERY soon. I don't want to wait several months like I did for jdev to support jdk1.4.
    The release of 10g is close to the release of jdk1.5 (in beta). A great opportunity.

    According to javalobby, jdk 1.5 early access is for this week.
    I'd like to play with it in my holiday in end of december.
    "On a completely separate note, we have been receiving a good deal of email lately asking for details on the upcoming early access release of the preliminary J2SE 1.5 binaries. I spoke today with the product line manager at Sun directly responsible for this, and she confirmed that they are pushing as hard as they can to get the release out the door for Javalobby members. The latest word is that the target date is December 15, but that in no case will it be later than December 22 when Sun begins its holiday break. The purpose of this early access release is for Javalobby members to help provide valuable testing and uncover and remaining bugs in the J2SE 1.5 code, so please keep in mind that this is PRE-RELEASE code and that you cannot expect it to be perfect. I'm excited that Sun is making this opportunity available exclusively to Javalobby members, so I hope you'll make the most of it and help improve Java in the process."

  • JIT and jdk1.5

    Hi Everyone,
    I am working with a code sample from a text on multi-threading and the book explains that the code will have different outputs (using jdk1.2) if the JIT (Just-In-Time) compiler is turned on or off. I am finding that whilst running this code using jdk1.5 the output is identical regardless of whether or not the compiler is turned on.
    The two command line arguments that I am using to run this program look like the following:
    java Volatile
    java -Djava.compiler=NONE Volatile
    The "java" command does not complain so I figure that the syntax for the commands must be ok. Also I have run the code many times to try and see any differences introduced by the thread scheduler. The code for the Volatile class follows:
    public class Volatile extends Object implements Runnable
         private int value;
         private volatile boolean missedIt;
         private long creationTime;
         public Volatile()
              value = 10;
              missedIt = false;
              creationTime = System.currentTimeMillis();
         public void run()
              print("entering run()");
              //each time, check to see if 'value' is different
              while(value < 20)
                   // Used to break out of the loop if change to
                   // value is missed.
                   if(missedIt)
                        int currentValue = value;
                        // Simply execute a synchronized statement on an
                        // arbitary object to see the effect.
                        Object lock = new Object();
                        synchronized(lock)
                             // do nothing
                        int valueAfterSync = value;
                        print("in run() - see value=" + currentValue + ", but rumour has it that it changed!");
                        print("in run() - valueAfterSync=" + valueAfterSync);
                        break;
              print("leaving run()");
         public void workMethod() throws InterruptedException
              print("entering workMethod()");
              print("in workMethod() - about to sleep for 2 seconds.");
              Thread.sleep(2000);
              value = 50;
              print("in workMethod() - just set value=" + value);
              print("in workMethod() - about to sleep for 5 seconds.");
              Thread.sleep(5000);
              missedIt = true;
              print("in workMethod() - just set missedIt=" + missedIt);
              print("in workMethod() - about to sleep for 3 seconds.");
              Thread.sleep(3000);
              print("leaving workMethod()");
         private void print(String msg)
              // This method could have been simplified by using
              // functionality present in the java.text package,
              // but did not take advantage of it since that package
              // is not present in JDK1.0
              long interval = System.currentTimeMillis() - creationTime;
              String tmpStr = "    " + (interval / 1000.0) + "000";
              int pos = tmpStr.indexOf(".");
              String secStr = tmpStr.substring(pos - 2, pos + 4);
              String nameStr = "     " + Thread.currentThread().getName();
              nameStr = nameStr.substring(nameStr.length() - 8, nameStr.length());
              System.out.println(secStr + " " + nameStr + ": " + msg);
         public static void main(String[] args)
              try{
                   Volatile vol = new Volatile();
                   // slight pause to let some time elapse
                   Thread.sleep(100);
                   Thread t = new Thread(vol);
                   t.start();
                   // slight pause to all run() to go first
                   Thread.sleep(100);
                   vol.workMethod();
              }catch(InterruptedException x){
                   System.err.println("one of the sleeps was interrupted.");
    }Are there any changes to the JIT in later versions of the jdk that I should be aware of. Thanks heaps for your assistance.
    Regards
    Davo

    Options to the Java Virtual Machine have changed quite a bit with different versions. Indeed, the result should be the same for all VMs and all options.
    Note that using the -Djava.compiler=NONE option simply passes a property on to the runtime and there's no guaranty that it is at all used or taken into account.
    For more information on JVM versions and options, read http://java.sun.com/docs/hotspot/
    -Alexis

  • Can't start WebLogic Server with SP6 and jdk1.2.2 using WebLogic Console

    Hi All,
    I am trying to install WebLogic 5.1 with SP6 under Windows NT 4.0 with SP6. My goal is to run JSP/Servlets. After going through all the steps described in SP6 Readme I am getting th following exception:
    ava.lang.reflect.InvocationTargetException: java.lang.NoSuchMethodError: weblogic.boot.ServerClassLoader: method getClassLoadNotify()Lweblogic/boot/ClassLoadNotify; not found
         at weblogic.utils.classloaders.GenericClassLoader.<init>(GenericClassLoader.java:140)
         at weblogic.utils.classloaders.GenericClassLoader.<init>(GenericClassLoader.java:112)
         at weblogic.utils.classloaders.GenericClassLoader.<init>(GenericClassLoader.java:104)
         at weblogic.utils.classloaders.RecursiveReloadOnModifyClassLoader.<init>(RecursiveReloadOnModifyClassLoader.java:53)
         at weblogic.utils.classloaders.RecursiveReloadOnModifyClassLoader$SingleSlave.<init>(RecursiveReloadOnModifyClassLoader.java:149)
         at weblogic.servlet.internal.ServletContextImpl.setClassLoader(ServletContextImpl.java:1408)
         at weblogic.servlet.internal.ServletContextImpl.<init>(ServletContextImpl.java:518)
         at weblogic.t3.srvr.HttpServer.initServletContexts(HttpServer.java, Compiled Code)
         at weblogic.t3.srvr.HttpServer.start(HttpServer.java:388)
         at weblogic.t3.srvr.T3Srvr.start(T3Srvr.java, Compiled Code)
         at weblogic.t3.srvr.T3Srvr.main(T3Srvr.java:827)
         at java.lang.reflect.Method.invoke(Native Method)
         at weblogic.Server.startServerDynamically(Server.java:99)
         at weblogic.Server.main(Server.java:65)
         at weblogic.Server.main(Server.java:55)
    The installation document is pretty bad intermixing different types of installations. Where can I find steps or what do I need to do to get WebLogic to run with JDK1.2.2 if I want to start it up from WebLogic console only?
    Thanks,
    Mark.

    Try rather using the 1.4 version available here: http://java.sun.com/j2ee/1.4/
    and use this dedicated forum: http://forum.java.sun.com/forum.jsp?forum=136
    -Alexis

Maybe you are looking for