Socket.getOutputStream must precede the socket.getInputStream?!? Why?

This is server code.......
import java.io.*;
import java.net.*;
import java.util.*;
public class DateServer extends Thread {
   private ServerSocket dateServer;
   public static void main(String argv[]) throws Exception {
     new DateServer();
   public DateServer() throws Exception {
     dateServer = new ServerSocket(3000);
     System.out.println("Server listening on port 3000.");
     this.start();
   public void run() {
     while(true) {
       try {
        System.out.println("Waiting for connections.");
        Socket client = dateServer.accept();
        System.out.println("Accepted a connection from: "+
client.getInetAddress());
        Connect c = new Connect(client);
       } catch(Exception e) {}
class Connect extends Thread {
   private Socket client = null;
   private ObjectInputStream ois = null;
   private ObjectOutputStream oos = null;
   public Connect() {}
   public Connect(Socket clientSocket) {
     client = clientSocket;
     try {
      ois = new ObjectInputStream(client.getInputStream());
      oos = new ObjectOutputStream(client.getOutputStream());
     } catch(Exception e1) {
         try {
            client.close();
         }catch(Exception e) {
           System.out.println(e.getMessage());
         return;
     this.start();
   public void run() {
      try {
         oos.writeObject(new Date());
         oos.flush();
         // close streams and connections
         ois.close();
         oos.close();
         client.close();
      } catch(Exception e) {}
}This is client code....
import java.io.*;
import java.net.*;
import java.util.*;
public class DateClient {
   public static void main(String argv[]) {
      ObjectOutputStream oos = null;
      ObjectInputStream ois = null;
      Socket socket = null;
      Date date = null;
      try {
        // open a socket connection
        socket = new Socket("127.0.0.1", 3000);
        // open I/O streams for objects
        oos = new ObjectOutputStream(socket.getOutputStream());
        ois = new ObjectInputStream(socket.getInputStream());
          System.out.println( "BAU!" );
        // read an object from the server
        date = (Date) ois.readObject();
        System.out.print("The date is: " + date);
        oos.close();
        ois.close();
      } catch(Exception e) {
        System.out.println(e.getMessage());
}OK.
Those work just fine. Now if you put socket.getInputStream before the socket.getOutputStream then it hangs!
Any ideea why this happens and why is not documented... I just lost tow hour tring to figure it out why my program just hangs. After I have set the order as In the example above all works....
If anyone knows why please share your knowledge...
Hope this will save others a lot of lost time.

The order matters because the ObjectOutputStream constructor writes a stream header and the ObjectInputStream constructor reads the header.
If both ends of the conversation do "new ObjectInputStream()" they both forever wait for the other end to write the header. So one end needs to create the output stream first and the input stream second, and the other end in the other order (or do them in different threads.)
If it isn't documented it should be IMHO. Re-check the javadocs; if it isn't mentioned file a bug report to Sun. There is a bug parade link on http://java.sun.com/ somewhere.

Similar Messages

  • Socket.getInputStream hangs

    I have a simple client/server app, and the client hangs when I try to get the input stream coming out of the server. I have the following code on the server:
    ObjectOutputStream oos = null;
    ObjectInputStream ois = null;
    port = 49152;
    server = new ServerSocket(port, 0, InetAddress.getLocalHost());
    sock = server.accept();
    oos = new ObjectOutputStream(sock.getOutputStream());
    ois = new ObjectInputStream(sock.getInputStream());
    String inMsg = (String) ois.readObject();
    oos.writeObject(outMsg);
    oos.close();
    ois.close();
    sock.close();And I try to invoke it with this code on the client:
    ObjectOutputStream oos = null;
    ObjectInputStream ois = null;
    String inMsg = "";
    int port = 49152;
    try {
         Socket sock = new Socket(InetAddress.getLocalHost(), port);
         oos = new ObjectOutputStream(sock.getOutputStream());
         ois = new ObjectInputStream(sock.getInputStream());//the code hangs here
         oos.writeObject(outMsg);
         inMsg = (String) ois.readObject();
            oos.close();
         ois.close();
         sock.close();
    } catch (Exception e) {
         return "";
    return inMsg;
         The code hangs where indicated in the comments. Can someone tell me what I'm doing wrong?
    Edited by: MidnightJava on Apr 10, 2008 4:55 AM

    Can you please explain the rationale for your suggestion? What sort of problem is it addressingThe constructor for ObjectOutputStream writes a header to the stream. The constructor for ObjectInputStream reads it. Try constructing them in the opposite order at both ends and you will see a lovely deadlock. The flush() is required if there is a BufferedOutputStream under the ObjectOutputStream.
    is it a good idea to do it always when creating streams from a socket?It's essential when dealing with object streams. Other streams, no.

  • Multiple references to socket.getInputStream()

    I am writing a simple client server game and am trying to pass both input and Objects over the socket stream.
    Is it possible to have:
    BufferedReader ins = new BufferedReader(new InputStreamReader(socket.getInputStream()));
    ObjectInputStream ois = new ObjectInputStream(socket.getInputStream());Or will this cause problems? I am positive of the order of input and objects, so there is no ambiguity on whether to read from ois or ins, but will there be some bad-mojo there anyway?

    Thanks. I've read alot of posts about this and this is the first time I've seen the deprecated readLine solution. Doesn't this seem to be a fairly significant problem? Is BufferedReader supposed to be accepting serialized objects anytime soon?
    I suppose that I could simply close the socket and reestablish a connection using an ObjectInputStream, but what do commercial developers do? Do they just rely on passing String objects or is BufferedReader preferred?

  • "The CREATE USER statement must be the only statement in the batch" in SQL Azure - why? what to do?

    I'm getting an error on a line in the middle of a larger sql script, only in SQL Azure.
    IF NOT EXISTS (SELECT * FROM sys.database_principals WHERE name = N'foouser')
    CREATE USER [foouser] FOR LOGIN [foouser] WITH DEFAULT_SCHEMA=[dbo]
    GO
    Error: "The CREATE USER statement must be the only statement in the batch."
    I don't actually understand what 'the only statement in the batch' means.
    What is a batch? Is it a SQL file? Is it related to a 'GO' statement or an 'IF' statement? What is the reason for the error? And how do I avoid it?
    Thanks,
    Tim

    >IF...ELSE imposes conditions on the execution of a Transact-SQL statement
    I understand the general purpose of an If statement. I could let go of our definition of statement counting disagreeing too except that because of the error I'm stuck.
    It's less important for Create User but what I am really puzzled over now is a very similar issue how am I supposed to do a safe version of CREATE LOGIN, when I don't know whether a login has been previously created on the server or whether I
    am setting up the database on a clean server?
    IF NOT EXISTS (SELECT * FROM sys.server_principals WHERE name = N'foouser')
    CREATE LOGIN [foouser] WITH PASSWORD = 'asdfasdf'
    GO
    If I try and execute this script, it throws the same error as above.
    The first unworkable workaround idea is to omit the if statement
    CREATE LOGIN [foouser] WITH PASSWORD = 'asdfasdf'
    GO
    But if the login already exists on the server (because a similar script was already run), then the script throws an error.
    The second unworkable workaround idea is to do
    DROP LOGIN [foouser]
    GO
    CREATE LOGIN [foouser] WITH PASSWORD = 'asdfasdf'
    GO
    Obviously this throws an error in the second block if the login doesn't already exist on the server.
    The third workaround idea I have is to go conditional by putting an IF condition around DROP instead of CREATE:
    Unfortunately that doesn't work for me either!
    "The DROP LOGIN statement must be the only statement in the batch"
    (This is despite the fact that 'drop login' is listed on the
    supported commands page, not the partially supported page..?! Which disagrees with the notes on
    this page.)
    Anyway the real question I am interesting in addressing is: is there actually a way to have a 'Create/Delete login
    if exists' operation which is SQL-Azure compatible and doesn't throw me error messages (which messes with the sql execution tool I am using)?
    If there is no way, I would like to believe it's because it would be a bad idea to do this. But in that case why is it a bad idea?
    Tim

  • TLD Error:The markup in the document preceding the root element must...

    Hello, I am new to using the Tag Libraries, i am getting the following error which seems to be in my treeTag.tld file, I am pasting the error message and the treeTag.tld at the bottom of this message. Any help is much appreciated.
    Apache Tomcat/4.0.1 - HTTP Status 500 - Internal Server Error
    type Exception report
    message Internal Server Error
    description The server encountered an internal error (Internal Server Error) that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException: XML parsing error on file /TreeTag/treeTag.tld: (line 5, col 1): The markup in the document preceding the root element must be well-formed.
         at org.apache.jasper.parser.ParserUtils.parseXMLDocument(ParserUtils.java:218)
         at org.apache.jasper.compiler.TagLibraryInfoImpl.parseTLD(TagLibraryInfoImpl.java:283)
         at org.apache.jasper.compiler.TagLibraryInfoImpl.(TagLibraryInfoImpl.java:219)
         at ***************************************************
    Here is my treeTag.tld file
    <!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd">
    - <taglib>
         <tlibversion>1.1</tlibversion>
         <jspversion>1.1</jspversion>
         <shortname>Tree taglib</shortname>
         <uri>http://www.servletsuite.com/servlets/treetag</uri>
         <info>Tree tags</info>
         - <tag>
              <name>createTree</name>
              <tagclass>com.cj.tree.createTree</tagclass>
              <bodycontent>JSP</bodycontent>
              <info>Creates HTML-based tree view</info>
         </tag>
         - <tag>
              <name>addNode</name>
              <tagclass>com.cj.tree.addNode</tagclass>
              <bodycontent>JSP</bodycontent>
              <info>adds node</info>
              - <attribute>
                   <name>code</name>
                   <required>true</required>
                   <rtexprvalue>true</rtexprvalue>
              </attribute>
         </tag>
    </taglib>
    Regards,
    Navin Pathuru.

    You might make sure - if you havent already - that you are using the must up to date jsp version

  • The markup in the document preceding the root element must be well-formed

    Hi,
    Each time I add some library, something serious happens to my NetBeans5.5 and Tomcat 5.5.17. This time I added jsf-facelets.jar and now nothing is being deployed. I m getting following exception
    javax.servlet.ServletException: Error Parsing /Dept.jsp: Error Traced[line: 1] The markup in the document preceding the root element must be well-formed.
         javax.faces.webapp.FacesServlet.service(FacesServlet.java:202)
    Is there any special procedure to follow to add libraries?
    Plz help.

    Facelets is XHTML. XHTML is XML-HTML. XML require strict well-formness of the tags. I.e. every tag should be correctly nested and closed.
    I would say, read the Facelets Developer Documentation: http://www.google.com/search?q=facelets+developer+documentation

  • Why passwd for CHAP must be the same while for PAP its not mandatory ?

    Hi,
    want to ask a question in WAN about PAP/CHAP.
    why passwd for CHAP must be the same between routers  while for PAP its not mandatory ?
    regards

    By default, much of this type of checking is performed for you. Read the available checks in {font:Courier}/usr/share/doc/pam-0.99.6.2/txts/README.pam_cracklib{font} and then decide if these are sufficient.
    Note that some checks are not enabled by default, You can tune them by editing the {font:Courier}/etc/pam.d/system-auth{font} file:
    # /bin/fgrep /etc/pam.d/system-auth
    password    requisite     pam_cracklib.so try_first_pass retry=3and tinkering with the command line arguments there.

  • I am trying to backup my Itunes onto my external hard drive. I am at the step where I on Itunes, click on File - Library - Organize library. I am suppose to check mark both boxes there, It won't allow me to check mark the second box, why? How to fix this.

    I am trying to backup my Itunes onto my external hard drive. I am at the step where I on Itunes, click on File ->Library ->Organize library. I am suppose to check mark both boxes there, the first being "Consolidate Files" & the second being "Reorganize files in the folder 'Itunes Media'. I am able to checkmark the first box but It won't allow me to check mark the second box, why? How can i fix this? Please help!

    Well you must have made a mistake somewhere. The last instruction of step four reads:
    When you've found your iTunes library folder, drag that folder to your external hard drive. This will begin the iTunes backup. The amount of time the backup will take depends on the size of your library. When the transfer is done, your backup is complete and your external hard drive can be disconnected.
    Normally dragging content from to a new location on a different drive will result in a copy action which is what you were supposed to do. At a guess you somehow managed to move the iTunes folder. Then when you started iTunes it created a new blank library for you assuming it had just been installed rather that raising a warning.
    Close iTunes. Rename the iTunes folder on the internal drive as iTunes (Empty) then copy the iTunes folder from the external back into the User's Music folder. Start iTunes. All should be well.
    When you've made sure it all works please read my User Tip and use that method to backup in future. Since you already have a folder with the backup in place you can skip the "Make New" operation in the fourth step and simply choose the external folder.
    tt2

  • Org.xml.sax.SAXParseException: The markup in the document preceding the roo

    Below is the XML we are using to parse:
    <?xml version="1.0" encoding="UTF-8"?>
    <ead><archdesc level="class">desc</archdesc><eadheader audience="internal"><eadid>eadid23456</eadid></eadheader></ead>
    The application throws the exception:
    org.xml.sax.SAXParseException: The markup in the document preceding the root element must be well-formed.
         at weblogic.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1189)
         at weblogic.xml.jaxp.WebLogicXMLReader.parse(WebLogicXMLReader.java:135)
         at weblogic.xml.jaxp.RegistryXMLReader.parse(RegistryXMLReader.java:152)
         at javax.xml.parsers.SAXParser.parse(SAXParser.java:345)
         at javax.xml.parsers.SAXParser.parse(SAXParser.java:143)
         at gov.nysed.vrc.xml.FAHandler.parse(FAHandler.java:44)
         at gov.nysed.vrc.web.actions.FAEditorDispatchAction.validateFA(FAEditorDispatchAction.java:857)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)...
    I tried using several editors and online XML syntax checkers. None of them complained. Also I tried removing the newline character or any spaces in the document. Didn't help either. I read in some of the forums that Xerces could be picky about spaces but even without any spaces, I am getting this exception.
    We are using Weblogic 8.1 and the default parsers... Any help is appreciated. - Thanks...

    The Java API documentation (the bit about character encodings) mentions "ISO-8859-1" but not "ISO8859-1". Try that instead?

  • The PSE 10 process doesn't stop after closing the application. Why??

    On Windows 7, the PSE 10 process doesn't stop when closing the  application, therefore the PSE 10 app. will not restart once it is closed. The user must stop the process from task manager or reboot before PSE 10 can be restarted on a Windows 7 machine. The forum suggestion to double-click the exe (instead of the shortcut) as a solution, obviously isn't a solution and can't work. There are no updates to PSE 10 and the only access to any support is through this forum. There have been complaints about this on blogs all over the Internet. Why can't Adobe come up with a fix/update or if they have where is it posted?

    First of all, there is no difference between the files on the disk and those downloaded as the trial. The only difference is that one comes with a serial number and the other does not. You can put your serial number into the trial version and it will then be activated. The only way the disk would behave differently is if there is some physical flaw (scratches, warping, etc). Usually such damage will cause the installation to fail, it's pretty difficult for such damage to modify the files in such a way that they still install but behave differently.
    If you are dropping a file on the shortcut and the Photoshop Elements Editor is opening but the file is not, there could be a few different things going on there. Check your shortcut properties first: does it go to PhotoshopElementsEditor.exe or Photoshop Elements 10.0.exe? If the former, then there are probably some missing support files. If the latter, this is the Welcome Screen, which has likely been configured to launch the Editor automatically. However, you would be sending the file to the Welcome Screen, which doesn't do anything with the file. It is not capable of passing the file off to the Editor, only capable of launching it.
    Also, double-clicking a shortcut is generally the exact same thing as double-clicking the file the shortcut points to, but you can add modifiers to shortcuts to make them behave differently.

  • HT4009 My in-app purchrases could not be completed, they say that I must contact the itunes store support

    My in-app purchrases could not be completed. They said that I must contact the itunes store support. Please help me!

    If you haven't already done so then you can contact iTunes support via this page and ask them why the message is appearing (these are user-to-user forums, we won't know why) : http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page

  • NImax.exe has generated errors. You must restart the program, a log file is being created.

    NImax.exe has generated errors. You must restart the program, a log file is
    being created.
    This error occurs just after bootup, no programs started except windows..
    Running Windows 2000 latest version on a brand new computer.
    (pent 4 3.0 ghz 500MB ram).
    Can anyone help me with this problem? Happened after install Labview 7.0
    express. Installed twice and same problem occured with both installs.
    Labview 7.0 is the only thing installed right now. Also selected "Visual
    Basic Support" install from driver cd's.
    One other thing I just noticed. System info reports 2 processors and I
    think I only have one.
    TIA

    Happy update.
    After ignoring this problem for awhile and installing some NI DAQ boards,
    this problem is not happening anymore.
    Would urge NI to investigate further though. Messed me up for a couple of
    days, and still don't know why it happened.
    Much thanks to those who helped.
    JJ
    "JJF" wrote in message
    news:qB6Hb.48702$VB2.90660@attbi_s51...
    > One other point, I found out this is a message generated by drwtsn32. Can
    > get rid of the error by unchecking "show visual feedback on errors" box,
    but
    > don't like that fix. Still need help.
    >
    > Thanks,
    >
    > JJ
    >
    > "JJF" wrote in message
    > news:%JRGb.138921$8y1.419649@attbi_s52...
    > > Hi Nirmal and all,
    > >
    > > Happy Holidays to you too, and thanks for the reply.
    > >
    > > Making progress. Did all the uninstalling and registry editing as you
    > > suggested. Also, updated Win2K at Microsoft.com as suggested.
    > > Re-installed with default settings of LV express 7.0. Now I only get
    > the
    > > error when I exit NImax.
    > >
    > > Also, my p2p home network is not that hot. Have it set up as a
    workgroup.
    > > Sometimes when I boot up I have file access between the two computers
    and
    > > sometimes windows explorer can't find the workgroup network path
    (between
    > > the two computers). Both computers can always access the internet
    though.
    > > Using a 4 port Linksys cable/dsl router on a cable modem. Using XP
    home
    > > edition on base computer (the one set up for the isp) and Win2K on the
    > other
    > > computer.
    > >
    > > Also, any idea where this log file is going? Thought it was part of the
    > > event viewer but the errors in the event viewer don't seem to correspond
    > to
    > > the NImax.exe logging event now. There is a file in
    > > "winnt\sytem32\config\software.log" that seems to change at about the
    same
    > > time but I can't access the file because it is in use by the system.
    > >
    > > Using NImax ver 3.02.3005. Do you know if I can download "NI
    measurement
    > > and automation explorer" and/or the driver cd's from NI.com? Maybe I
    have
    > a
    > > flaky disk or something. I have a feeling it may also have to do with
    the
    > > "on again/off again" network neighborhood connection problem.
    > >
    > >
    > > Thanks again,
    > >
    > > JJ
    > >
    > >
    > >
    > > "Nirmal Sharma" wrote in message
    > > news:506500000005000000AE470100-1068850981000@exch​ange.ni.com...
    > > > Hi,
    > > > Happy cristmas & new year for you & ur brand new pc...
    > > >
    > > > How are you uninstalling & then installing LV in your pc ?
    > > >
    > > > I suggest to remove complete LV (Remove All option) from your
    > > > computer. Once uninstallation is completed, go to windows registry -
    > > > by windows start -> run -> regedit -> Enter
    > > >
    > > > Goto HKEY_LOCAL_MACHINE-> SOFTWARE -> National Instruments - Delete
    > > > this folder (National Instruments folder)
    > > >
    > > > Remove any other foloder/file related to NI's software. Be very
    > > > cautious while deleting files from windows registry bcoz wrong file
    > > > deletion may hang your whole system.
    > > >
    > > > Restart your computer..hope it should bootup without any errors.
    > > >
    > > > Now as answered by Alexander, update windows.
    > > >
    > > > After updating, bootup your system. If it boots up without any error
    > > > message, install LV with the typical (default installation).
    > > >
    > > > Hope this helps. Your feedbacks are welcome.
    > > >
    > > > Best Regards,
    > > > Nirmal Sharma
    > > > India
    > >
    > >
    >
    >

  • Must declare the scalar variable

    I Am getting error as Must declare the scalar variable "@Imageid" for the following code,while executing,
    exec spGetPager  ' ' , ' ', ' 3 ', ' '
    In my coding I pass querystring value like 1,2,3 etc
    CREATE PROCEDURE spGetPager
          @PageNo int = 1,  
          @ItemsPerPage int = 1,  
     @Imageid int,
          @TotalRows int out  
    AS  
    BEGIN  
      SET NOCOUNT ON  
      DECLARE  
        @StartIdx int,  
        @SQL nvarchar(max),   
        @SQL_Conditions nvarchar(max),   
        @EndIdx int
          IF @PageNo < 1 SET @PageNo = 1  
          IF @ItemsPerPage < 1 SET @ItemsPerPage = 10  
          SET @StartIdx = (@PageNo -1) * @ItemsPerPage + 1  
          SET @EndIdx = (@StartIdx + @ItemsPerPage) - 1  
          SET @SQL = 'SELECT Imageid,Imagepath,imagename,username  
                    FROM (  
                    SELECT  ROW_NUMBER() OVER(ORDER BY Imageid) AS Row, *  
                          FROM  Imageupload ) AS tbl WHERE Imageid=@Imageid AND Row >= '  
                                        + CONVERT(varchar(9), @StartIdx) + ' AND  
                           Row <=  ' + CONVERT(varchar(9), @EndIdx)  
          EXEC sp_executesql @SQL  
          SET @SQL = 'SELECT @TotalRows=COUNT(*) FROM Imageupload'  
          EXEC sp_executesql  
            @query = @SQL,  
            @params = N'@TotalRows INT OUTPUT',  
            @TotalRows = @TotalRows OUTPUT  
    END
    Thanks in Advance

    you cant use variable directly in concatenation operator as its of type int. you need to cast it first as below
    CREATE PROCEDURE spGetPager
    @PageNo int = 1,
    @ItemsPerPage int = 1,
    @Imageid int,
    @TotalRows int out
    AS
    BEGIN
    SET NOCOUNT ON
    DECLARE
    @StartIdx int,
    @SQL nvarchar(max),
    @SQL_Conditions nvarchar(max),
    @EndIdx int
    IF @PageNo < 1 SET @PageNo = 1
    IF @ItemsPerPage < 1 SET @ItemsPerPage = 10
    SET @StartIdx = (@PageNo -1) * @ItemsPerPage + 1
    SET @EndIdx = (@StartIdx + @ItemsPerPage) - 1
    SET @SQL = 'SELECT Imageid,Imagepath,imagename,username
    FROM (
    SELECT ROW_NUMBER() OVER(ORDER BY Imageid) AS Row, *
    FROM Imageupload ) AS tbl WHERE Imageid=' + CAST(@Imageid AS varchar(50)) + ' AND Row >= '
    + CONVERT(varchar(9), @StartIdx) + ' AND
    Row <= ' + CONVERT(varchar(9), @EndIdx)
    EXEC sp_executesql @SQL
    SET @SQL = 'SELECT @TotalRows=COUNT(*) FROM Imageupload'
    EXEC sp_executesql
    @query = @SQL,
    @params = N'@TotalRows INT OUTPUT',
    @TotalRows = @TotalRows OUTPUT
    END
    That being I didnt understand why you need dynamic sql here. There's no dynamicity involved as i see
     you could simply use a sql like below
    CREATE PROCEDURE spGetPager
    @PageNo int = 1,
    @ItemsPerPage int = 1,
    @Imageid int,
    @TotalRows int out
    AS
    BEGIN
    SET NOCOUNT ON
    DECLARE
    @StartIdx int,
    @EndIdx int
    IF @PageNo < 1 SET @PageNo = 1
    IF @ItemsPerPage < 1 SET @ItemsPerPage = 10
    SET @StartIdx = (@PageNo -1) * @ItemsPerPage + 1
    SET @EndIdx = (@StartIdx + @ItemsPerPage) - 1
    SELECT Imageid,Imagepath,imagename,username
    FROM (
    SELECT ROW_NUMBER() OVER(ORDER BY Imageid) AS Row, *
    FROM Imageupload ) AS tbl WHERE Imageid=@Imageid
    AND Row >= @StartIdx
    AND Row <= @EndIdx
    SELECT @TotalRows=COUNT(*) FROM Imageupload
    END
    to achieve same requirement.
    Make sure you read
    http://www.sommarskog.se/dynamic_sql.html
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Wuc-15 form must contain the following bean

    hi
    i am trying to use the client_text_io api's in a form but i keep getting the wuc-15 error (your form must contain the following bean for this function to be available - oracle.forms.webutil.file.FileFunctions). i do have the webutil object group in the form, i added it after attaching the library but i did go back and recompile all the pl/sql code just in case. forms90_path does include webutil/forms.
    the only thing that i can see that might be a problem is that because of utf8 issues i have to use the sun jdk. i have the following block in my formsweb.cfg file to force the form to use the sun jdk instead of jinitiator
    [jdk_plugin]
    basehtmljinitiator=basejpi.htm
    basehtmlie=basejpi.htm
    baseHTMLjpi=basejpi.htm
    jpi_download_page=http://java.sun.com/j2se/1.4.2/download.html
    jpi_classid=clsid:CAFEEFAC-0014-0002-0004-ABCDEFFEDCBA
    jpi_codebase=http://java.sun.com/products/plugin/autodl/jinstall-142-windows-i586.cab#Version=1,4,2,0
    jpi_mimetype=application/x-java-applet;version=1.4.2
    i have left it this way since when i change the basehtml entries to use the webutil templates i get thrown back into jinitiator. is this causing the wuc-15 error? if it is how do i use the webutil templates with the sun jdk?
    thanks
    penny svetlik

    the forms90_path variable contains less than 100 characters.
    i ran the form with increased trace level but did not get anything additional in the way of errors (just the usual 'unable to attach library' error in the alert box). here is the trace information. by the way why do the findlocalhost and getipaddress calles repeat 8 times?
    Registered modality listener
    Registered modality listener
    Referencing classloader: sun.plugin.ClassLoaderInfo@17431b9, refcount=1
    Referencing classloader: sun.plugin.ClassLoaderInfo@12884e0, refcount=1
    Loading applet ...
    Initializing applet ...
    Starting applet ...
    Loading applet ...
    Initializing applet ...
    Starting applet ...
    Connecting http://epn-svetlikp-3.nci.nih.gov:8888/forms90/webutil/webutil.jar with no proxy
    Connecting http://epn-svetlikp-3.nci.nih.gov:8888/forms90/java/f90all.jar with no proxy
    Loading http://epn-svetlikp-3.nci.nih.gov:8888/forms90/java/f90all.jar from cache
    Loading http://epn-svetlikp-3.nci.nih.gov:8888/forms90/webutil/webutil.jar from cache
    Certificates for http://epn-svetlikp-3.nci.nih.gov:8888/forms90/webutil/webutil.jar is read from JAR cache
    Certificates for http://epn-svetlikp-3.nci.nih.gov:8888/forms90/java/f90all.jar is read from JAR cache
    Modality pushed
    Modality pushed
    Modality popped
    Modality popped
    User selected: 0
    RegisterWebUtil - Loading Webutil Version 1.0.2 Beta
    Loaded image: jar:http://epn-svetlikp-3.nci.nih.gov:8888/forms90/java/f90all.jar!/oracle/forms/icons/splash.gif
    Loaded image: jar:http://epn-svetlikp-3.nci.nih.gov:8888/forms90/java/f90all.jar!/oracle/forms/icons/oracle_logo.gif
    Loaded image: jar:http://epn-svetlikp-3.nci.nih.gov:8888/forms90/java/f90all.jar!/oracle/forms/icons/bgnd.gif
    Connecting http://epn-svetlikp-3.nci.nih.gov:8888/forms90/java/oracle/forms/registry/Registry.dat with no proxy
    Connecting http://epn-svetlikp-3.nci.nih.gov:8888/forms90/java/oracle/forms/registry/default.dat with no proxy
    proxyHost=null
    proxyPort=0
    connectMode=HTTP, native.
    Connecting http://epn-svetlikp-3.nci.nih.gov:8888/forms90/f90servlet?config=jdk_plugin&form=C:\OraHome1\forms90\webutil\Webutil_demo\WU_TEST.fmx&buffer_records=NO&debug_messages=NO&array=YES&query_only=NO&quiet=NO&RENDER=YES&acceptLanguage=en-us,en;q=0.5&ifcmd=startsession with no proxy
    Connecting http://epn-svetlikp-3.nci.nih.gov:8888/forms90/l90servlet;jsessionid=7de1dca002db47ac915d9a2dfdbf1eae?ifcmd=getinfo&ifhost=epn-svetlikp-3&ifip=156.40.35.44 with no proxy
    Connecting http://epn-svetlikp-3.nci.nih.gov:8888/forms90/l90servlet;jsessionid=7de1dca002db47ac915d9a2dfdbf1eae with no proxy
    Forms Applet version is : 902122
    Connecting http://epn-svetlikp-3.nci.nih.gov:8888/forms90/l90servlet;jsessionid=7de1dca002db47ac915d9a2dfdbf1eae with no proxy
    Loaded image: jar:http://epn-svetlikp-3.nci.nih.gov:8888/forms90/java/f90all.jar!/oracle/forms/icons/frame.gif
    2004-Apr-08 08:43:50.544 WUI[VBeanCommon.findLocalHost()] obtaining LocalHost info from InetAddress
    2004-Apr-08 08:43:50.604 WUI[VBeanCommon.getIPAddress()] 156.40.35.44
    2004-Apr-08 08:43:50.654 WUF[VBeanCommon.findLocalHost()] obtaining LocalHost info from InetAddress
    2004-Apr-08 08:43:50.684 WUF[VBeanCommon.getIPAddress()] 156.40.35.44
    2004-Apr-08 08:43:50.724 WUH[VBeanCommon.findLocalHost()] obtaining LocalHost info from InetAddress
    2004-Apr-08 08:43:50.764 WUH[VBeanCommon.getIPAddress()] 156.40.35.44
    2004-Apr-08 08:43:50.784 WUS[VBeanCommon.findLocalHost()] obtaining LocalHost info from InetAddress
    2004-Apr-08 08:43:50.804 WUS[VBeanCommon.getIPAddress()] 156.40.35.44
    2004-Apr-08 08:43:50.835 WUT[VBeanCommon.findLocalHost()] obtaining LocalHost info from InetAddress
    2004-Apr-08 08:43:50.855 WUT[VBeanCommon.getIPAddress()] 156.40.35.44
    Connecting http://epn-svetlikp-3.nci.nih.gov:8888/forms90/webutil/jacob.jar with no proxy
    Loading http://epn-svetlikp-3.nci.nih.gov:8888/forms90/webutil/jacob.jar from cache
    Certificates for http://epn-svetlikp-3.nci.nih.gov:8888/forms90/webutil/jacob.jar is read from JAR cache
    2004-Apr-08 08:43:51.415 WUO[VBeanCommon.findLocalHost()] obtaining LocalHost info from InetAddress
    2004-Apr-08 08:43:51.435 WUO[VBeanCommon.getIPAddress()] 156.40.35.44
    2004-Apr-08 08:43:51.495 WUL[VBeanCommon.findLocalHost()] obtaining LocalHost info from InetAddress
    2004-Apr-08 08:43:51.505 WUL[VBeanCommon.getIPAddress()] 156.40.35.44
    2004-Apr-08 08:43:51.536 WUB[VBeanCommon.findLocalHost()] obtaining LocalHost info from InetAddress
    2004-Apr-08 08:43:51.556 WUB[VBeanCommon.getIPAddress()] 156.40.35.44
    Connecting http://epn-svetlikp-3.nci.nih.gov:8888/forms90/java/oracle/ewt/alert/resource/AlertBundle_en_US.class with no proxy
    Connecting http://epn-svetlikp-3.nci.nih.gov:8888/forms90/java/oracle/ewt/alert/resource/AlertBundle_en_US.properties with no proxy
    Connecting http://epn-svetlikp-3.nci.nih.gov:8888/forms90/l90servlet;jsessionid=7de1dca002db47ac915d9a2dfdbf1eae with no proxy
    Connecting http://epn-svetlikp-3.nci.nih.gov:8888/forms90/l90servlet;jsessionid=7de1dca002db47ac915d9a2dfdbf1eae with no proxy
    2004-Apr-08 08:43:54.630 WUI[VBeanCommon.destroy()] WebUtil GetClientInfo Utility being removed..
    2004-Apr-08 08:43:54.640 WUF[VBeanCommon.destroy()] WebUtil Client Side File Functions being removed..
    2004-Apr-08 08:43:54.660 WUH[VBeanCommon.destroy()] WebUtil Client Side Host Commands being removed..
    2004-Apr-08 08:43:54.680 WUS[VBeanCommon.destroy()] WebUtil Session Monitoring Facilities being removed..
    2004-Apr-08 08:43:54.700 WUT[VBeanCommon.destroy()] WebUtil File Transfer Bean being removed..
    2004-Apr-08 08:43:54.720 WUO[VBeanCommon.destroy()] WebUtil Client Side Ole Functions being removed..
    2004-Apr-08 08:43:54.730 WUL[VBeanCommon.destroy()] WebUtil C API Functions being removed..
    2004-Apr-08 08:43:55.381 WUB[VBeanCommon.destroy()] WebUtil Browser Functions being removed..
    Connecting http://epn-svetlikp-3.nci.nih.gov:8888/forms90/l90servlet;jsessionid=7de1dca002db47ac915d9a2dfdbf1eae with no proxy

  • WEBUTIL  Error WUC-15: "Your Form must contain the following Bean ...

    Dear Colleague,
    Up until now, I have installed WebUtil in my DEV environment (Designer Suite) and successfully used it to develop and run a form called DOCU_MGMT.fmx that performs various document management tasks like:
    1. File Upload into a DB BLOB column
    2. File Download and display
    3. Full text search (via Oracle Text) etc.
    In the meantime, I installed WebUtil in my TEST environment (Application Server) and successfully started the DOCU_MGMT.fmx form. However, when I press the button that executes the webutil_file_transfer.DB_To_Client function, I get the "WUC-15" error message, namely:
         "WUC-15 Your Form must contain the following Bean for this function to be available.
    oracle.forms.webutil.file.FileFunctions"
    According to the error message guide:
    "WUC-15 Your Form must contain the following Bean for this function to be available."
    Description: WebUtil uses Bean areas to carry out client side functionality and these must be present.
    Resolution: Drag the WEBUTIL object group into your Form.
    But this form was compiled with the WEBUTIL pll attached and the WEBUTIL object group subclassed into it.
    Any ideas or tips on the problem and how I should proceed? Any support would be appreciated.
    Thanks and best regards,
    Randy

    I am facing the same problem...
    Please help me out with this problem .it’s urgent
    Requirment:- I have to display open_dialog box.
    Software:-Oracle10g suite
    Formweb.cfg
    WebUtilArchive=frmwebutil.jar,jacob.jar
    WebUtilLogging=off
    WebUtilLoggingDetail=normal
    WebUtilErrorMode=Alert
    WebUtilDispatchMonitorInterval=5
    WebUtilTrustInternal=true
    WebUtilMaxTransferSize=16384
    baseHTMLjinitiator=webutiljini.htm
    baseHTMLjpi=webutiljpi.htm
    archive_jini=frmall_jinit.jar
    archive=frmall.jar
    lookAndFeel=oracle
    default.env
    WEBUTIL_CONFIG=D:\DevSuiteHome_1\forms\server\webutil.cgf
    CLASSPATH=D:\DevSuiteHome_1\j2ee\OC4J_BI_Forms\applications\formsapp\formsweb\WEB-INF\lib\frmsrv.jar;D:\DevSuiteHome_1\jlib\repository.jar;D:\DevSuiteHome_1\jlib\ldapjclnt10.jar;D:\DevSuiteHome_1\jlib\debugger.jar;D:\DevSuiteHome_1\jlib\ewt3.jar;D:\DevSuiteHome_1\jlib\share.jar;D:\DevSuiteHome_1\jlib\utj.jar;D:\DevSuiteHome_1\jlib\zrclient.jar;D:\DevSuiteHome_1\reports\jlib\rwrun.jar;D:\DevSuiteHome_1\forms\java\frmwebutil.jar;D:\DevSuiteHome_1\forms\java\jocab.jar
    Form Code
    declare
    x varchar(234);
    begin
    x:= WEBUTIL_FILE.FILE_OPEN_DIALOG ( 'c:\', '*.*', '|All files|*.*|', 'My Open Window' ) ;
    end;
    Compilation no Error. Error while running the form…Java Console say’s
    Oracle JInitiator: Version 1.3.1.22
    Using JRE version 1.3.1.22-internal Java HotSpot(TM) Client VM
    User home directory = C:\Documents and Settings\perwaiz
    User has overriden browser's proxy settings.
    Proxy Configuration: no proxy
    JAR cache enabled
    Location: C:\Documents and Settings\perwaiz\Oracle Jar Cache
    Maximum size: 50 MB
    Compression level: 0
    c: clear console window
    f: finalize objects on finalization queue
    g: garbage collect
    h: display this help message
    l: dump classloader list
    m: print memory usage
    q: hide console
    s: dump system properties
    t: dump thread list
    x: clear classloader cache
    0-5: set trace level to <n>
    Loading http://biju-nxg.wjtowell.com:8890/forms/java/frmall_jinit.jar from JAR cache
    Loading http://biju-nxg.wjtowell.com:8890/forms/java/my_icons.jar from JAR cache
    Loading http://biju-nxg.wjtowell.com:8890/forms/java/frmwebutil.jar from JAR cache
    java.io.FileNotFoundException: File not found: http://biju-nxg.wjtowell.com:8890/forms/java/jacob.jar
    at sun.plugin.protocol.jdk12.http.HttpURLConnection.getInputStream(Unknown Source)
    at oracle.jre.protocol.jar.HttpUtils.followRedirects(Unknown Source)
    at oracle.jre.protocol.jar.JarCache$CachedJarLoader.download(Unknown Source)
    at oracle.jre.protocol.jar.JarCache$CachedJarLoader.load(Unknown Source)
    at oracle.jre.protocol.jar.JarCache.get(Unknown Source)
    at oracle.jre.protocol.jar.CachedJarURLConnection.connect(Unknown Source)
    at oracle.jre.protocol.jar.CachedJarURLConnection.getJarFile(Unknown Source)
    at sun.misc.URLClassPath$JarLoader.getJarFile(Unknown Source)
    at sun.misc.URLClassPath$JarLoader.<init>(Unknown Source)
    at sun.misc.URLClassPath$2.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.misc.URLClassPath.getLoader(Unknown Source)
    at sun.misc.URLClassPath.getLoader(Unknown Source)
    at sun.misc.URLClassPath.getResource(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 sun.applet.AppletClassLoader.findClass(Unknown Source)
    at sun.plugin.security.PluginClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.applet.AppletClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Unknown Source)
    at oracle.ewt.util.FocusUtils.<clinit>(Unknown Source)
    at oracle.ewt.lwAWT.LWComponent.<clinit>(Unknown Source)
    at oracle.ewt.laf.oracle.OracleLookAndFeel._initCommonFixedDefaults(Unknown Source)
    at oracle.ewt.laf.oracle.OracleLookAndFeel._getCommonDefaults(Unknown Source)
    at oracle.ewt.laf.oracle.OracleLookAndFeel._getIndexedDefaults(Unknown Source)
    at oracle.ewt.laf.oracle.OracleLookAndFeel.getDefaults(Unknown Source)
    at oracle.ewt.lwAWT.BufferedApplet.getUIDefaults(Unknown Source)
    at oracle.ewt.lwAWT.BufferedApplet.<init>(Unknown Source)
    at oracle.ewt.swing.JBufferedApplet.<init>(Unknown Source)
    at oracle.forms.engine.Main.<init>(Unknown Source)
    at java.lang.Class.newInstance0(Native Method)
    at java.lang.Class.newInstance(Unknown Source)
    at sun.applet.AppletPanel.createApplet(Unknown Source)
    at sun.plugin.AppletViewer.createApplet(Unknown Source)
    at sun.applet.AppletPanel.runLoader(Unknown Source)
    at sun.applet.AppletPanel.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    WARNING: Unable to cache http://biju-nxg.wjtowell.com:8890/forms/java/jacob.jar
    proxyHost=null
    proxyPort=0
    connectMode=HTTP, native.
    Forms Applet version is : 10.1.2.0
    java.lang.NoClassDefFoundError: com/jacob/com/ComException
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Unknown Source)
    at oracle.forms.handler.UICommon.instantiate(Unknown Source)
    at oracle.forms.handler.UICommon.onCreate(Unknown Source)
    at oracle.forms.handler.JavaContainer.onCreate(Unknown Source)
    at oracle.forms.engine.Runform.onCreateHandler(Unknown Source)
    at oracle.forms.engine.Runform.processMessage(Unknown Source)
    at oracle.forms.engine.Runform.processSet(Unknown Source)
    at oracle.forms.engine.Runform.onMessageReal(Unknown Source)
    at oracle.forms.engine.Runform.onMessage(Unknown Source)
    at oracle.forms.engine.Runform.sendInitialMessage(Unknown Source)
    at oracle.forms.engine.Runform.startRunform(Unknown Source)
    at oracle.forms.engine.Main.createRunform(Unknown Source)
    at oracle.forms.engine.Main.start(Unknown Source)
    at sun.applet.AppletPanel.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    Thanks

Maybe you are looking for

  • How can I assign a period (instead of B) in Keynote for blank screen so I can use a Logitech R800 presenter? An option in next version?

    I have recently bought a Logitech R800 presenter which works very well with Keynote on a MacBook Pro. The start/stop presentation key does not work but that can be easily fixed by assigning F5 to "Start presentation" for Keynote in the keyboard syste

  • Trying to install wifi adapter but NM say no

    As titled, trying to revive older Dell with XP sp3  for shop. Installed linksys with speedbooster wusb546s ver2. Nice, as its got a long enough cord to set by window and get signal from house. However NM says it cant add because 'other software' cont

  • The Old Questions: JSF vs. Struts

    Hi there, I know this is not new to most of you, and I also read all the postings here and on the Struts website to JSF vs. Struts or better: JSF & Struts. In one posting I read that one should consider using JSF for projects in the long run, and use

  • Calculated paper bar codes

    I have several adobe forms that need to transform a field that the user populates into a barcode. I can create the form using the barcodes and it works fine in Adobe pro. However not in Reader. I have been told I need Reader Extensions, but the sales

  • Photoshop CS5 disables autoplay for digital camera?

    I just received and installed Photoshop CS5 Upgrade a couple days ago.  Software seems to be working fine.  However, I've noticed that when I plug in my DSLR (Canon EOS 5D Mark II), it will not auto-launch any application assigned to it.  Typically,