Substituting substrings (java 1.2)

Please help me design a method called
substitute(String text1, String text2).
I need to locate substring text1 within a general string. Then substitute substring text1, with text2. The following code does not seem to work: substring(k, text1.length()) = text2. Please help, thanks.

I think this should work...
public String substitute(String toBeSearched, String text1, String text2){
int k=toBeSearched.indexOf(text1);
return toBeSearched.substring(0,k-1)+text2+toBeSearched.substring(k+text1.length, toBeSearched.length);
}I haven't tested this out, so I may be off by a char or two here or there... It finds the indexOf text1, then takes everything before it, adds text2, and everything after text2.
I think the reason why the code you've posted doesn't work is that you're creating a new String with the left side, then setting it equal to text2. The code doesn't "remember" that the substring was taken from the original string.

Similar Messages

  • Substitute of java.awt.ToolKit.getDefaultToolKit.beep()

    Hello everybody. I am designing a Swing Application and there I am using java.awt.ToolKit.getDefaultToolKit.beep() method to generate sound in various operations. I want to know is it possible to generate own sound as a substitute of this method? I think it is possible. How can I do this? Thank you.

    Thank you for giving reply.
    As I wish to play .mp3 file I had downloaded an API from Javalobby . I tried it, here is my code :
    package player;
    import java.io.File;
    import java.io.IOException;
    import javax.sound.sampled.AudioFormat;
    import javax.sound.sampled.AudioInputStream;
    import javax.sound.sampled.AudioSystem;
    import javax.sound.sampled.DataLine;
    import javax.sound.sampled.SourceDataLine;
    * @author Tanmoy
    * @Super Scientific Calculator
    * @version 1.2010
    public class Player {
         private File audioFile;
         public Player(String path) {
              this.audioFile = new File(path);
         public void play() {
              AudioInputStream din = null;
              try {
                   AudioInputStream in = AudioSystem.getAudioInputStream(audioFile);
                   AudioFormat baseFormat = in.getFormat();
                   AudioFormat decodedFormat = new AudioFormat(
                        AudioFormat.Encoding.PCM_SIGNED,
                        baseFormat.getSampleRate(), 16, baseFormat.getChannels(),
                        baseFormat.getChannels() * 2, baseFormat.getSampleRate(),
                        false);
                   din = AudioSystem.getAudioInputStream(decodedFormat, in);
                   DataLine.Info info = new DataLine.Info(SourceDataLine.class, decodedFormat);
                   SourceDataLine line = (SourceDataLine) AudioSystem.getLine(info);
                   if (line != null) {
                        line.open(decodedFormat);
                        byte[] data = new byte[4096];
                        line.start();
                        int nBytesRead;
                        while ((nBytesRead = din.read(data, 0, data.length)) != -1) {
                             line.write(data, 0, nBytesRead);
                        line.drain();
                        line.stop();
                        line.close();
                        din.close();
              } catch (Exception e) {
              } finally {
                   if (din != null) {
                        try {
                             din.close();
                        } catch (IOException e) {
    }And the calling, piece of code is :
    try {
                                  Parser parser = new Parser(parsingString, displayPanel.getCurrentBase(),
                                       displayPanel.getCurrentBase(), displayPanel.getTrigoMode(),
                                       displayPanel.getScale());
                                  String output = parser.solve();
                                  displayPanel.outputTextField.setText(output);
                                  displayPanel.outputTextField.setCaretPosition(displayPanel.outputTextField.getText().length());
                                  displayPanel.charLabel.setText((Integer.toString(output.length())));
                                  if (message == null) {
                                       message = "No Exception";
                             } catch (InvalidSyntaxException invalidSyntaxException) {
                                  message = invalidSyntaxException.getMessage();
                                  JOptionPane.showMessageDialog(null, message, "Error", JOptionPane.ERROR_MESSAGE);
                                  new Player("/resources/what_the_hell.mp3").play();
                                  displayPanel.outputTextField.setText("0");
                                  displayPanel.charLabel.setText("0");
                             }But I can not able to here the sound.
    What to do now?
    Thank you.

  • What can I do to use or substitute for java on an android

    Is there a way to open web pages that run on java?

    I have this result from a search:
    *[https://play.google.com/store/apps/details?id=com.aide.ui&hl=en AIDE - Android IDE - Java, C++]
    *[https://java.com/en/download/faq/java_mobile.xml Java Mobile]
    *[http://www.makeuseof.com/answers/access-javabased-website-android-phone/ Makeuseof]

  • Can somebody explain to me how java and xml are related?

    Hi guys
    im new to java and xml.Been reading a lot regarding java and don't seem to have a problem with it...
    the problem is the xml part...im doing a simple GUI project using swing(online store) and i have to convert it to xml
    I have absolutely NO IDEA why i must convert my java to xml and have no idea how to do that.I been reading on the net that xml is a exten~ markup language and it is better and useful.
    Can somebody explain to me in layman terms
    1)how is java and xml related in?
    2)why do ppl want to convert java to xml when they can just stick to java
    3)what is actually xml...
    4)Do i need a program to create xml like i need jcreater to create java application
    5)How do we actually convert?is there any links that you guys could tell me?
    thank you
    tomleo

    im new to java and xml.Been reading a lot regarding
    java and don't seem to have a problem with it...Okay.
    the problem is the xml part...im doing a simple GUI
    project using swing(online store) and i have to
    o convert it to xmlYou have to? So presumably somebody in a position of authority told you that?
    I have absolutely NO IDEA why i must convert my java
    to xml and have no idea how to do that.I been reading
    on the net that xml is a exten~ markup language and
    it is better and useful.I have no idea either (besides which, it doesn't make sense). But why ask us? Somebody told you to do that, ask them why.
    Sure, XML is useful. But it isn't a programming language so it can't be used as a substitute for Java.
    Can somebody explain to me in layman terms
    1)how is java and xml related in?They aren't related, except perhaps in that they are both used in computers.
    2)why do ppl want to convert java to xml when they
    can just stick to javaThey don't.
    3)what is actually xml...Start here for numerous definitions:
    http://www.google.ca/search?hl=en&lr=&oi=defmore&q=define:XML
    4)Do i need a program to create xml like i need
    jcreater to create java applicationNo, XML is just text. But then Java code is just text too.
    5)How do we actually convert?is there any links that
    you guys could tell me?You don't convert Java to XML. My guess is that because you don't know much about Java or XML, you have misinterpreted something that somebody told you.

  • Import statement

    what jvm does when it encounters an import statement

    import statements tells the compiler where to search for the required classes. It is for the understanding of the compiler. In the class file there won't be any import.
    For instance,
    import java.util.*;
    class Something
    void do()
    ArrayList a = new ArrayList(); // line1
    in the class file line1 would be substituted by
    java.util.ArrayList a = new java.util.ArrayList();

  • Is there a way to extract information from a registered schema ?

    Hello,
    with the aid of the XSOM project in java.net, and using the following after I loaded the appropriate jars and creating the wrapper PL/SQL
    CREATE OR REPLACE AND RESOLVE JAVA SOURCE NAMED GMS10.XSOMNAVIGATOR AS
    import java.util.Vector;
    import com.sun.xml.xsom.XSComplexType;
    import com.sun.xml.xsom.XSElementDecl;
    import com.sun.xml.xsom.XSFacet;
    import com.sun.xml.xsom.XSModelGroup;
    import com.sun.xml.xsom.XSModelGroupDecl;
    import com.sun.xml.xsom.XSParticle;
    import com.sun.xml.xsom.XSRestrictionSimpleType;
    import com.sun.xml.xsom.XSSimpleType;
    import com.sun.xml.xsom.XSTerm;
    import com.sun.xml.xsom.parser.XSOMParser;
    public class XSOMNavigator
        public static class SimpleTypeRestriction
            public String[] enumeration = null;
            public String   maxValue    = null;
            public String   minValue    = null;
            public String   length      = null;
            public String   maxLength   = null;
            public String   minLength   = null;
            public String[] pattern     = null;
            public String   totalDigits = null;
            public String toString()
                String enumValues = "";
                if (enumeration != null)
                    for(String val : enumeration)
                        enumValues += val + ", ";
                    enumValues = enumValues.substring(0, enumValues.lastIndexOf(','));
                String patternValues = "";
                if (pattern != null)
                    for(String val : pattern)
                        patternValues += "(" + val + ")|";
                    patternValues = patternValues.substring(0, patternValues.lastIndexOf('|'));
                String retval = "";
                retval += maxValue    == null ? "" : "[MaxValue  = "   + maxValue      + "]\t";
                retval += minValue    == null ? "" : "[MinValue  = "   + minValue      + "]\t";
                retval += maxLength   == null ? "" : "[MaxLength = "   + maxLength     + "]\t";
                retval += minLength   == null ? "" : "[MinLength = "   + minLength     + "]\t";
                retval += pattern     == null ? "" : "[Pattern(s) = "  + patternValues + "]\t";
                retval += totalDigits == null ? "" : "[TotalDigits = " + totalDigits   + "]\t";
                retval += length      == null ? "" : "[Length = "      + length        + "]\t";         
                retval += enumeration == null ? "" : "[Values = "      + enumValues    + "]\t";
                return retval;
        private static void initRestrictions(XSSimpleType xsSimpleType, SimpleTypeRestriction simpleTypeRestriction)
            XSRestrictionSimpleType restriction = xsSimpleType.asRestriction();
            if (restriction != null)
                Vector<String> enumeration = new Vector<String>();
                Vector<String> pattern     = new Vector<String>();
                for (XSFacet facet : restriction.getDeclaredFacets())
                    if (facet.getName().equals(XSFacet.FACET_ENUMERATION))
                        enumeration.add(facet.getValue().value);
                    if (facet.getName().equals(XSFacet.FACET_MAXINCLUSIVE))
                        simpleTypeRestriction.maxValue = facet.getValue().value;
                    if (facet.getName().equals(XSFacet.FACET_MININCLUSIVE))
                        simpleTypeRestriction.minValue = facet.getValue().value;
                    if (facet.getName().equals(XSFacet.FACET_MAXEXCLUSIVE))
                        simpleTypeRestriction.maxValue = String.valueOf(Integer.parseInt(facet.getValue().value) - 1);
                    if (facet.getName().equals(XSFacet.FACET_MINEXCLUSIVE))
                        simpleTypeRestriction.minValue = String.valueOf(Integer.parseInt(facet.getValue().value) + 1);
                    if (facet.getName().equals(XSFacet.FACET_LENGTH))
                        simpleTypeRestriction.length = facet.getValue().value;
                    if (facet.getName().equals(XSFacet.FACET_MAXLENGTH))
                        simpleTypeRestriction.maxLength = facet.getValue().value;
                    if (facet.getName().equals(XSFacet.FACET_MINLENGTH))
                        simpleTypeRestriction.minLength = facet.getValue().value;
                    if (facet.getName().equals(XSFacet.FACET_PATTERN))
                        pattern.add(facet.getValue().value);
                    if (facet.getName().equals(XSFacet.FACET_TOTALDIGITS))
                        simpleTypeRestriction.totalDigits = facet.getValue().value;
                if (enumeration.size() > 0)
                    simpleTypeRestriction.enumeration = enumeration.toArray(new String[] {});
                if (pattern.size() > 0)
                    simpleTypeRestriction.pattern = pattern.toArray(new String[] {});
        private static void printParticle(XSParticle particle, String occurs, String absPath, String indent)
            occurs = "  MinOccurs = " + particle.getMinOccurs() + ", MaxOccurs = " + particle.getMaxOccurs();
            XSTerm term = particle.getTerm();
            if (term.isModelGroup())
                printGroup(term.asModelGroup(), occurs, absPath, indent);   
            else if(term.isModelGroupDecl())
                printGroupDecl(term.asModelGroupDecl(), occurs, absPath, indent);   
            else if (term.isElementDecl())
                printElement(term.asElementDecl(), occurs, absPath, indent);
            else
        private static void printGroup(XSModelGroup modelGroup, String occurs, String absPath, String indent)
            System.out.println(indent + "[Start of " + modelGroup.getCompositor() + occurs + "]" );
            for (XSParticle particle : modelGroup.getChildren())
                printParticle(particle, occurs, absPath, indent + "\t");
            System.out.println(indent + "[End of " + modelGroup.getCompositor() + "]");
        private static void printGroupDecl(XSModelGroupDecl modelGroupDecl, String occurs, String absPath, String indent)
            System.out.println(indent + "[Group " + modelGroupDecl.getName() + occurs + "]");
            printGroup(modelGroupDecl.getModelGroup(), occurs, absPath, indent);
        private static void printComplexType(XSComplexType complexType, String occurs, String absPath, String indent)
            System.out.println();
            XSParticle particle = complexType.getContentType().asParticle();
            if (particle != null)
                printParticle(particle, occurs, absPath, indent);
        private static void printSimpleType(XSSimpleType simpleType, String occurs, String absPath, String indent)
            SimpleTypeRestriction restriction = new SimpleTypeRestriction();
            initRestrictions(simpleType, restriction);
            System.out.println(restriction.toString());
        private static void printElement(XSElementDecl element, String occurs, String absPath, String indent)
            absPath += "/" + element.getName();
            System.out.print(indent + "[Element " + absPath + "   " + occurs + "] of type [" + element.getType().getBaseType().getName() + "]");
            if (element.getType().isComplexType())
                printComplexType(element.getType().asComplexType(), occurs, absPath, indent);
            else
                printSimpleType(element.getType().asSimpleType(), occurs, absPath, indent);
        public static void xsomNavigate(String xsdFile, String rootElement)
            String occurs  = "";
            String absPath = "";
            String indent  = "";
            try
                XSOMParser parser = new XSOMParser();
                parser.parse(xsdFile);
                printElement(parser.getResult().getSchema(1).getElementDecl(rootElement), occurs, absPath, indent);
            catch (Exception exp)
                exp.printStackTrace(System.out);
    /I obtained the following (correct) result
    [Element /CD026A   ] of type [anyType]
    [Start of sequence  MinOccurs = 1, MaxOccurs = 1]
         [Group HEADER  MinOccurs = 1, MaxOccurs = 1]
         [Start of sequence  MinOccurs = 1, MaxOccurs = 1]
              [Element /CD026A/SynIdeMES1     MinOccurs = 1, MaxOccurs = 1] of type [string][Values = UNOC]     
              [Element /CD026A/SynVerNumMES2     MinOccurs = 1, MaxOccurs = 1] of type [string][Values = 3]     
              [Element /CD026A/MesSenMES3     MinOccurs = 1, MaxOccurs = 1] of type [string][MaxLength = 70]     
              [Element /CD026A/SenIdeCodQuaMES4     MinOccurs = 0, MaxOccurs = 1] of type [string][MaxLength = 4]     
              [Element /CD026A/MesRecMES6     MinOccurs = 1, MaxOccurs = 1] of type [string][MaxLength = 35]     
              [Element /CD026A/RecIdeCodQuaMES7     MinOccurs = 0, MaxOccurs = 1] of type [string][MaxLength = 4]     
              [Element /CD026A/DatOfPreMES9     MinOccurs = 1, MaxOccurs = 1] of type [nonNegativeInteger][Pattern(s) = ([1-2][0-9]{3}[0][1-9][0][1-9])|([1-2][0-9]{3}[0][1-9][1|2][0-9])|([1-2][0-9]{3}[0][1-9][3][0|1])|([1-2][0-9]{3}[1][0-2][0][1-9])|([1-2][0-9]{3}[1][0-2][1|2][0-9])|([1-2][0-9]{3}[1][0-2][3][0|1])|([0-9]{2}[0][1-9][0][1-9])|([0-9]{2}[0][1-9][1|2][0-9])|([0-9]{2}[0][1-9][3][0|1])|([0-9]{2}[1][0-2][0][1-9])|([0-9]{2}[1][0-2][1|2][0-9])|([0-9]{2}[1][0-2][3][0|1])]     
              [Element /CD026A/TimOfPreMES10     MinOccurs = 1, MaxOccurs = 1] of type [string][Pattern(s) = ([0-1]{1}[0-9]{1}[0-5]{1}[0-9]{1})|([2]{1}[0-3]{1}[0-5]{1}[0-9]{1})]     [Length = 4]     
              [Element /CD026A/IntConRefMES11     MinOccurs = 1, MaxOccurs = 1] of type [string][MaxLength = 14]     
              [Element /CD026A/RecRefMES12     MinOccurs = 0, MaxOccurs = 1] of type [string][MaxLength = 14]     
              [Element /CD026A/RecRefQuaMES13     MinOccurs = 0, MaxOccurs = 1] of type [string][Length = 2]     
              [Element /CD026A/AppRefMES14     MinOccurs = 0, MaxOccurs = 1] of type [string][MaxLength = 14]     
              [Element /CD026A/PriMES15     MinOccurs = 0, MaxOccurs = 1] of type [string][MaxLength = 1]     
              [Element /CD026A/AckReqMES16     MinOccurs = 0, MaxOccurs = 1] of type [nonNegativeInteger][Values = 0, 1]     
              [Element /CD026A/ComAgrIdMES17     MinOccurs = 0, MaxOccurs = 1] of type [string][MaxLength = 35]     
              [Element /CD026A/TesIndMES18     MinOccurs = 0, MaxOccurs = 1] of type [nonNegativeInteger][Values = 0, 1]     
              [Element /CD026A/MesIdeMES19     MinOccurs = 1, MaxOccurs = 1] of type [string][MaxLength = 14]     
              [Element /CD026A/MesTypMES20     MinOccurs = 1, MaxOccurs = 1] of type [string][Values = CC004A, CC005A, CC007A, CC008A, CC009A, CC013A, CC014A, CC015A, CC016A, CC017A, CC019A, CC021A, CC023A, CC025A, CC026A, CC028A, CC029A, CC035A, CC043A, CC044A, CC045A, CC051A, CC054A, CC055A, CC058A, CC060A, CC062A, CC100A, CC102A, CC103A, CC224A, CC225A, CC228A, CC229A, CC231A, CC907A, CC917A, CD001A, CD002A, CD003A, CD006A, CD010A, CD018A, CD020A, CD024A, CD027A, CD030A, CD031A, CD032A, CD033A, CD034A, CD037A, CD038A, CD050A, CD059A, CD063A, CD104A, CD105A, CD106A, CD111A, CD112A, CD114A, CD115A, CD118A, CD200A, CD201A, CD203A, CD204A, CD205A, CD209A, CD411A, CD901A, CD904A, CD905A, CD906A, CD907A, CD912A, CD913A, CD914A, CD916A, CD931A, CD932A, AT004A, AT005A, AT007A, AT008A, AT009A, AT013A, AT014A, AT015A, AT016A, AT017A, AT019A, AT021A, AT023A, AT025A, AT026A, AT028A, AT029A, AT035A, AT043A, AT044A, AT045A, AT051A, AT054A, AT055A, AT058A, AT060A, AT062A, AT100A, AT102A, AT103A, AT224A, AT225A, AT228A, AT229A, AT231A, AT907A, AT917A, BE004A, BE005A, BE007A, BE008A, BE009A, BE013A, BE014A, BE015A, BE016A, BE017A, BE019A, BE021A, BE023A, BE025A, BE026A, BE028A, BE029A, BE035A, BE043A, BE044A, BE045A, BE051A, BE054A, BE055A, BE058A, BE060A, BE062A, BE100A, BE102A, BE103A, BE224A, BE225A, BE228A, BE229A, BE231A, BE907A, BE917A, CY004A, CY005A, CY007A, CY008A, CY009A, CY013A, CY014A, CY015A, CY016A, CY017A, CY019A, CY021A, CY023A, CY025A, CY026A, CY028A, CY029A, CY035A, CY043A, CY044A, CY045A, CY051A, CY054A, CY055A, CY058A, CY060A, CY062A, CY100A, CY102A, CY103A, CY224A, CY225A, CY228A, CY229A, CY231A, CY907A, CY917A, CZ004A, CZ005A, CZ007A, CZ008A, CZ009A, CZ013A, CZ014A, CZ015A, CZ016A, CZ017A, CZ019A, CZ021A, CZ023A, CZ025A, CZ026A, CZ028A, CZ029A, CZ035A, CZ043A, CZ044A, CZ045A, CZ051A, CZ054A, CZ055A, CZ058A, CZ060A, CZ062A, CZ100A, CZ102A, CZ103A, CZ224A, CZ225A, CZ228A, CZ229A, CZ231A, CZ907A, CZ917A, DE004A, DE005A, DE007A, DE008A, DE009A, DE013A, DE014A, DE015A, DE016A, DE017A, DE019A, DE021A, DE023A, DE025A, DE026A, DE028A, DE029A, DE035A, DE043A, DE044A, DE045A, DE051A, DE054A, DE055A, DE058A, DE060A, DE062A, DE100A, DE102A, DE103A, DE224A, DE225A, DE228A, DE229A, DE231A, DE907A, DE917A, DK004A, DK005A, DK007A, DK008A, DK009A, DK013A, DK014A, DK015A, DK016A, DK017A, DK019A, DK021A, DK023A, DK025A, DK026A, DK028A, DK029A, DK035A, DK043A, DK044A, DK045A, DK051A, DK054A, DK055A, DK058A, DK060A, DK062A, DK100A, DK102A, DK103A, DK224A, DK225A, DK228A, DK229A, DK231A, DK907A, DK917A, EE004A, EE005A, EE007A, EE008A, EE009A, EE013A, EE014A, EE015A, EE016A, EE017A, EE019A, EE021A, EE023A, EE025A, EE026A, EE028A, EE029A, EE035A, EE043A, EE044A, EE045A, EE051A, EE054A, EE055A, EE058A, EE060A, EE062A, EE100A, EE102A, EE103A, EE224A, EE225A, EE228A, EE229A, EE231A, EE907A, EE917A, ES004A, ES005A, ES007A, ES008A, ES009A, ES013A, ES014A, ES015A, ES016A, ES017A, ES019A, ES021A, ES023A, ES025A, ES026A, ES028A, ES029A, ES035A, ES043A, ES044A, ES045A, ES051A, ES054A, ES055A, ES058A, ES060A, ES062A, ES100A, ES102A, ES103A, ES224A, ES225A, ES228A, ES229A, ES231A, ES907A, ES917A, FI004A, FI005A, FI007A, FI008A, FI009A, FI013A, FI014A, FI015A, FI016A, FI017A, FI019A, FI021A, FI023A, FI025A, FI026A, FI028A, FI029A, FI035A, FI043A, FI044A, FI045A, FI051A, FI054A, FI055A, FI058A, FI060A, FI062A, FI100A, FI102A, FI103A, FI224A, FI225A, FI228A, FI229A, FI231A, FI907A, FI917A, FR004A, FR005A, FR007A, FR008A, FR009A, FR013A, FR014A, FR015A, FR016A, FR017A, FR019A, FR021A, FR023A, FR025A, FR026A, FR028A, FR029A, FR035A, FR043A, FR044A, FR045A, FR051A, FR054A, FR055A, FR058A, FR060A, FR062A, FR100A, FR102A, FR103A, FR224A, FR225A, FR228A, FR229A, FR231A, FR907A, FR917A, GB004A, GB005A, GB007A, GB008A, GB009A, GB013A, GB014A, GB015A, GB016A, GB017A, GB019A, GB021A, GB023A, GB025A, GB026A, GB028A, GB029A, GB035A, GB043A, GB044A, GB045A, GB051A, GB054A, GB055A, GB058A, GB060A, GB062A, GB100A, GB102A, GB103A, GB224A, GB225A, GB228A, GB229A, GB231A, GB907A, GB917A, GF004A, GF005A, GF007A, GF008A, GF009A, GF013A, GF014A, GF015A, GF016A, GF017A, GF019A, GF021A, GF023A, GF025A, GF026A, GF028A, GF029A, GF035A, GF043A, GF044A, GF045A, GF051A, GF054A, GF055A, GF058A, GF060A, GF062A, GF100A, GF102A, GF103A, GF224A, GF225A, GF228A, GF229A, GF231A, GF907A, GF917A, GP004A, GP005A, GP007A, GP008A, GP009A, GP013A, GP014A, GP015A, GP016A, GP017A, GP019A, GP021A, GP023A, GP025A, GP026A, GP028A, GP029A, GP035A, GP043A, GP044A, GP045A, GP051A, GP054A, GP055A, GP058A, GP060A, GP062A, GP100A, GP102A, GP103A, GP224A, GP225A, GP228A, GP229A, GP231A, GP907A, GP917A, GR004A, GR005A, GR007A, GR008A, GR009A, GR013A, GR014A, GR015A, GR016A, GR017A, GR019A, GR021A, GR023A, GR025A, GR026A, GR028A, GR029A, GR035A, GR043A, GR044A, GR045A, GR051A, GR054A, GR055A, GR058A, GR060A, GR062A, GR100A, GR102A, GR103A, GR224A, GR225A, GR228A, GR229A, GR231A, GR907A, GR917A, HU004A, HU005A, HU007A, HU008A, HU009A, HU013A, HU014A, HU015A, HU016A, HU017A, HU019A, HU021A, HU023A, HU025A, HU026A, HU028A, HU029A, HU035A, HU043A, HU044A, HU045A, HU051A, HU054A, HU055A, HU058A, HU060A, HU062A, HU100A, HU102A, HU103A, HU224A, HU225A, HU228A, HU229A, HU231A, HU907A, HU917A, IE004A, IE005A, IE007A, IE008A, IE009A, IE013A, IE014A, IE015A, IE016A, IE017A, IE019A, IE021A, IE023A, IE025A, IE026A, IE028A, IE029A, IE035A, IE043A, IE044A, IE045A, IE051A, IE054A, IE055A, IE058A, IE060A, IE062A, IE100A, IE102A, IE103A, IE224A, IE225A, IE228A, IE229A, IE231A, IE907A, IE917A, IT004A, IT005A, IT007A, IT008A, IT009A, IT013A, IT014A, IT015A, IT016A, IT017A, IT019A, IT021A, IT023A, IT025A, IT026A, IT028A, IT029A, IT035A, IT043A, IT044A, IT045A, IT051A, IT054A, IT055A, IT058A, IT060A, IT062A, IT100A, IT102A, IT103A, IT224A, IT225A, IT228A, IT229A, IT231A, IT907A, IT917A, LT004A, LT005A, LT007A, LT008A, LT009A, LT013A, LT014A, LT015A, LT016A, LT017A, LT019A, LT021A, LT023A, LT025A, LT026A, LT028A, LT029A, LT035A, LT043A, LT044A, LT045A, LT051A, LT054A, LT055A, LT058A, LT060A, LT062A, LT100A, LT102A, LT103A, LT224A, LT225A, LT228A, LT229A, LT231A, LT907A, LT917A, LU004A, LU005A, LU007A, LU008A, LU009A, LU013A, LU014A, LU015A, LU016A, LU017A, LU019A, LU021A, LU023A, LU025A, LU026A, LU028A, LU029A, LU035A, LU043A, LU044A, LU045A, LU051A, LU054A, LU055A, LU058A, LU060A, LU062A, LU100A, LU102A, LU103A, LU224A, LU225A, LU228A, LU229A, LU231A, LU907A, LU917A, LV004A, LV005A, LV007A, LV008A, LV009A, LV013A, LV014A, LV015A, LV016A, LV017A, LV019A, LV021A, LV023A, LV025A, LV026A, LV028A, LV029A, LV035A, LV043A, LV044A, LV045A, LV051A, LV054A, LV055A, LV058A, LV060A, LV062A, LV100A, LV102A, LV103A, LV224A, LV225A, LV228A, LV229A, LV231A, LV907A, LV917A, MC004A, MC005A, MC007A, MC008A, MC009A, MC013A, MC014A, MC015A, MC016A, MC017A, MC019A, MC021A, MC023A, MC025A, MC026A, MC028A, MC029A, MC035A, MC043A, MC044A, MC045A, MC051A, MC054A, MC055A, MC058A, MC060A, MC062A, MC100A, MC102A, MC103A, MC224A, MC225A, MC228A, MC229A, MC231A, MC907A, MC917A, MQ004A, MQ005A, MQ007A, MQ008A, MQ009A, MQ013A, MQ014A, MQ015A, MQ016A, MQ017A, MQ019A, MQ021A, MQ023A, MQ025A, MQ026A, MQ028A, MQ029A, MQ035A, MQ043A, MQ044A, MQ045A, MQ051A, MQ054A, MQ055A, MQ058A, MQ060A, MQ062A, MQ100A, MQ102A, MQ103A, MQ224A, MQ225A, MQ228A, MQ229A, MQ231A, MQ907A, MQ917A, MT004A, MT005A, MT007A, MT008A, MT009A, MT013A, MT014A, MT015A, MT016A, MT017A, MT019A, MT021A, MT023A, MT025A, MT026A, MT028A, MT029A, MT035A, MT043A, MT044A, MT045A, MT051A, MT054A, MT055A, MT058A, MT060A, MT062A, MT100A, MT102A, MT103A, MT224A, MT225A, MT228A, MT229A, MT231A, MT907A, MT917A, NL004A, NL005A, NL007A, NL008A, NL009A, NL013A, NL014A, NL015A, NL016A, NL017A, NL019A, NL021A, NL023A, NL025A, NL026A, NL028A, NL029A, NL035A, NL043A, NL044A, NL045A, NL051A, NL054A, NL055A, NL058A, NL060A, NL062A, NL100A, NL102A, NL103A, NL224A, NL225A, NL228A, NL229A, NL231A, NL907A, NL917A, PL004A, PL005A, PL007A, PL008A, PL009A, PL013A, PL014A, PL015A, PL016A, PL017A, PL019A, PL021A, PL023A, PL025A, PL026A, PL028A, PL029A, PL035A, PL043A, PL044A, PL045A, PL051A, PL054A, PL055A, PL058A, PL060A, PL062A, PL100A, PL102A, PL103A, PL224A, PL225A, PL228A, PL229A, PL231A, PL907A, PL917A, PT004A, PT005A, PT007A, PT008A, PT009A, PT013A, PT014A, PT015A, PT016A, PT017A, PT019A, PT021A, PT023A, PT025A, PT026A, PT028A, PT029A, PT035A, PT043A, PT044A, PT045A, PT051A, PT054A, PT055A, PT058A, PT060A, PT062A, PT100A, PT102A, PT103A, PT224A, PT225A, PT228A, PT229A, PT231A, PT907A, PT917A, RE004A, RE005A, RE007A, RE008A, RE009A, RE013A, RE014A, RE015A, RE016A, RE017A, RE019A, RE021A, RE023A, RE025A, RE026A, RE028A, RE029A, RE035A, RE043A, RE044A, RE045A, RE051A, RE054A, RE055A, RE058A, RE060A, RE062A, RE100A, RE102A, RE103A, RE224A, RE225A, RE228A, RE229A, RE231A, RE907A, RE917A, SE004A, SE005A, SE007A, SE008A, SE009A, SE013A, SE014A, SE015A, SE016A, SE017A, SE019A, SE021A, SE023A, SE025A, SE026A, SE028A, SE029A, SE035A, SE043A, SE044A, SE045A, SE051A, SE054A, SE055A, SE058A, SE060A, SE062A, SE100A, SE102A, SE103A, SE224A, SE225A, SE228A, SE229A, SE231A, SE907A, SE917A, SI004A, SI005A, SI007A, SI008A, SI009A, SI013A, SI014A, SI015A, SI016A, SI017A, SI019A, SI021A, SI023A, SI025A, SI026A, SI028A, SI029A, SI035A, SI043A, SI044A, SI045A, SI051A, SI054A, SI055A, SI058A, SI060A, SI062A, SI100A, SI102A, SI103A, SI224A, SI225A, SI228A, SI229A, SI231A, SI907A, SI917A, SK004A, SK005A, SK007A, SK008A, SK009A, SK013A, SK014A, SK015A, SK016A, SK017A, SK019A, SK021A, SK023A, SK025A, SK026A, SK028A, SK029A, SK035A, SK043A, SK044A, SK045A, SK051A, SK054A, SK055A, SK058A, SK060A, SK062A, SK100A, SK102A, SK103A, SK224A, SK225A, SK228A, SK229A, SK231A, SK907A, SK917A, CH004A, CH005A, CH007A, CH008A, CH009A, CH013A, CH014A, CH015A, CH016A, CH017A, CH019A, CH021A, CH023A, CH025A, CH026A, CH028A, CH029A, CH035A, CH043A, CH044A, CH045A, CH051A, CH054A, CH055A, CH058A, CH060A, CH062A, CH100A, CH102A, CH103A, CH224A, CH225A, CH228A, CH229A, CH231A, CH907A, CH917A, IS004A, IS005A, IS007A, IS008A, IS009A, IS013A, IS014A, IS015A, IS016A, IS017A, IS019A, IS021A, IS023A, IS025A, IS026A, IS028A, IS029A, IS035A, IS043A, IS044A, IS045A, IS051A, IS054A, IS055A, IS058A, IS060A, IS062A, IS100A, IS102A, IS103A, IS224A, IS225A, IS228A, IS229A, IS231A, IS907A, IS917A, NO004A, NO005A, NO007A, NO008A, NO009A, NO013A, NO014A, NO015A, NO016A, NO017A, NO019A, NO021A, NO023A, NO025A, NO026A, NO028A, NO029A, NO035A, NO043A, NO044A, NO045A, NO051A, NO054A, NO055A, NO058A, NO060A, NO062A, NO100A, NO102A, NO103A, NO224A, NO225A, NO228A, NO229A, NO231A, NO907A, NO917A, SJ004A, SJ005A, SJ007A, SJ008A, SJ009A, SJ013A, SJ014A, SJ015A, SJ016A, SJ017A, SJ019A, SJ021A, SJ023A, SJ025A, SJ026A, SJ028A, SJ029A, SJ035A, SJ043A, SJ044A, SJ045A, SJ051A, SJ054A, SJ055A, SJ058A, SJ060A, SJ062A, SJ100A, SJ102A, SJ103A, SJ224A, SJ225A, SJ228A, SJ229A, SJ231A, SJ907A, SJ917A]     
              [Element /CD026A/ComAccRefMES21     MinOccurs = 0, MaxOccurs = 1] of type [string][MaxLength = 35]     
              [Element /CD026A/MesSeqNumMES22     MinOccurs = 0, MaxOccurs = 1] of type [nonNegativeInteger][TotalDigits = 2]     
              [Element /CD026A/FirAndLasTraMES23     MinOccurs = 0, MaxOccurs = 1] of type [string][Values = F, L]     
         [End of sequence]
         [Element /CD026A/TRAPRIPC1     MinOccurs = 1, MaxOccurs = 1] of type [anyType]
         [Start of sequence  MinOccurs = 1, MaxOccurs = 1]
              [Element /CD026A/TRAPRIPC1/TINPC159     MinOccurs = 1, MaxOccurs = 1] of type [string][MaxLength = 17]     
         [End of sequence]
         [Element /CD026A/CUSTOFFGUARNT     MinOccurs = 1, MaxOccurs = 1] of type [anyType]
         [Start of sequence  MinOccurs = 1, MaxOccurs = 1]
              [Element /CD026A/CUSTOFFGUARNT/RefNumRNT1     MinOccurs = 1, MaxOccurs = 1] of type [string][Length = 8]     
         [End of sequence]
         [Element /CD026A/GUAREF2     MinOccurs = 1, MaxOccurs = 1] of type [anyType]
         [Start of sequence  MinOccurs = 1, MaxOccurs = 1]
              [Element /CD026A/GUAREF2/GuaRefNumGRNREF21     MinOccurs = 1, MaxOccurs = 1] of type [string][MaxLength = 24]     
              [Element /CD026A/GUAREF2/ACCDOC728     MinOccurs = 0, MaxOccurs = 99] of type [anyType]
              [Start of sequence  MinOccurs = 1, MaxOccurs = 1]
                   [Element /CD026A/GUAREF2/ACCDOC728/AccCodCOD729     MinOccurs = 1, MaxOccurs = 1] of type [string][Length = 4]     
              [End of sequence]
              [Element /CD026A/GUAREF2/ACCDOCPC4     MinOccurs = 1, MaxOccurs = 1] of type [anyType]
              [Start of sequence  MinOccurs = 1, MaxOccurs = 1]
                   [Element /CD026A/GUAREF2/ACCDOCPC4/AccCodPC41     MinOccurs = 1, MaxOccurs = 1] of type [string][Length = 4]     
              [End of sequence]
              [Element /CD026A/GUAREF2/ACCCODPC3     MinOccurs = 1, MaxOccurs = 1] of type [anyType]
              [Start of sequence  MinOccurs = 1, MaxOccurs = 1]
                   [Element /CD026A/GUAREF2/ACCCODPC3/AccCodPC31     MinOccurs = 1, MaxOccurs = 1] of type [string][Length = 4]     
              [End of sequence]
         [End of sequence]
    [End of sequence]I still thing this is a bit of an overkill, but I will use it as a last resort in order to substitute the built-in parser so I can collect all the errors of an XML source in one go.
    Is there a way to obtain the same information from the XDB registry where my schemas will reside ? If yes, I will gladly substitute this Java class with whatever your suggestion is :)
    If not, I intend to store the extracted information in suitably constructed database tables and use a PL/SQL procedure to do the validation by traversing the table information accordingly (XPath by XPath) collecting the errors as I traverse the XML. Hopefully, due to the XPaths being very targeted towards the information that will be checked, I will avoid the DOM memory tree overhead.
    Finally, if I follow the path I described, is there a way to put some sort of trigger for the cases of copyEvolve(), inPlaceEvolve() and drop-and-reinsert so that my process will be called again for the new data ?
    Apologies for the lengthy code and result set.
    Best Regards
    Philip
    PS: I did not include the XSD file itself because it includes another four XSDs. If needed I will do it in a reply post though ...

    Good morning Marco,
    I am back at the office today, so I am trying to catch up with everything.
    If I remember though, RESOURCE_VIEW and PATH_VIEW are related to the "exploration" of the XDB registry (but I may very well be wrong !).
    What I want is to retrieve schema information (if XDB actually shreds the XML schema on registration) like elements paths, simple and complex type contents, sequence information, particle occurence information, groups and group declarations etc.
    I think it makes sense that Oracle stores these somewhere, since it uses the information on OR storage to generate types and tables anyway ;) That is of course if the whole OR shredding is not done totally on-the-fly...
    I managed to get clearance to release partial information about some of the schemas and their related documentation, so I will be passing them to you and Mark through private emails (of course) in order to give you a clearer understanding of the whole project.
    Just give me a day to write a few pages that explain how the whole operation is performed.
    Best Regards
    Philip

  • Error in DAC 7.9.4 while building the execution plan

    I'm getting Java exception EXCEPTION CLASS::: java.lang.NullPointerException while building the execution plan. The parameters are properly generated.
    Earlier we used to get the error - No physical database mapping for the logical source was found for :DBConnection_OLAP as used in QUERY_INDEX_CREATION(DBConnection_OLAP->DBConnection_OLAP)
    EXCEPTION CLASS::: com.siebel.analytics.etl.execution.NoSuchDatabaseException
    We resolved this issue by using the in built connection parameters i.e. DBConnection_OLAP. This connection parameter has to be used because the execution plan cannot be built without OLAP connection.
    We are not using 7.9.4 OLAP data model since we have highly customized 7.8.3 OLAP model. We have imported 7.8.3 tables in DAC.
    We have created all the tasks with syncronzation method, created the task group and subject area. We are using in built DBConnection_OLAP and DBConnection_OLTP parameters and pointed them to relevant databases.
    system set up -
    OBI DAC server - windows server
    Informatica server and repository sever 7.1.4 - installed on local machine and
    provied PATH variables.
    IS this problem regarding the different versions i.e. we are using OBI DAC 7.9.4 and underlying data model is 7.8.3?
    Please help,
    Thanks and regards,
    Ashish

    Hi,
    Can anyone help me here as I have stuck with the following issue................?
    I have created a command task in workflow at Informatica that will execute a script in Unix to purge chache at OBIEE.But I want that workflow to be added as a task in DAC at already existing Plan and should be run at the last one whenever the Incremental load happens.
    I created a Task in DAC with name of Workflow like WF_AUTO_PURGE and added that task as following task at Execution mode,The problem here is,I want to build that task after adding to the plan.I some how stuck here , When I try to build the task It is giving following error !!!!!
    MESSAGE:::Error while loading pre post steps for Execution Plan. CompleteLoad_withDeleteNo physical database mapping for the logical source was found for :DBConnection_INFA as used in WF_AUTO_PURGE (DBConnection_INFA->DBConnection_INFA)
    EXCEPTION CLASS::: com.siebel.analytics.etl.execution.ExecutionPlanInitializationException
    com.siebel.analytics.etl.execution.ExecutionPlanDesigner.design(ExecutionPlanDesigner.java:1317)
    com.siebel.analytics.etl.client.util.tables.DefnBuildHelper.calculate(DefnBuildHelper.java:169)
    com.siebel.analytics.etl.client.util.tables.DefnBuildHelper.calculate(DefnBuildHelper.java:119)
    com.siebel.analytics.etl.client.view.table.EtlDefnTable.doOperation(EtlDefnTable.java:169)
    com.siebel.etl.gui.view.dialogs.WaitDialog.doOperation(WaitDialog.java:53)
    com.siebel.etl.gui.view.dialogs.WaitDialog$WorkerThread.run(WaitDialog.java:85)
    ::: CAUSE :::
    MESSAGE:::No physical database mapping for the logical source was found for :DBConnection_INFA as used in WF_AUTO_PURGE(DBConnection_INFA->DBConnection_INFA)
    EXCEPTION CLASS::: com.siebel.analytics.etl.execution.NoSuchDatabaseException
    com.siebel.analytics.etl.execution.ExecutionParameterHelper.substitute(ExecutionParameterHelper.java:208)
    com.siebel.analytics.etl.execution.ExecutionParameterHelper.parameterizeTask(ExecutionParameterHelper.java:139)
    com.siebel.analytics.etl.execution.ExecutionPlanDesigner.handlePrePostTasks(ExecutionPlanDesigner.java:949)
    com.siebel.analytics.etl.execution.ExecutionPlanDesigner.getExecutionPlanTasks(ExecutionPlanDesigner.java:790)
    com.siebel.analytics.etl.execution.ExecutionPlanDesigner.design(ExecutionPlanDesigner.java:1267)
    com.siebel.analytics.etl.client.util.tables.DefnBuildHelper.calculate(DefnBuildHelper.java:169)
    com.siebel.analytics.etl.client.util.tables.DefnBuildHelper.calculate(DefnBuildHelper.java:119)
    com.siebel.analytics.etl.client.view.table.EtlDefnTable.doOperation(EtlDefnTable.java:169)
    com.siebel.etl.gui.view.dialogs.WaitDialog.doOperation(WaitDialog.java:53)
    com.siebel.etl.gui.view.dialogs.WaitDialog$WorkerThread.run(WaitDialog.java:85)
    Regards,
    Arul
    Edited by: 869389 on Jun 30, 2011 11:02 PM
    Edited by: 869389 on Jul 1, 2011 2:00 AM

  • JDeveloper 11g Using jsp to display images

    I am converting a 10.1.3.3 application to 11.1.1.3
    It has 2 web modules. One is an ADF administrator module and the other is a public web that displays information including images stored as blobs.
    This public module has a simple technology scope, only html, java, jsp and servlets. It is a hand me down from a few technologies ago and ran well on 10.1.3.3
    To display images it uses a jsp acting as a servlet which is referenced inside other jsps. Since moving to 11g the images no longer display. If I use a java class servlet it works
    however I have to use the full url, e.g. http://mydomain:myport/web/Sevlet?.... which means I have to update the details for each deployment.
    I can use <h:graphicImage but this means I have to include JSF and use expression language to fill in the servlet parameters.
    I don't know what has changed to cause it to fail. Weblogic?
    The Libraries and Classpath include
    JSP Runtime
    Servlet Runtime
    JSTL 1.2
    The servlet jsp is as follows remembering it works in 10.1.3.3
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <%@ page contentType="text/html;charset=windows-1252"%>
    <%@ page import="javax.naming.Context" %>
    <%@ page import="java.io.*" %>
    <%@ page import="userinterface.util.ByteArray" %>
    <%@ page import="userinterface.online.ImageUIHelper" %>
    <%@ page import="userinterface.online.ImageUIHelperValue" %>
    <%
         String dataObjectId = "";
         String regionId = "";
         boolean getObjectImage=false;
         boolean getRegionImage=false;
         // determine which type of image to retrieve
         if (request.getParameter("dataObjectId") != null)
              dataObjectId = request.getParameter("dataObjectId").toString();
              getObjectImage=true;
         } else if (request.getParameter("regionId") != null)
              regionId = request.getParameter("regionId").toString();
              getRegionImage=true;
         if (getObjectImage==true || getRegionImage == true)
              try
                   ImageUIHelper imageHelper = new ImageUIHelper();
                   ImageUIHelperValue vo = null;
                   if (getObjectImage)
                        vo = imageHelper.doReadObjectImage(new Integer(dataObjectId));
                   } else if (getRegionImage)
                        vo = imageHelper.doReadRegionImage(new Integer(regionId));
                   if (vo != null && vo.getImage() != null)
                        // determine the mimetype
                        String mimeType="image/png";
                        if (vo.getFilename().toLowerCase().endsWith(".gif"))
                             mimeType = "image/gif";
                        else if (vo.getFilename().toLowerCase().endsWith(".jpg"))
                             mimeType = "image/jpg; charset=windows-1252";
                        else if (vo.getFilename().toLowerCase().endsWith(".png"))
                             mimeType = "image/png";
                        else if (vo.getFilename().toLowerCase().endsWith(".bmp"))
                             mimeType = "image/bmp";
                        response.setContentType(mimeType);
                        response.setHeader("pragma", "no-cache");
                        ServletOutputStream os = response.getOutputStream();
    os.write(vo.getImage().getBytes());
                        os.flush();
                        os.close();
              } catch (Exception ex)
    A simple test harness follows. The actual pages substitute the java values using <%= uri %> as below
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <%@ page contentType="text/html;charset=windows-1252"%>
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
    <%
    String uri = "http://localhost:7101/publicweb/img/ImageServlet?imageType=dataObject&dataObjectId=822";
    String uri2 = "ImageServlet.jsp?dataObjectId=822";
    String uri3 = "ImageServlet.jsp?dataObjectId=694";
    %>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"/>
    <title>testServlet</title>
    </head>
    <body>
    <table cellspacing="2" cellpadding="3" border="1" width="100%">
    <tr>
    <td width="20%">Checking Servlet</td>
    <td width="80%"><img src=<%= uri %>
    id="imge"
    width="400px" alt="Image" />
    </td>
    </tr>
    </table>
    </body>
    </html>

    i responded to your duplicate message 4 days ago:
    is it possible to insert and retrieve images from sql server using actionscript.
    you'll need server-side script to query your database and you can use the flash urlloader class to call your script.
    also  is it possible to create a flash scrolling gallery based on images  stored in a database and everytime an image is added it is displayed in  the gallery.
    load the data using the urlloader class and  then load the images.  periodically query the database for new images if  there's no direct way for flash to know a new image was added.

  • Build plan error

    Hi,
    I created new container for Financial Oracle 11.5.10 after that i added new container subject areas to Financial Oracle 11.5.10 execution plan afer that executed buld paln.
    i got below error.
    Financials_Oracle 11.5.10
    MESSAGE:::There is no database (as defined in DAC repository) that match the name DBConnection_OLAP
    EXCEPTION CLASS::: com.siebel.analytics.etl.execution.NoSuchDatabaseException
    com.siebel.analytics.etl.execution.DatabaseConnections.getByName(DatabaseConnections.java:161)
    com.siebel.analytics.etl.execution.DatabaseConnections.getPhysicalByName(DatabaseConnections.java:179)
    com.siebel.analytics.etl.execution.ExecutionParameterHelper.substitute(ExecutionParameterHelper.java:211)
    com.siebel.analytics.etl.execution.ExecutionParameterHelper.parameterizeTask(ExecutionParameterHelper.java:139)
    com.siebel.analytics.etl.execution.ExecutionPlanDesigner.getExecutionPlanTasks(ExecutionPlanDesigner.java:738)
    com.siebel.analytics.etl.execution.ExecutionPlanDesigner.design(ExecutionPlanDesigner.java:1267)
    com.siebel.analytics.etl.client.util.tables.DefnBuildHelper.calculate(DefnBuildHelper.java:169)
    com.siebel.analytics.etl.client.util.tables.DefnBuildHelper.calculate(DefnBuildHelper.java:119)
    com.siebel.analytics.etl.client.view.table.EtlDefnTable.doOperation(EtlDefnTable.java:169)
    com.siebel.etl.gui.view.dialogs.WaitDialog.doOperation(WaitDialog.java:53)
    com.siebel.etl.gui.view.dialogs.WaitDialog$WorkerThread.run(WaitDialog.java:85)

    Hi,
    Have you defined a database in the physical datasources of type Warehouse? Have you generated the parameters for the execution plan (Execute Tab -> select execution plan -> go to parameters tab in the bottom set of applets -> hit the generate button), if you have already done it is there one in there called DBConnection_OLAP?
    Regards,
    Matt

  • Cosuming webservice+ 500 error

    Hi all,
    I have a question.
    I am trying to consume SAP Web Services via proxy. Certain things I should make clear.
    1. I am not using SAP NetWeaver Developer Studio to create the proxy. I used apache axis wsdl2java tool to create the proxy from the wsdl.
    2. After that I used client code written in java to consume the webservice via the proxy
    3. After that I "substituted" the java client by a groovy client for the same purpose.
    4. I took care of BASIC authentication by setting appropriate username and password.
    Result:
    I get the think to work with the java client but the same stuff fails with the groovy client. It gives 500 (Unknown host error)
    According to literature 500 error is server side and nothing can be done in client to rectiy it. Strange as it seems, the same server behaves right with java client but not with groovy client. Does anyone have any idea or a concrete solution?

    hi,
    I think 500 is 'internal server error', a catch all error message.
    For the situation you describe, given you really feed them two clients with the same data I can only think that the groovy client does not build a valid soap message or the groovy client does some malicious conversion (or non-conversion) to the data supplied (e.g. not escaping a character like > ).
    In any way, it helps to look into transaction ST22.
    regards,
    anton

  • Simple question... refresh page

    Hi I am trying to do this :
    htp.p('<script>window.location.reload();</script>');
    And for some reason its not working, it used to, but now the page blinks when I run it.
    Is there a portal procedure to refresh a page so I can substitute this java script?

    Hi,
    look at the pool component
    <af:poll interval="1" pollListener="#{PollBean.pollListener}">
    ... anything to refresh here ...
    </af:poll>
    Note that the pollListener="#{PollBean.pollListener} references a method in the managed bean so I can work with the polling on teh server side (e.g. to prepare data)
    Frank

  • Rhino API Advantages

    hello !
    does anyone know what advantages and/or disadvantages does rhino API have? as i jnow its faster but here is my code:
    import org.mozilla.javascript.Context;
    import org.mozilla.javascript.Function;
    import org.mozilla.javascript.Scriptable;
    public class SimpleRhino {
         public void simple() {
              int c=0;
              for (int i = 0; i < 10000000; i++) {
                   c++;
         public void simpleWithRhino() {
              Context ctx = Context.enter();
              try {
                   Scriptable scope = ctx.initStandardObjects(null);
                   Object result = null;
                   String source = "function f(){\n" +
                             "\n var i=0;" +
                             "\n var j=0;" +
                             "\n var c=0;" +
                             "\n for(i=0;i<10000000;i++) " +
                             "\n c++;"+
                             "\n return c;}";
                   scope.put("name", scope,null);
                   ctx.evaluateString(scope, source, "<script>", 0, null);
                   Object f = scope.get("f", scope);
                result=((Function)f).call(ctx, scope, null, null);
                System.out.println(Context.toString(result));
              } catch (Exception ex) {
                   ex.printStackTrace();
              } finally {
                   Context.exit();
         public static void main(String[] args) {
              SimpleRhino s = new SimpleRhino();
              long l = System.currentTimeMillis();
              s.simpleWithRhino();
              System.out.println(System.currentTimeMillis() - l);
    }when i test it simple() function works faster than simpleWithRhino() . can anyone tell me shortly what advantages does Rhino API have?

    JS and Rhino are not a substitute for Java - it's a LOT slower and much more hassle.
    You may want to use Rhino to solve a number of problems, some examples might be
    1) You need dynamic code which can be changed quickly without recompilation. You could implement dynamic business rules this way.
    2) It solves some problem that Java doesn't solve easily. I saw a number of examples here which take advantage of JavaScript's arithmetic processing.
    Though it should be used sparingly in any of these cases. Having too much code implemented in JavaScript like this will take its toll on application performance and you also lose static typing and a number of other benefits Java offers.
    Edited by: binary_coder on May 6, 2009 6:19 AM

  • Java SubStrings

    Hey guyz,
    I really need some help here on the logic/ algorithm for thiz question...Now I have to identify whether the text that I have typed in the textArea is a java operator or not n extract all the operator found in the textarea...Seems to me like I have done it properly, but there iz somethin wrong...Itz givin me the same operator as output
    import java.util.* ;
    import java.awt.event.*;
    import java.awt.*;
    import java.io.*;
    import javax.swing.*;
    public class MyOperators extends JFrame implements ActionListener {
        private JTextArea space, output ;
        private Container c ;
        private JLabel title ;
        private JButton check ;
        private int count ;
        private JPanel pan1, pan2, pan3 ;
        private String operators[] = {"++","--","!","~","<<",">>",">>>",">=","<=",
        "!=","==","instanceof","&&","||","^","?:","+=","-=","*=","/=","%="} ;
        private String operators1[] = {"+","-","*","/","%","!",">","<","&","|","="} ;
        private ArrayList alist ;
        public MyOperators()
             super("Check Operators");
          c = getContentPane();
             space = new JTextArea() ;
             space.setSize(200, 200) ;
             output = new JTextArea() ;
             output.setSize(200, 200) ;
             title = new JLabel() ;
             title.setText("Please Enter your text") ;
             check = new JButton("Check") ;
             check.addActionListener(this);
             check.setSize(70, 30) ;
             pan1 = new JPanel() ;
             pan1.add( title ) ;
             pan2 = new JPanel() ;
             pan2.setLayout( new GridLayout(3, 1) ) ;
             pan2.add( space ) ;
             pan2.add( output ) ;
             pan2.add( check ) ;
             c.add(pan1,BorderLayout.NORTH);
             c.add(pan2,BorderLayout.CENTER);
             setSize(300,300);
          setVisible(true);
          setDefaultCloseOperation(EXIT_ON_CLOSE);
        public static void main (String args[])
              MyOperators op = new MyOperators() ;
        public void actionPerformed(ActionEvent a)
            Object obj = a.getSource();
            alist = new ArrayList() ;
            String value[] ;
            count = 0;
            String display = "" ;
            int m = -1 ;
            int q = -1 ;
            StringBuffer wholetext = new StringBuffer(space.getText()) ;
            if( obj == check ){
                for(int i = 0; i < operators.length; i++){ 
                        m = wholetext.indexOf(operators) ;
    if( m < 0 & i < operators1.length ){
    q = wholetext.indexOf(operators[i]) ;
    if( m > 0 ){
    alist.add( wholetext.substring(m, m + (operators[i].length()) )) ;
    else if( q > 0 ){
    alist.add( wholetext.substring(q, q + (operators1[i].length()) )) ;
    for(int i = 0; i < alist.size(); i++){
    Iterator iter = alist.iterator() ;
    value = new String[alist.size()] ;
    value[i] = (String)iter.next() ;
    display += value[i] + "\n";
    output.setText(display);
    Can someone kindly highlight where is the mistake and how to correct it?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    corlettk wrote:
    q and m are used to capture the index of the sub-string(operators) in the string of text.Why the two sets of operators? ... and why those two (strange) groupings?
    Edited by: corlettk on 9/03/2008 10:20
    And oh yeah... my comment about MEANINFUL variable names still stands... you MUST learn to write readable code if you want to make a living at this. It ain't optional. Period.If u look at the array u would understand....there are 2 arrayz.....If I need to track a "+" sign operator in the String of text...Itz goin to accept ("++") increment operator string as 2 separate ("+" "+" )addition operator....Thatz y I separate them into 2 different arrayz
    Edited by: raggy on Mar 9, 2008 3:25 AM

  • MIDP and Bluetooth as Java Card substitute

    Hi,
    I'm a Java developer, but not a Java Card developer, so I'm curious about the opinions of Java Card developers. It seems to me that IR and Bluetooth enabled J2ME/MIDP devices could be used in many situations where Java Cards are currently used. Depending on the adoption rates of
    a) Bluetooth enabled computers, devices, access points, etc... and
    b) cell phones with both Bluetooth and J2ME
    It may soon (a year or two) become cheaper and/or more convenient to issue users without a J2ME Bluetooth phone, such a device, than to issue all users Java Cards.
    So, entrenched coders
    1) Is this migration sane?
    2) Is anybody doing it, now?
    3) How hard/trivial is porting the applications?
    Thanks,
    Curt

    I'm aware of the JSR, but what is the security element ?On Sun Tech Days I was told it should be a Java Card. ;-))
    The main advantage of a smartcard is that it provides a trustworthy and tamper-resistant environment.
    Please have a look at
    http://www.simalliance.org/portal_upload/SIMalliance_comm.PDF
    I quote from the SIM Alliance site:
    "Thanks to a defined standard, easy downloading and powerful operating systems displaying high quality graphics, J2ME phones are making their mark. This leads to the question with such success and a memory capacity up to 1000 times the (U)SIM, will this relegate the Smart Card to a second class citizen?
    While Smart Card cannot compete with a Java handset for the sexy aspects of applications such as graphics, the core attributes of a Smart Card offer a number of significant benefits to application delivery, execution and management. All of these features require privacy management, security, portability and one-to-one personalization.
    Wireless applications must be secure and robust. However, it is feared that operators' revenue streams and secure pipeline will be threatened by the free delivery of applications mimicking the loss-making Internet portal model.
    This is where the Smart Card, (UICC, (U)SIM, and equivalent), will play an essential role in providing security, building trust and protecting revenues for mobile businesses.
    The card will become an integral part of the architecture for distributed applications running at the same time on Server, Handset and Smart Card to leverage the respective benefits of each part of the infrastructure.
    By looking at the strong points of each of the Java standards, Java Card and J2ME are not competing technologies but instead can be used in tandem to create an "open" and "secure" infrastructure that operators and content providers need in order to increase their ARPU and diminish costs. At present this infrastructure does not exist but leading operators, handset manufacturers, content providers and (U)SIM suppliers are working to make it a reality."

  • Substrings in java

    import java.io.*;
    import java.util.*;
    class Sub{
    public static void main(String[] args){
    String org = "This is a test.  This is, too.";
    String search = "is";
    int i, j;
    do{
      i = org.indexOf(search);
      if(i != -1){
        String result = org.substring(i, i + search.length() );
        org = result;
        System.out.println("result" + result) ;
    }while(i != -1);
      }//main
    }//class Problem
    When I run the code above, I want it to search the string and return all occurrences of "is". When I run the loop it prints "is" alright, but goes into an infinite loop. Why? I suspect I need a stopping condition, but I can't figure.

    Why would you think i would ever be -1? Calling indexOf() returns the location of the first occurrence of the substring. So if it exists, every time you loop you'll find the word 'is' in the same spot.
    Try using the other indexOf() method
    [http://java.sun.com/javase/6/docs/api/java/lang/String.html#indexOf(java.lang.String,%20int)]
    Edited by: newark on Apr 21, 2008 12:58 PM

Maybe you are looking for

  • Error while creating contract type 0002

    Hiya While trying to create purchasing side contract, i am getting an error as below No sales prices possible at plant level for distribution chain S001/01 Message no. WV228 Diagnosis For distribution chain S001/01, in the distribution chain control

  • Front audio port not working please help..

    Hey guys, My HP Pavilion DV2275ea front audio jack does not work, I have tried many different headsets as the mic jack works just fine. I have tried reinstalling audio drivers (Conexant High-Definition Audio Chip) and still nothing. I have look at t

  • Offline backup using BRTools 7---- Backup_ device_ type disk

    Hi Markus & Gurus.when im trying to take offline abck up this is the error in facing . Can u help me in resolving htis. BR0051I BRBACKUP 7.00 (28) BR0055I Start of database backup: bdwmgkqt.afd 2007-10-30 14.16.03 BR0484I BRBACKUP log file: F:\oracle

  • Sync Photos from Apple TV to a Mac Pro - HELP

    Hello All, Let's say I lost my photos from iPhoto, but I synced them to my Apple TV. Can I tell the Apple TV to sync my photos back to iPhoto? I know you can sync music back from an iPod. Thank you.

  • Problems with type ... is table of - values

    Hello, please look at the following procedure: CREATE OR REPLACE PROCEDURE fct_s_snpdb_ersetzung_einzeln ( p_tnr IN VARCHAR2, p_ersetzung IN VARCHAR2 IS -- DECLARE VARIABLES p_ersetzung_rep VARCHAR2(4000); v_test_table NUMBER; TYPE nersetzungtab IS T