Urgent - please help with osb-service bus schema validation.

I have a proxyService runing on osb service bus, when I send wrong input to my proxyservices it react correctly by rejecting it, becuase the requestion is not conform to the schema, but I only get the error message saying that
the Input is does not much, is there a way to get more info about the error ?
like witch fields that cause the error ?

The fault variable in your stage error handler will have the approariate information. Just add a stage error handler in the stage you are doing schema validation (make sure that in validate action you are selecting "raise Error on validation failure") and the error handler log the $fault
Also refer -
Re: Validate each xml element against XML schema
Regards,
Anuj

Similar Messages

  • Please help with web services (JSR 172)

    Hello!
    I'm in need of some help. I've only worked with web services some few weeks. I have two web services that I want to access from J2ME.
    Both works nice in regular Java (J2SE). I use axis so with the help of WSDL2Java I got a working client.
    One of them has four operations
        public boolean tryToLoginUser( String username, String password ) {}   
        public boolean tryToLogOffUser( String username, String password ){}
        public boolean createUserAccount( String username, String password ){ }
        public boolean removeUserAccount( String username, String password ){ } The problem is when I want to use Sun's Wireless Toolkit 2.2 and create stubs that way with the Stub Generator. It complains with this
    warning: Operation tryToLoginUser is of the wrong encoding SOAP style/use (rpc/encoded).  Document/literal only.  Skipping generation of operation.
    warning: Operation tryToLogOffUser is of the wrong encoding SOAP style/use (rpc/encoded).  Document/literal only.  Skipping generation of operation.
    warning: Operation createUserAccount is of the wrong encoding SOAP style/use (rpc/encoded).  Document/literal only.  Skipping generation of operation.
    warning: Operation removeUserAccount is of the wrong encoding SOAP style/use (rpc/encoded).  Document/literal only.  Skipping generation of operation.What I can tell is I need to put this in my axis deployment descriptor
    <service name="UserWebService" provider="java:RPC" style="document" use="literal">instead of this:
    <service name="UserWebService" provider="java:RPC">This wont work. It don't work with HTTP GET I get this error
      <?xml version="1.0" encoding="UTF-8" ?>
    - <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    - <soapenv:Body>
    - <soapenv:Fault>
      <faultcode>soapenv:Server.userException</faultcode>
      <faultstring>org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize.</faultstring>
    - <detail>
      <ns1:hostname xmlns:ns1="http://xml.apache.org/axis/">slukare</ns1:hostname>
      </detail>
      </soapenv:Fault>
      </soapenv:Body>
      </soapenv:Envelope>I doesn�t work with WSDL2Java and when I run Sun's Wireless Toolkit 2.2 to generate stub it complains with
    warning: ignoring operation "tryToLoginUser": more than one part in input message
    warning: ignoring operation "tryToLogOffUser": more than one part in input message
    warning: ignoring operation "createUserAccount": more than one part in input message
    warning: ignoring operation "removeUserAccount": more than one part in input message
    warning: Port "UserWebService" does not contain any usable operationsDoes this mean I can only use one parameter for input in an operation when I use style="document" use="literal" ??
    I understood it that way, so I created a new web service that takes username and password in one String.
    The new web service has four operations
        public boolean tryToLoginUser( String usernameAndPassword ) {}   
        public boolean tryToLogOffUser( String usernameAndPassword ){}
        public boolean createUserAccount( String usernameAndPassword ){ }
        public boolean removeUserAccount( String usernameAndPassword ){ }The problem is that I get this error when running HTTP GET.
      <?xml version="1.0" encoding="UTF-8" ?>
    - <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    - <soapenv:Body>
    - <soapenv:Fault>
      <faultcode>soapenv:Server.userException</faultcode>
      <faultstring>org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize.</faultstring>
    - <detail>
      <ns1:hostname xmlns:ns1="http://xml.apache.org/axis/">slukare</ns1:hostname>
      </detail>
      </soapenv:Fault>
      </soapenv:Body>
      </soapenv:Envelope>If I get a WSDL2Java client it works (!) if I manually changes the parameter names. I have four operations which all takes
    String usernameAndPassword
    in one String since I can only use one parameter with style="document" use="literal"
    The WSDL2Java automatically set the parameter names to
    usernameAndPassword
    usernameAndPassword1
    usernameAndPassword2
    usernameAndPassword3
    for the different operations. If I manually changes them to all have the name
    usernameAndPassword
    it works. Why doesn�t it work without manual changes? I haven�t tested the code from Sun�s Wireless Toolkit 2.2 Stub Generator yet, but that at least doesn�t give any errors .
    My other web service doesn�t work either if I set style="document" use="literal".
    This web service returns my own classes I have written. It works as I said previously in J2SE with WSDL2Java, but not with style="document" use="literal�. When I set this my byte[] which is returned is null when using the client from WSDL2Java, this wasn�t the case without style="document" use="literal�.
    I also get an error in Sun�s Wireless Toolkit 2.2 that byte[] is not recoigniced. This wasn�t the case with axis WSDL2Java.
    If I put this inside the axis deployment descriptor
    <deployment xmlns="http://xml.apache.org/axis/wsdd/"
             xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
           <service xmlns:j2melab2="urn:businessobject.j2melab2"
                     name="RecipeWebService" provider="java:RPC" style="document" use="literal">
              <parameter name="scope" value="session"/>
              <parameter name="className" value="j2melab2.webservices.RecipeWebService"/>
              <parameter name="allowedMethods" value="*"/>
                    <typeMapping qname="j2melab2:ArrayOfString"
                                 type="java:java.lang.String[]"
                                 serializer="org.apache.axis.encoding.ser.ArraySerializerFactory"
                                 deserializer="org.apache.axis.encoding.ser.ArrayDeserializerFactory"
                                 encodingStyle="http://schemas.xmlsoap.org/soap/encoding"/>
                    <beanMapping qname="j2melab2:Recipe" languageSpecificType="java:j2melab2.businessobject.Recipe"/>         
                    <beanMapping qname="j2melab2:Ingredient" languageSpecificType="java:j2melab2.businessobject.Ingredient"/>         
                    <typeMapping qname="j2melab2:ArrayofIngredient"
                                 type="java:j2melab2.businessobject.Ingredient[]"
                                 serializer="org.apache.axis.encoding.ser.ArraySerializerFactory"
                                 deserializer="org.apache.axis.encoding.ser.ArrayDeserializerFactory"
                                 encodingStyle="http://schemas.xmlsoap.org/soap/encoding"/>
                    <typeMapping qname="j2melab2:ArrayOfByte"
                                 type="byte[]"
                                 serializer="org.apache.axis.encoding.ser.ArraySerializerFactory"
                                 deserializer="org.apache.axis.encoding.ser.ArrayDeserializerFactory"
                                 encodingStyle="http://schemas.xmlsoap.org/soap/encoding"/>                            
         </service>
    </deployment>instead of this
    <deployment xmlns="http://xml.apache.org/axis/wsdd/"
             xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
           <service xmlns:j2melab2="urn:businessobject.j2melab2"
                     name="RecipeWebService" provider="java:RPC">
              <parameter name="scope" value="session"/>
              <parameter name="className" value="j2melab2.webservices.RecipeWebService"/>
              <parameter name="allowedMethods" value="*"/>
                    <typeMapping qname="j2melab2:ArrayOfString"
                                 type="java:java.lang.String[]"
                                 serializer="org.apache.axis.encoding.ser.ArraySerializerFactory"
                                 deserializer="org.apache.axis.encoding.ser.ArrayDeserializerFactory"
                                 encodingStyle="http://schemas.xmlsoap.org/soap/encoding"/>
                    <beanMapping qname="j2melab2:Recipe" languageSpecificType="java:j2melab2.businessobject.Recipe"/>         
                    <beanMapping qname="j2melab2:Ingredient" languageSpecificType="java:j2melab2.businessobject.Ingredient"/>         
                    <typeMapping qname="j2melab2:ArrayofIngredient"
                                 type="java:j2melab2.businessobject.Ingredient[]"
                                 serializer="org.apache.axis.encoding.ser.ArraySerializerFactory"
                                 deserializer="org.apache.axis.encoding.ser.ArrayDeserializerFactory"
                                 encodingStyle="http://schemas.xmlsoap.org/soap/encoding"/>
         </service>
    </deployment>axis WSDL2Java won�t work anymore. And Sun�s Wireless Toolkit doesn�t work either with this. How can I get this to work with Sun�s Wireless Toolkit 2.2?
    So my questions are:
    Do I really need style=�document� use=�literal� for J2ME?
    Can I only have one parameter as input when I use style=�document� use=�literal� ?
    Why do I need to manally change the parameter names?
    How can I make Sun�s Wireless Toolkit 2.2 understand byte[] ?
    Many thanks for help :) (I have to present a solution in 1 � week to my J2ME teacher L).

    hi,
    i was wandering if you manage to successfully generate the stubs through the wireless toolkit at the end? i am currently having similar problem (i.e., trying to generate stub files based on wsdl from axis)? it seems that the WTK can only handle document/literal format, and so i change the wsdl to that. however, now it complains that it can't handle more than one input part in the message, (which is similar to the problem you had). so did you manage to find a solution to that, or J2ME simply does not support more than one arguement as the input?
    thanks in advance,
    lee

  • URGENT Please help with weird behavior of test suite

    Hi All,
    I have a composite involving three operations of two different services. The weird behavior comes by the time on which I run the test suite on the EM, if I try to emulate two different operation response from one service, by the time that the flow, tries to emulate the second one, I always receive this error:
    part name="summary">
    <summary>oracle.fabric.common.FabricException: javax.wsdl.WSDLException: WSDLException: faultCode=OTHER_ERROR: Error writing stream: java.io.IOException: Can only write attribute within a tag.: WSDLException: faultCode=OTHER_ERROR: Error writing stream: java.io.IOException: Can only write attribute within a tag.</summary>
    </part>
    On the other hand if I emulate two responses of the same operation it works.
    Does any one have any idea of how to deal with this kind of test? Which seems a very simple test.
    Best regards,

    Hi thanks for your response, in detail my problem is as follows:
    1- I have a simple composite with two services and three invokes, all of the operations are two ways operations. Here´s the BPEL (Service1 Demandas, operation Actualizar; Service 2 Aviso, operations buscar, actualizar):
    <scope name="SINAUT_Aviso_SRV_Demandas_Actualizar">
    <bpelx:annotation xmlns:bpelx="http://schemas.oracle.com/bpel/extension">
    <bpelx:pattern patternName="bpelx:automated"/>
    <bpelx:analysis>
    <bpelx:property name="LastUpdateDate">9/10/10 9:35:50 AM</bpelx:property>
    <bpelx:property name="BusinessId">Scope_151babe7-bc1e-11df-3ca0-0015c5fce8ce</bpelx:property>
    </bpelx:analysis>
    </bpelx:annotation>
    <sequence>
    <bpelx:annotation xmlns:bpelx="http://schemas.oracle.com/bpel/extension">
    <bpelx:analysis>
    <bpelx:property name="BusinessId">Sequence_151babe7-bc1e-11df-3ca0-0015c5fce8ce</bpelx:property>
    <bpelx:property name="LastUpdateDate">9/10/10 9:35:50 AM</bpelx:property>
    </bpelx:analysis>
    </bpelx:annotation>
    <assign name="Assign_1">
    <copy>
    <from variable="inputVariable"
    query="/client:process/client:input/idDemada"
    part="payload"/>
    <to variable="Invoke_2_actualizar_InputVariable"
    part="payload" query="/payload/demanda/idDemanda"/>
    </copy>
    <copy>
    <from variable="inputVariable"
    query="/client:process/client:input/estadoDemanda/codigo"
    part="payload"/>
    <to variable="Invoke_2_actualizar_InputVariable"
    part="payload"
    query="/payload/demanda/estadoDemanda/codigo"/>
    </copy>
    </assign>
    <invoke name="Invoke_2"
    inputVariable="Invoke_2_actualizar_InputVariable"
    outputVariable="Invoke_2_actualizar_OutputVariable"
    partnerLink="SRV_Demandas"
    portType="ns2:SINAUT_Aviso_SRV_Demandas"
    operation="actualizar"/>
    </sequence>
    </scope>
    <scope name="SINAUT_Aviso_SRV_Avisos_Actualizar">
    <bpelx:annotation xmlns:bpelx="http://schemas.oracle.com/bpel/extension">
    <bpelx:pattern patternName="bpelx:automated"/>
    <bpelx:analysis>
    <bpelx:property name="LastUpdateDate">9/10/10 9:35:57 AM</bpelx:property>
    <bpelx:property name="BusinessId">Scope_c235386b-bc1f-11df-3ca0-0015c5fce8ce</bpelx:property>
    </bpelx:analysis>
    </bpelx:annotation>
    <sequence>
    <bpelx:annotation xmlns:bpelx="http://schemas.oracle.com/bpel/extension">
    <bpelx:analysis>
    <bpelx:property name="BusinessId">Sequence_c235386b-bc1f-11df-3ca0-0015c5fce8ce</bpelx:property>
    <bpelx:property name="LastUpdateDate">9/10/10 9:35:57 AM</bpelx:property>
    </bpelx:analysis>
    </bpelx:annotation>
    <assign name="Assign_2">
    <copy>
    <from variable="inputVariable"
    query="/client:process/client:input/ReferenciaPly"
    part="payload"/>
    <to variable="Invoke_1_actualizar_InputVariable"
    part="payload" query="/payload/aviso/referenciaPlyAviso"/>
    </copy>
    <copy>
    <from variable="inputVariable"
    query="/client:process/client:input/estadoAviso/codigo"
    part="payload"/>
    <to variable="Invoke_1_actualizar_InputVariable"
    part="payload" query="/payload/aviso/estadoAviso/codigo"/>
    </copy>
    </assign>
    <invoke name="Invoke_1"
    inputVariable="Invoke_1_buscar_InputVariable_1"
    outputVariable="Invoke_1_buscar_OutputVariable_1"
    partnerLink="SRV_Aviso"
    portType="ns1:SINAUT_Aviso_SRV_Avisos"
    operation="buscar"/>
    <assign name="Assign_4">
    <copy>
    <from expression="'12345'"/>
    <to variable="Invoke_3_actualizar_InputVariable"
    part="payload" query="/payload/aviso/referenciaPlyAviso"/>
    </copy>
    </assign>
    <invoke name="Invoke_3"
    inputVariable="Invoke_3_actualizar_InputVariable"
    outputVariable="Invoke_3_actualizar_OutputVariable_1"
    partnerLink="SRV_Aviso"
    portType="ns1:SINAUT_Aviso_SRV_Avisos"
    operation="actualizar"/>
    </sequence>
    </scope>
    2- My test suite is as follows:
    <wireActions wireSource="SINAUT_Aviso_PR_DemandasActualizar_TO_BE_/SRV_Demandas" operation="actualizar">
    <emulate duration="PT0S">
    <message>
    <part partName="payload">
    <content>
    <payload xmlns=""/>
    </content>
    </part>
    </message>
    </emulate>
    </wireActions>
    <wireActions wireSource="SINAUT_Aviso_PR_DemandasActualizar_TO_BE_/SRV_Aviso" operation="buscar">
    <emulate duration="PT0S">
    <message>
    <part partName="payload">
    <filePath>prueba_busqueda.xml</filePath>
    </part>
    </message>
    </emulate>
    </wireActions>
    <wireActions wireSource="SINAUT_Aviso_PR_DemandasActualizar_TO_BE_/SRV_Aviso" operation="actualizar">
    <emulate duration="PT0S">
    <message>
    <part partName="payload">
    <filePath>prueba_actualizar.xml</filePath>
    </part>
    </message>
    </emulate>
    </wireActions>
    3- When the test suite executes the second operation of the second service it throws this exception:
    <bpelFault><faultType>0</faultType><remoteFault xmlns="http://schemas.oracle.com/bpel/extension"><part name="summary"><summary>oracle.fabric.common.FabricException: javax.wsdl.WSDLException: WSDLException: faultCode=OTHER_ERROR: Error writing stream: java.io.IOException: Can only write attribute within a tag.: WSDLException: faultCode=OTHER_ERROR: Error writing stream: java.io.IOException: Can only write attribute within a tag.</summary></part><part name="detail"><detail>Can only write attribute within a tag.</detail></part></remoteFault></bpelFault>
    4- if I change the second operation with the first one(buscar), it doesn't throws any exception.
    5- If this is a limitation , how can I test a composite that involves n operations of the same service?
    Kind regards and thanks for all of your support

  • Urgent - please help with parsing HTML

    Hi,
    I'm very new to Java - i'm a biology major, actually, but taking this class for fun. Unfortunately, I'm having quite a bit of trouble with it. I've written a class that downloads a web page, converts it to a string, and then sends the string to another class, called BankRecord.
    The web page string looks something like this:
    bodylinks101>Prime Mortgage</a><br><span class=bodytext101>(909) 369-1012</span></td><td bgcolor=#e4e4e4 valign=top align=center><span class=bodytext101>4/18/2003</span><br><span class=bodytext101>10:15</td><td bgcolor=#e4e4e4 valign=top align=center><span class=bodytext101>5.875%</span>
    So, what I am trying to do is parse the HTML so that it returns, as a string, the appropriate information. For example, in the above HTML, I want "Prime Mortgage (909) 369-1012 4/18/2003" etc.
    The above is just one record, with several fields (bank name, phone number, date). The entire web page has quite a few records, for different banks, and I need to extract all of them. I think I've figured out how to find the start and end of the first record, but I don't know how to go about looking for more records. I'm guessing a loop? Also, how do I go about distinguish between the fields in each record (i.e., how to distinguish between phone number and date fields) Here is the code I have so far:
    import java.util.*;
    public class BankRecord
        //  Set up variables
        private String strContent;
        private Integer intPos;
        //  Constructor
        public BankRecord (String strVar)
             strContent = strWebPage;  // set strContent to incoming string
             intPos = 1;  // initialize intPos to 1
        public getNextRecord()
        // uses findBankStart to find next bank record; if found, return true.
        private findBankStart(intPos)
        // accept an integer indicating a place to start looking for beginning of each
        // bank record.  If there are no more records, return a -1; otherwise, return
        // starting position
             // Find beginning of record
             int intRecStart = strContent.indexOf("bodylinks101>",intRecStart);
             // Find end of record
             int intRecEnd = strContent.indexOf("bodylinks101>Apply",intRecEnd);
             // Find beginning of first field in record
             int FldStart = intRecStart + 13;
             // Find end of field in record
             int FldEnd = strContent.indexOf("<",intFldStart);
        public getField(intFldNum)
             // return the field asked for by number as a string.
    }PLEASE help as soon as possible...thank you very much.

    Thuyker,
    Here are 2 approaches:
    If you have a fixed format, parse via delimiters. For example, if each "record" is as follows:
    <span>Name</span><span>Acct No</span><span>balance</span>
    each "field" of the record is delimited by <span>...</span> tags. Thus, you could use regular old string functions such as indexOf() to read through the HTML string, and to pick apart the data you need.
    Alternatively, get a HTML parser, and let it do the work for you. A SAX-like one that I've used successfully is at http://www.quiotix.com/downloads/html-parser/
    --A                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Urgent Please help with a Conferencing problem in CUCM 6.1

    /* Style Definitions */
    table.MsoNormalTable
    {mso-style-name:"Table Normal";
    mso-tstyle-rowband-size:0;
    mso-tstyle-colband-size:0;
    mso-style-noshow:yes;
    mso-style-priority:99;
    mso-style-qformat:yes;
    mso-style-parent:"";
    mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
    mso-para-margin:0cm;
    mso-para-margin-bottom:.0001pt;
    mso-pagination:widow-orphan;
    font-size:11.0pt;
    font-family:"Calibri","sans-serif";
    mso-ascii-font-family:Calibri;
    mso-ascii-theme-font:minor-latin;
    mso-fareast-font-family:"Times New Roman";
    mso-fareast-theme-font:minor-fareast;
    mso-hansi-font-family:Calibri;
    mso-hansi-theme-font:minor-latin;
    mso-bidi-font-family:"Times New Roman";
    mso-bidi-theme-font:minor-bidi;}
    We have a configuration of CUCM 6.1. We have 24 voice ports (FXO) configured in H 323 registered with the call manger.  A CUE 3.2 configured for IVR and mail box. Gateway is a Cisco 3845 and the IOS version is 12.4(15) T10
    The problem is whenever a conference is configured with an outside number the FXO port is not releasing after the call disconnects.  It is not FXO disconnect problem. This happens only when a conference is taking place. There is no problem with any other outside or inside calls.
    I am attaching the configuration of Gateway. Please help me with the problem, I am very much thankful for you that.

    The Family pack covers upto 5 computers, other Install Disc cover one computer only.

  • Urgent: Please help with T440p WWAN

    I have a simple question since I'm planning to buy a new thinkpad t440p 
    Does all models have a WWAN connection ? 
    Resellers in my Country doesn't give any custimization options and when I've been to the shop to get it they only said that there is a sim slot under the battery does this mean that I can use mobile data as soon as I get it or what ? 
    in the device manage I opened network adapters and I found the following list 
    bluetooth device 
    bluetooth device 
    intel centrino advanced n6235
    Intel ethernet connection i217-lm
    there is another PCI simple communication controller unidentified device 
    the laptop has 
    core I5 extreme vpro 
    500gb hdd 
    4gb ram 

    Hi,
    T440p laptops do not all come with a WWAN card installed.  Most - but not all - have WWAN antennas installed but may or may not have a card.  The SIM slot is always there as it's part of the generic T440p case.
    The PSREF page may help you figure this out if you can find your MT-M (machine type-model).  Otherwise post your MT-M here and someone may be able to track down the exact specs.
    http://psref.lenovo.com/Product/62
    Z.
    The large print: please read the Community Participation Rules before posting. Include as much information as possible: model, machine type, operating system, and a descriptive subject line. Do not include personal information: serial number, telephone number, email address, etc.  The fine print: I do not work for, nor do I speak for Lenovo. Unsolicited private messages will be ignored. ... GeezBlog
    English Community   Deutsche Community   Comunidad en Español   Русскоязычное Сообщество

  • Urgent, Please help with new MIDI pedal

    I just got an old awesome MIDI pedal the X-15 Ultrafoot. The pedal has two expression pedals and 10 pushbuttons/pushpads (as well as two buttons to scroll through banks, and a "mode" and "bypass" button).
    What I want to is assign each pushbutton to a different parameter. I then want the expression pedal to be activated to whatever parameter I have selected. The problem is I do not know how to make the expression pedal exclusively control only the last parameter that was selected.
    If somebody could help me with this I will be eternally grateful

    Hi Harm,
    I tried moving the BCLK slider up to 140 in the following application provided by asus (its easier than in the BIOS) and the CPU went up from about 3450mhz to 3780mhz. The DRAM only went up to 562.  I dont think im understanding what you mean by 2:10 mermory timings and getting the memory up to 1800, becuase it seems that i would need to increase BCLK to much higher than it is in order to get the DRAM from 562 to 1800? Shall I try push the BCLK up higher to 150 (is it safe?)
    Below is the result of moving the BCLK slider from 130 to 140. It only moved to 562 Mhz ? Please can you explain how one gets this figure to be in the range of 1800mhz to 2000mhz

  • Urgent - please help with blank lines

    Guys need you help, please.
    How do I put blank lines in a repeating frame even if there are records or no(about 20 lines with say 5 columns). I need those lines like our ruled notebooks, for the users to enter something.
    Thanks
    Joe.

    These are blank tabular columns(20 rows 5 col). These rows might have names and other details like a master/details relationship. if there are records in details then print all those details and the blank rows to fillup 20 rows. if there are no details then print those 20 blank rows/columns. i tried doing this with one repeating frame and increasing the number of rows value to 20, but then it stops at the point of the detail rows and does not put the blank rows (lines). so had to create 2 repeating frames.

  • Urgent- Please help with image overlaying

    Hi,
    Please,please, can someone help me with an imaging issue and show me what I'm doing wrong.
    I'm a swing beginner and I'm trying to create a application for a board game. Currently I'm using JLabel components to try and create jpeg pieces over a JPanel component that has the board background.
    Currently I've written the code for the board background component and the pieces but can't get the image to appear on the background.
    Please can someone show me what I'm doing wrong.
    If someone can help me get this working, I've got 16 dollars from other posts in this forum I can give you.
    Thanks.
    public class BoardPanel extends JPanel {
    public BoardPanel()
    //Overwrite abstract painting method
    public void paintComponent(Graphics g)
    super.paintComponent(g);
              g.drawImage(backgroundImage,0,0,this.getWidth(), this.getHeight(), null);
    private Image backgroundImage = new ImageIcon("./Board.gif").getImage();
    public class PieceIcon extends JLabel {
    public PieceIcon(String symbol)
    System.out.println("./"+symbol+".jpg");
              pieceImage = new ImageIcon("./"+symbol+".jpg");
    public void paintComponent(Graphics g)
              super.paintComponent(g);
              g.drawImage(pieceImage,playerBoardPos.getX(),playerBoardPos.getY(), this);
    private Image pieceImage;
    Main:
    JPanel content = new JPanel();
    PieceIcon testPiece = new PieceIcon("Dog");
    BoardPanel boardIcon = new BoardPanel();
    getContentPane().add(content, java.awt.BorderLayout.CENTER);
    content.add(boardIcon, java.awt.BorderLayout.CENTER);
    boardIcon.setLayout(new javax.swing.OverlayLayout(boardIcon));
    boardIcon.add(testPiece);

    Oh, and since you probably won't be needing a layout manager, try the following:
    setLayout(null);
    ChessPeice peice1 = new ChessPeice(...);
    add(peice1);
    peice1.setBounds(x, y, width, height);also, your ChessPeice paintComponent method should look more like:
    ... //in constructor
    setPreferredSize(new Dimension(image.width, image.height));
    setOpaque(false);
    public void paintComponent(Graphics g){
       g.drawImage(...);
    }Make sure that if you call the component's getSize method to determine the width and height you do it after pack has been called. If you call getSize before then, it will return 0 for the width and height values.
    Another advantage to this approach is that the peices only draw in the areas they need to.
    Hope this helps.

  • URGENT, Please help with calling one program in another

    I am am trying to call Ch4Ex5 within Ch3Ex5. The teacher said it should take about 6 lines of modification within Ch3Ex5 to be able to call out Ch4Ex5. I also might need to modify Ch4Ex5 to get it to work. But I spent many hours and its due soon and I still cant figure it out. I think the teacher assigned this too early in the semester because most the kids dont know how to do it.
    Here is Ch3Ex5
    import java.util.*;
    public class Ch3Ex5
         public static void main(String[] args)
              Scanner kb = new Scanner(System.in);
              int aCount = 0, bCount = 0, cCount = 0, dCount = 0, fCount = 0;
              int nScores = 0;
              int lowest, highest;
              int currentScore;
              int totalOfScores = 0;
              double average;
              do
                   System.out.print("Enter a score (negative value to quit): ");
                   currentScore = kb.nextInt();
                   kb.nextLine();
                   if(currentScore > 100)
                        System.out.println("Scores cannot be greater than 100, please try again");
              } while(currentScore > 100);
              lowest = currentScore;
              highest = currentScore;
              while(currentScore > 0)
                   nScores++;
                   totalOfScores += currentScore;
                   if(lowest > currentScore)
                        lowest = currentScore;
                   if(highest < currentScore)
                        highest = currentScore;
                   if((100 >= currentScore) && (currentScore >= 90)) aCount++;
                   else if(currentScore >= 80) bCount++;
                   else if(currentScore >= 70) cCount++;
                   else if(currentScore >= 60) dCount++;
                   else fCount++;
                   do
                        System.out.print("Enter a score (negative value to quit): ");
                        currentScore = kb.nextInt();
                        kb.nextLine();
                        if(currentScore > 100)
                             System.out.println("Scores cannot be greater than 100, please try again");
                   } while(currentScore > 100);
              System.out.println("Number of scores: " + nScores);
              if(nScores > 0)
                   System.out.println("Number of A's = " + aCount);
                   System.out.println("Number of B's = " + bCount);
                   System.out.println("Number of C's = " + cCount);
                   System.out.println("Number of D's = " + dCount);
                   System.out.println("Number of F's = " + fCount);
                   System.out.println("Percent A's = "+(100.0*aCount/nScores));
                   System.out.println("Percent B's = "+(100.0*bCount/nScores));
                   System.out.println("Percent C's = "+(100.0*cCount/nScores));
                   System.out.println("Percent D's = "+(100.0*dCount/nScores));
                   System.out.println("Percent F's = "+(100.0*fCount/nScores));
                   System.out.println("High score: " + highest);
                   System.out.println("Low score: " + lowest);
                   average = (double) totalOfScores / nScores;
                   System.out.println("Average score = " + average);
    import java.util.*;
    public class Ch4Ex5
         public static void main(String[] args)
              Scanner kb = new Scanner(System.in);
              double gradeA, gradeB, gradeC, gradeD, gradeF, total;
              double aCount, bCount, cCount, dCount, fCount;
              System.out.println("Enter in the number of each grades");
              System.out.println("In this order, A's, B's, C's, D's, F's");
              gradeA = kb.nextDouble();
              gradeB = kb.nextDouble();
              gradeC = kb.nextDouble();
              gradeD = kb.nextDouble();
              gradeF = kb.nextDouble();
              System.out.println("0    10   20   30   40   50   60   70   80   90   100");
              System.out.println("|    |    |    |    |    |    |    |    |    |    |");
              System.out.println("***************************************************");
              total = gradeA + gradeB + gradeC + gradeD + gradeF;
              aCount = (((gradeA) / (total)) * 100);
              bCount = (((gradeB) / (total)) * 100);
              cCount = (((gradeC) / (total)) * 100);
              dCount = (((gradeD) / (total)) * 100);
              fCount = (((gradeF) / (total)) * 100);
                   for (int i= 0; i < aCount; i = i +2)
                   System.out.print('*');
              System.out.println("A");
                   for (int i= 0; i < bCount; i = i +2)
                   System.out.print('*');
              System.out.println("B");
                   for (int i= 0; i < cCount; i = i +2)
                   System.out.print('*');
              System.out.println("C");
                   for (int i= 0; i < dCount; i = i +2)
                   System.out.print('*');
              System.out.println("D");
                   for (int i= 0; i < fCount; i = i +2)
                   System.out.print('*');
              System.out.println("F");
    }

    Here's a tip for you: it doesn't really matter if you post in New to Java or Java Programming. Post once, be patient and you will get a reply. As I said keep up this style of posting and nobody will be willing to help you.
    Why am I freaking out over double posting? Lets say Fred reads and replies in Thread A. Then Barney comes along and reads Thread B not knowing that Fred has already given an answer in Thread B. So Barney ends up wasting his time by posting the same answer in Thread B. Once again it aint rocket science!

  • URGENT please help with servlets

    am using Jbuilder 3 and there is no servlet classs to import .imported JSDK and the javax files. but it keeps saying my class does not extend http servlet any ideas!!

    I've used JBuilder3 a few times and as far as I remember the default Target jdk (version 1.2) cannot be changed or ammended and so you can't really import javax.servlet stuff.
    Go to project -> properties.
    You probably just need to define a new jdk version call it "JDK 12 Servlets" or something. It'll prompt you most of the way and then you just need to edit the Class path and add the javax stuff.
    Alternatively you can just save the file with jbuilder and do the compiliation from the command line.
    Hope this helps.

  • URGENT PLEASE HELP WITH A MUSIC FILE

    Sorry for the urgency but this is last minute.
    I need getting a music file to start playing on one slide and play through to about four slides.
    What happens is the music will start playing but when I click to the next slide it stops playing.
    Please Help

    Yes, you will connect two separate Keynote files using the hyperlink function, found in the Hyperlink Inspector. You attach a hyperlink to text or an object (which can be set to be completely transparent), and then point the hyperlink to the other presentation. (When presenting, it is a good idea to have both presentations open, so there is no delay when you click the hyperlink.)

  • Urgent: please help with LOV problem

    Hi,
    I created a record group and LOV (LOV1), also a text item set list of value property to LOV1. When I ran form, it showed the list, but when I selected one from the list, neither double click or click OK put anything into the text item. Could someone tell me what went wrong? Thanks a lot.
    Sa

    Did you set the "column mapping properties" so the LOV can know which value(s) to return to which form item(s)?

  • Urgent-Please help with Adobe Acrobat XPro

    Have the disc, and three out of the 4 programs installed, however, the most important, Adobe Acrobat XPro failed to install onto my computer.  What do I do.  I need this for a project I am working on.

    Do you receive any specific error messages?  Which operating system are you using?

  • Need a help on implemening SAML with Oracle Service Bus

    We are implementing Webservice security using SAML with Oracle Service Bus for our project. We are in dire need of help in implementing the same. We have found some documents (osb console help, osb security) from the oracle web site but those documents have high-level details only. If we get the step-by-step flow and examples of implementing the Webservices security using SAML with Oracle Service Bus, it would be appreciated.
    Requirement details:
    1. Client application has to generate the SAML assertion (token) and pass that token to the OSB proxy service in a SOAP header along with the request.
    2. OSB proxy service gets the authentication token from the inbound request
    3. The token is passed to an SAML Identity Assertion provider and validate the token
    4. If the token is validated successfully then pass the valid token to appropriate business services.
    5. Business services communicates the appropriate external web services after validating the token and gets the response.
    Environment details:
    1. Oracle Weblogic Application Server 10g3
    2. Oracle Service Bus 10g3
    Thanks,
    Suresh Mani

    We are implementing Webservice security using SAML with Oracle Service Bus for our project. We are in dire need of help in implementing the same. We have found some documents (osb console help, osb security) from the oracle web site but those documents have high-level details only. If we get the step-by-step flow and examples of implementing the Webservices security using SAML with Oracle Service Bus, it would be appreciated.
    Requirement details:
    1. Client application has to generate the SAML assertion (token) and pass that token to the OSB proxy service in a SOAP header along with the request.
    2. OSB proxy service gets the authentication token from the inbound request
    3. The token is passed to an SAML Identity Assertion provider and validate the token
    4. If the token is validated successfully then pass the valid token to appropriate business services.
    5. Business services communicates the appropriate external web services after validating the token and gets the response.
    Environment details:
    1. Oracle Weblogic Application Server 10g3
    2. Oracle Service Bus 10g3
    Thanks,
    Suresh Mani

Maybe you are looking for

  • Bugs and poor performance in iphone 4 after upgrading to iOS 7*

    Dear Apple, After upgrading my iPhone 4 to iOS 7, I'm experiencing lots of issues. The performance is the poorest that I've ever seen since I adopted iPhone. Constantly, I need to do the same action (to touch the screen) 3 times until getting any res

  • How do I search for sticky notes in a PDF doc?

    Several people (at work) have commented on a 440-page document that I created, using sticky notes to write their comments in. When I first open the document, the sticky notes are all closed. The icon for a closed sticky note is pretty small and not b

  • Need Sequence for this logic

    Hi, I need sequence for autogenerate of code Table 1 id     code We need to autogenerate code for every new entity of id  ex: id          code sbi        sbi001 hsb        hsb002  xyz        xyz003 And ex: id          code sbi      s001 hsb     h002

  • Itunes and album art

    I recently started importing my cds to itunes. Then I used the 'Get Album Artwork'. it worked fine for all accept one album that it separated into 4 different albums with the same album artwork and 4 different album titles. Is there any easy, quick w

  • Unsupported query for Continuous Query Notification

    Hi all, I'm following an application which supports ADS(Active Data Service). http://www.consideringred.com/files/oracle/2011/ActiveDataServiceADFBCApp-v0.02.zip I build the application and it works well. Then I created a ViewCriteria for the same VO