Using Tokenizer

I have one simple question about using the Tokenizer function. Can I use anything as the separator for the string or do I have to use \t (Tab)? All the examples I've seen use the Tab. I would like to use a pipe ( | ) instead since this character will never be used in my program.
Chris

Look at StrinkTokenizer's constructors. Two of them take a delimiter, which can be of your choosing.
StringTokenizer(string, "|")

Similar Messages

  • How do i use Tokenizer?

    Hi all,
    i'm in need to use Tokenizer in my coding to get rid of all the tags (eg. <html> etc...) that i have read from some HTML files.
    The thing goes like this... I have used a buffer reader to read some HTML files for their contents. However, the buffer reader will read all the information in the files including all the tags etc... Therefore i will need to use Tokenizer to get rid of all the tags before passing it into a Hashtable.
    I knew sth like this:
    StringTokenizer StrTok = new StringTokenizer(abc,"<>");
    the above line of coding, i'm not very sure with the expression to use. If i use <>, it will read the <html> and remove only the <> and will leave the "h t m l" behind....
    Is there any sample of using Tokenizers???
    Thanx

    Tokenizer wont get the job done here.
    When you use Tokenizer it divides or 'tokenizes' the string into different segments according to the pattern given in the second parameter.
    a more appropriate method would be to use substring function from the class String.
    where ever you find a pair of "<...>" this then just cut it out and join the rest of the string
    hope it helped

  • Getting error using tokenize in xsl

    We are on 12.1.3 and am getting the following error while using the tokenize function in the custom po xsl file.
    error obtained:
    <Line 3030, Column 51>: XML-22015: (Error) Function 'tokenize' not found.
    Code used::
      <xsl:variable name="tcline" select="unparsed-text('/generic_tc.txt','UTF-8')">
      <xsl:for-each select="tokenize($tcline,'\r\n')">
        <xsl:value-of select="replace($tcline,'s/\"<b>"(.*?)\"<b>"/<em>$1\/em/g;')"/>
      </xsl:for-each>
      </xsl:variable>
    Any idea, if tokenize is supported or not?
    NOTE: unparsed-text which is XSL 2.0 function works fine without issues
    Thanks,
    Maha

    I was on a call a short time ago with several people, all attempting to access cr.com.  Some had no issues (myself included), whereas others experienced security problems.    This probably explains the differences.
    As far as the problem with the publishing tool, I take it that the issue runs a little deeper, since I can't get it to publish, even though I am able to log in to cr.com successfully.
    Peter

  • Splitting attributes using tokenizer

    Hey Guys..am new to jsp...wuz tryin my hands on beans..
    This is a small program , uses beans to retrieve 3 attributes from two tables kept in a database schema using vectors..and then the vector is called into the jsp page where using stringtokenizer...i'v splitted the three attributes kept in the vector as a single string object separated by commas...
    Program is running fine..wuntd to kno..if u experts hav a better method for this..:-)
    JSP :
    <%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" errorPage="" %>
    <html>
    <head>
    <!-- TemplateBeginEditable name="doctitle" -->
    <title>Untitled Document</title>
    <!-- TemplateEndEditable -->
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <!-- TemplateBeginEditable name="head" -->
    <!-- TemplateEndEditable -->
    </head>
    <body>
    <!-- This program makes use of the bean named SelectDB present in the db package kept in -->
    <!-- Root/WEB-INF/classes/ directory-->
    <!-- The jsp page calls the bean , which inturn fetches the records from 2 tables and inserts them-->
    <!-- in the vector separated by commas(",") as a String type object. -->
    <%@ page import="java.util.*,db.SelectDB" %>
    <%! Vector vect; %><!-- Class level declaration of the bean..-->
    <jsp:useBean id="sdb" class="db.SelectDB" scope="request" />
    <%
         vect=sdb.getVs();//calling the bean method which returns the array of vector objects.
         for(int i=0;i<vect.size();i++)//vect.size() retrns the no of elementsin the vector array
              StringTokenizer st=new StringTokenizer((String)vect.elementAt(i),",");
              while(st.hasMoreTokens())//a boolean function
              out.print(st.nextToken());//prints and then moves the pointer
              out.print(" ");
    %>
              <br>     
         <%
         %>
    </body>
    </html>
    bean class:
    package db;
    import java.util.*;
    import java.sql.*;
    public class SelectDB
         private Vector vs;
         public SelectDB()
         try{
              ResultSet rs;
              Connection conn;
              Statement stmt;
              Class.forName("oracle.jdbc.driver.OracleDriver");
              conn=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:shekhar","project","shekhar");
              stmt=conn.createStatement();
              vs=new Vector();
              rs=stmt.executeQuery("select ename,ejob,dname from emp,dept where emp.dno=dept.deptno");
              while(rs.next())
                   String str=rs.getString(1)+","+rs.getString(2)+","+rs.getString(3);
                   vs.addElement(str);
              rs.close();
              conn.close();
         catch(Exception e)
              System.out.println(e);
    }//end of constructor...
    public Vector getVs()
              return vs;
    Am reading Beginning J2EE by Kevin Mukher and James L. Weaver(A Press).
    Mention, if derz a betr book..!
    Cheers,
    Shekhar

    juss found another method..without using stringtokenizer...using split() method....anyways...am always looking for better options..
    Shekhar

  • How to use a loop with tokenizer

    I am working on an assignment where I need to use a loop to read input from a text file that contains grades. I'll use tokenizer (somehow) to read each line from the grade.txt file and then I need to output each test score, and calculate the average. So far this is my code:
    import java.io.*;
    import java.util.StringTokenizer;
      public class TestGrader
         public static void main (String[] args) throws FileNotFoundException,
                                                                     IOException
         BufferedReader keyboard = new
         BufferedReader(new InputStreamReader(System.in));
         BufferedReader inFile = new
         BufferedReader (new FileReader("c:java/homework/Assignment3/grades.txt"));
    /*******************Declare variables******************/
         int numOfTest, lowestScore, higestScore, avgScore;
         StringTokenizer tokenizer;
         tokenizer = new StringTokenizer(inFile.readLine());
         System.out.println("Enter the number of test you would like to grade: ");
         numOfTest = Integer.parseInt(keyboard.readLine());
         System.out.println("Press enter to continue...");
         keyboard.readLine();
         // Retrieve the test scores from the file grades.txtI'm stuck at the point where I need to create the loop to read the grades from the grades.txt file. Any help with the loop and tokenizer to read any number of grades would be appreciated.

    well i hope i am not too late to answer this.
    do u have any control on how to write the grades.txt file. If yes then follow:
    write the grades in following format:
    subject : marks separator(say ;) subject : marks separator(say ;)...... marksEOF(some new symbol)
    then try to process it using the following code
    while(!file.EOF()){
    StringTokenizer nk=new StringTokenizer(file.readLine(),separator);
    while(nk.hasMoreTokens()){
    //write code to display as nicely as you want...below is raw printing only....
    System.out.println(nk.nextToken());

  • Error in XSLT mapping while using string functions

    Hi All,
    While using tokenize() and substring-before() functions in XSLT mapping,we are getting an error.The error message is Unexpected symbol "" So while using string functions in XSLT mapping do we have to use any header functions.
    Please through light on syntax etc.,of string functions in XSLT.
    Thanx in advance,
    Lokesh Dhulipudi
    Edited by: LOKESH DHULIPUDI on Dec 27, 2007 7:32 AM

    Hi,
    Hope you have gone thru this help:
    http://w3schools.com/xsl/default.asp
    Rgds, Moorthy

  • XSLT Enhancement with Java, Tokenize Functionality

    I tried the following requirement using EXSLT with no luck. Is there any other alternative to tokenize in XSLT 1.0.
    The syntax i have here is  
    <xsl:for-each select="tokenize($this/Field1,',')">
           <xsl:variable name="f1v" select="."/>
         <xsl:for-each select="tokenize($this/Field2,'\|')">
              <xsl:variable name="f2v" select="."/>
              <xsl:for-each select="tokenize($this/Field3,'\|')">
                        <xsl:variable name="f3v" select="."/>
    There are multiple for-each based on tokens
    I am leaning towards to Enhancing XSLT with Java Function. As i have less experience with Java, can anybody help me with the code that can be used by XSLT for Tokenize functionality.
    I have written something like following. I still have errors to fix. But i am not sure about having resultSet or return at the end, to make sure all the tokens were sent to XSLT.
    public class MyStringToken
         public static void main(String [] args)
              String str = "sssd;wwer;ssswwwwdwwwwwwwwwww;wwwwe";
              String delimiter = ";";
              MyStringToken my = new MyStringToken();
              my.getTokens(str,delimiter);
         public void getTokens(String str,String delimiter)
              StringTokenizer st = new StringTokenizer(str,delimiter);
              while(st.hasMoreElements())
                   try
                        String delString = new String(st.nextElement().toString());
                        return (delString);
                   catch(Exception e)
                        e.printStackTrace();
    Any help is appreciated

    Hi,
    I have been searching about, and I have found the next example that maybe can help you, It's a template to tokenize in XSLT 1.0 from the web [http://stackoverflow.com/questions/1018974/tokenizing-and-sorting-with-xslt-1-0]
    <xsl:template name="tokenize">
      <xsl:param name="string" />
      <xsl:param name="delimiter" select="' '" />
      <xsl:choose>
        <xsl:when test="$delimiter and contains($string, $delimiter)">
          <token>
            <xsl:value-of select="substring-before($string, $delimiter)" />
          </token>
          <xsl:text> </xsl:text>
          <xsl:call-template name="tokenize">
            <xsl:with-param name="string"
                            select="substring-after($string, $delimiter)" />
            <xsl:with-param name="delimiter" select="$delimiter" />
          </xsl:call-template>
        </xsl:when>
        <xsl:otherwise>
          <token><xsl:value-of select="$string" /></token>
          <xsl:text> </xsl:text>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:template>
    Also I have found the next example of use tokenize in EXSLT from [http://exslt.org/str/functions/tokenize/index.html] It can be that inI your tests you are not using "str:tokenize", no?
    <xsl:template match="a">
       <xsl:apply-templates />
    </xsl:template>
    <xsl:template match="*">
       <xsl:value-of select="." />
          <xsl:value-of select="str:tokenize(string(.), ' ')" />
       <xsl:value-of select="str:tokenize(string(.), '')" />
       <xsl:for-each select="str:tokenize(string(.), ' ')">
          <xsl:value-of select="." />
       </xsl:for-each>
       <xsl:apply-templates select="*" />
    </xsl:template>
    I hope that helps you.
    Best.
    Jorge

  • How to use deploy tool in AIA

    Hi ,
    I am using Tokenizer tool. I have followed the following link
    http://blogs.oracle.com/learnwithpavan/2009/09/deploy_using_the_deploy_tool_u.html.
    I am using ANT 1.7.0 comes with AIA installation.
    export AIA_HOME=/opt/webapps/oracle/product/AIA
    export ORACLE_HOME=/opt/webapps/oracle/product/SOAAS_10.1.3
    export PATH=/opt/webapps/oracle/product/AIA/apache-ant-1.7.0/bin
    export JAVA_HOME=/opt/webapps/JDK/jdk1.5.0_20/jre
    ant runesb -DTokenizerPropsFilePath=/opt/webapps/oracle/product/AIA/util/DeployTool/Tokenizer.properties
    following error i am getting
    /opt/webapps/oracle/product/AIA/apache-ant-1.7.0/bin/ant: false: not found
    /opt/webapps/oracle/product/AIA/apache-ant-1.7.0/bin/ant: false: not found
    /opt/webapps/oracle/product/AIA/apache-ant-1.7.0/bin/ant: uname: not found
    /opt/webapps/oracle/product/AIA/apache-ant-1.7.0/bin/ant: basename: not found
    /opt/webapps/oracle/product/AIA/apache-ant-1.7.0/bin/ant: dirname: not found
    /opt/webapps/oracle/product/AIA/apache-ant-1.7.0/bin/ant: false: not found
    /opt/webapps/oracle/product/AIA/apache-ant-1.7.0/bin/ant: false: not found
    /opt/webapps/oracle/product/AIA/apache-ant-1.7.0/bin/ant: false: not found
    /opt/webapps/oracle/product/AIA/apache-ant-1.7.0/bin/ant: false: not found
    /opt/webapps/oracle/product/AIA/apache-ant-1.7.0/bin/ant: false: not found
    /opt/webapps/oracle/product/AIA/apache-ant-1.7.0/bin/ant: false: not found
    /opt/webapps/oracle/product/AIA/apache-ant-1.7.0/bin/ant: false: not found
    /opt/webapps/oracle/product/AIA/apache-ant-1.7.0/bin/ant: false: not found
    Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/tools/ant/launch/Launcher
    Please update if anyone has faced same issue

    Please check the ant home properly.
    do echo on ant_home. If this is not helping you.
    Please follow the steps below.
    Steps to deploy AIA Components:
    1. Navigate to the following location in the server.
         D:\product\10.1.3.1\AIA\util\DeployTool>
    2. Set env variable to AIA_HOME, ORACLE_HOME and ANT_HOME folder
         set AIA_HOME=D:\product\10.1.3.1\AIA\
         set ORACLE_HOME=D:\product\10.1.3.1\OracleAS_1\
    3. Make sure your process folder and it's artifacts are NOT read-only
    4. Copy the bpel projects and Esb project to the following locations.
         D:\product\10.1.3.1\AIA\util\DeployTool\BpelCopy
         D:\product\10.1.3.1\AIA\util\DeployTool\EsbCopy
    5. open and edit \Tokenizer\build.properties in a text editor and populate the below values
    aia.home= Path of the folder which contains BPEL and ESB processes that has to be tokenized.
    Make sure that above Path contains Forward slash.(/)
    If you are planning to deploy only one of the BPEL or ESB processes then leave the other path as blank.     
    DONT NOT MODIFY ANY OTHER PARAMETERS IN THIS FILE.
    aia.home=D:/product/10.1.3.1/AIA/util/DeployTool/BpelCopy/
    6. Go to command prompt and change the current directory to \Tokenizer
    7. For BPEL processes execute the command ">ant runbpel" and for ESB processes execute the command ">ant runesb"
         $ ant runesb -DTokenizerPropsFilePath=D:/product/AIA_HOME/util/DeployTool/Tokenizer.properties
         $ ant runbpel -DTokenizerPropsFilePath=D:/product/AIA_HOME/util/DeployTool/Tokenizer.properties
         Note: you can run with the AIA_HOME in the command doesn't matter.
    8. Goto $AIA_HOME/bin and source the AIA environment file - aiaenv.sh.
         This will source all the environment variables.
    9. Then run "ant" to deploy the process from the bpel project folder as below.
         D:\product\10.1.3.1\AIA\bin>aiaenv.bat
    10. D:\product\10.1.3.1\AIA\util\DeployTool\BpelCopy\XXX_CustomerSyncUEKProvAdapterServiceBPEL_V1>ant     
         Note: If you want to deploy to the different domain. Please change the domain name in the build.properties for the bpel process.
    Thanks,
    Vijay.B

  • Need help parsing and large file reading-urgent please

    import java.io.*;
    import java.lang.String.*;
    import java.util.*;
    public class ReadFile {
    //--------------------------------------------------< main >--------//
    public static void main (String[] args) {
    ReadFile t = new ReadFile();
    t.readMyFile();
    //--------------------------------------------< readMyFile >--------//
    void readMyFile() {
    String line = null;
    String dcn = null;
    String pfn = null;
    String pln = null;
    String pdob = null;
    String ssd = null;
    try {
    FileReader fr = new FileReader("C:\\ClaimsData\\ClaimsExtract.txt");
    BufferedReader br = new BufferedReader(fr);
    line = new String();
    while ((line = br.readLine()) != null) {
    //A00002314376A5272201102300000000MASARU OKUDA 1933012520050722B101 20051001
    //Each line of ClaimsExtract.txt is exactly in above form
    // and there are about 1000 such lines
    dcn = new String();
    pfn = new String();
    pln = new String();
    pdob = new String();
    ssd = new String();
    dcn = line.substring(13,24);
    pfn = line.substring(32,42);
    pln = line.substring(42,57);
    pdob = line.substring(57,65);
    ssd = line.substring(65,73);
    //System.out.println(dcn+" "+pfn+" "+pln+" "+pdob+" "+ssd);
    fr.close();
    } catch (IOException e) {
    // catch possible io errors from readLine()
    System.out.println("Uh oh, got an IOException error!");
    e.printStackTrace();
    } // end of readMyFile()
    } // end of class
    java.io.IOException: Stream closed
         at sun.nio.cs.StreamDecoder.ensureOpen(StreamDecoder.java:37)
         at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:152)
         at java.io.InputStreamReader.read(InputStreamReader.java:167)
         at java.io.BufferedReader.fill(BufferedReader.java:136)
         at java.io.BufferedReader.readLine(BufferedReader.java:299)
         at java.io.BufferedReader.readLine(BufferedReader.java:362)
         at ReadFile.readMyFile(ReadFile.java:32)
         at ReadFile.main(ReadFile.java:14)
    Uh oh, got an IOException error!
    I also tried using Tokenizer but some other errors, Please suggest a better approach
    urgent , Thanks in Advance

    i think your while loop has the problem. It's keep continuing to read the next line in the file and doesn't exit even when it reaches the end of file. Therefore it gives you that error. Since you're using variable line as string object hence for the while loop you should've something like this and i would also move the reading next line part just before ending the while loopwhile ( ! line.equals(null) ) {
           line = br.readLine();
    }//end of while because string object doesn't work for comparing operators == or != so you always have to use string.equlas()
    I'm sure that's the reason you're encountering this error, otherwise please specify the line where you're encountring the problem. Next time please use the tags for your code becuase it formats the code nicely and it's easy to read it. Cheers
    Message was edited by:
            salubadsha                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How to read the contents of a text file and populate the data in a table ?

    Hello All,
      Can anyone advise on how to acheieve the above ? I am trying to read in a text file (CSV) and have the contents populated to the respective UI elements in a table. Any help is greatly appreciated.
    from
    Kwok Wei

    Hi,
    Let us consider you have list of names(Seperated by delimeter) in a text file and you want to display in  a table.
    1. Create Context Node "Names" and context attribute "Name"
    2. Create Table and bind to the above context.
    3.Write the following code in the "Init method.
    try{
    FileReader f =new FileReader("");
    BufferedReader r=new BufferedReader(f);
    String names=r.readLine();
    Vector Names=new Vector();
    // Use Tokenizer and store all the names i a vector//
    for(int i=0;i<Names.size();i++){
    IPrivate<<VieName>>.INameElement ele=wdContext.createNameElement();
    ele.set<<Name>>( Names.get(i).toString());
    wdContext.NodeName().addElement(ele);
    Regards, Anilkumar
    Message was edited by: Anilkumar Vippagunta

  • Displaying Japanese characters in JSP page

    Hi,
    I am calling an application which returns Japanese characters from my JSP. I am getting the captions in Japanese characters from the application and I am able to display the Japanese captions. After displaying the Japanese captions, user will select the particular captions by selecting the check box against the caption and Press Save button. Then I am storing the captions in the javascript string separated by :: and passing it to another JSP.
    The acton JSP retrieves that string and split it by using tokenizer and store it in the database. When I retrieve it again from the database and display it, I am not able to see the Japanese characters, it is showing some other characters, may be characters encoded by ISO.
    My database is UTF-8 enabled and in my server I am setting the UTF-8 as default encoding. In my JSP pages also, I am setting the charset and encoding type as UTF-8.
    I shall appreciate you if you can help me in resolving the issue.

    Post the encoding-related statements from your JSPs - there are a number of different ones that may be relevant.
    It may also be relevant which database you store the strings in (Oracle, DB2, etc.), since some require an encoding parameter to be passed.

  • Extracting from an xml file..

    hi.. i am required to write a program that extracts and perform certain calulations with stock numbers. I have been able to complete the calcuations part but need a little help(ideas, guildines) when xtracting stuff from a xml file that has six lines..
    <?xml version="1.0"?>
    <Portfolio>
    <Investment><Stock symbol="RY"></Stock><Qty>15</Qty><Comment>this is a good one; esp. the BookValue</Comment><BookValue>58.5</BookValue></Investment>
    <Investment><Comment>this is not "bad"</Comment><Stock symbol = "NT"></Stock><Qty>10</Qty> <BookValue>108</BookValue></Investment>
    <Investment><Qty>2</Qty><BookValue>45.75</BookValue><Comment>not sure about this; >= last time</Comment><Stock symbol= "BMO" > </Stock></Investment>
    </Portfolio>
    I'm not sure if this post will display properly but the correct format is this..
    Line 1: <?xml version=...
    Line 2: <Portfolio...
    Line 3: <Investment...
    Line 4: <investment...
    Line 5: <investment...
    Line 6: </Portfolio.....
    The stuff i'm supposed to extract are..
    RY 15 58.50
    NT 10 108.00
    BMO 2 45.75
    I am new to java and i am still beginning to realize the many methods that enable me to do this.. if anyone has any ideas please let me know.. thank you for ur time.
    (I'm not requesting actual coding..) Thanks again.

    Hey kk.. thanks for helping out but unfortunatly.. i can't use a parser like u.. since i'm taking an introductory course we're only limited to a number of classes to use(we're not suppoesd to know much we have to work with what we have). This is the coding i have so far..
    public class Test
    {     public static void main(String[] args)
         {     YorkReader reader = new YorkReader("pfxml.a1.xml");
              String line = reader.readLine();
              String tag = line.substring(0,7);
              String investTag = "<Invest";
              while (!tag.equalsIgnoreCase(investTag))
                   York.println(line);
                   line = reader.readLine();
                   tag = line.substring(0,7);
              while(tag.equalsIgnoreCase(investTag))
                   York.println(line);
                   line = reader.readLine();
                   StringTokenizer st = new StringTokenizer(line, "Stock");
                   String line1 = st.nextToken();
                   StringTokenizer stSymbol = new StringTokenizer(st.nextToken(), "\"");
                   String symbolS = stSymbol.nextToken();
                   York.println();
                   York.println(line1);
                   York.println();
                   tag = line.substring(0,7);
              reader.close();
    I've managed to get the program to skip lines that don't match the string "Invest" and once i get to invest i'm planning to use loop and extract the stuff i need out of the line.. but for some reason(IT'S DRIVING ME CRAZY).. is that when i try to use the Tokenizer class to parse out what i need.. it doesn't work. U see.. in the code i used the string "Stock" as the delimiter.. but when i check to see if the code is working it's not returning what i'm asking for.
    When i ask it to print out the first token it returns this..
    <Inves
    and when i ask for the second it gives me..
    men
    what is going on... argh.. i thought i had a great idea to do this too.. like wat i was planning was.. use "Stock" as the delimiter and get the string
    symbol="RY"></
    then use tokenizer again and use " as the delimiter to get the RY string which is what i want.. but for some reason it's not doing that.. if u have time could u take a look at my coding and let me know what's wrong?.. thanks a lot for ur help.. i really appreciate it.

  • Assigning Tasks and Sending Notifications to Users Dynamically

    BPM Experts,
    We have a BPM process which gets triggered from a JWD application. The issue which we are having is as follows
    1.Dynamic allocation of Single user to a task is not working. The  approach we have taken is WD application will send User Unique Id from context and it will be mapped to getPrincipal exression.
    2.Assign to task to multiple users, first in complex type we are not able to set the  cardinality 0..n , it accepting 0..1 or 1..1...To handle this we have appended each of IUsedId sent as string in WD with special characters and tried using tokenize function and then getPrincipals even that also not working
    Any quick response and pointers will be highly appreciated
    FYI... we cannot use Portal UME groups in this scenario
    Best regards,
    Prasad

    Hi Julian,
    Thanks for the reply, I am getting below warning when trying to deploy the EAR which has got EJB as used DC. The same error is coming when I am trying use the same in BPM after deployment at runtime -
    com.sap.engine.services.ejb3.runtime.impl.refmatcher.EJBResolvingException: Cannot start application xxxxx.com/devc~eardynamicusers; nested exception is: java.rmi.RemoteException: ASJ.dpl_ds.006125 Error occurred while starting application locally and wait.; nested exception is:
    *     com.sap.engine.services.deploy.exceptions.ServerDeploymentException: Application [xxxxx.com/devc~eardynamicusers] cannot be started. Reason: it has hard reference to resource [devc~ejbdynamicusers] with type [application], which is not active on the server.*
    Hint: 1) Is referred resource deployed? 2) Is referred resource able to start?     at com.sap.engine.services.ejb3.runtime.impl.DefaultContainerRepository.startApp(DefaultContainerRepository.java:351)
         at com.sap.engine.services.ejb3.runtime.impl.refmatcher.result.SingleResultImpl.add(SingleResultImpl.java:17)
         at com.sap.engine.services.ejb3.runtime.impl.refmatcher.BeanMatcher.matchLocalInterfaces(BeanMatcher.java:208)
         at com.sap.engine.services.ejb3.runtime.impl.refmatcher.BeanMatcher.matchInterfaces(BeanMatcher.java:83)
         at com.sap.engine.services.ejb3.runtime.impl.refmatcher.BeanMatcher.matchReferenceToBean(BeanMatcher.java:46)
         at com.sap.engine.services.ejb3.runtime.impl.DefaultContainerRepository.matchBean(DefaultContainerRepository.java:390)
         at com.sap.engine.services.ejb3.runtime.impl.DefaultContainerRepository.matchApps(DefaultContainerRepository.java:367)
         at com.sap.engine.services.ejb3.runtime.impl.DefaultContainerRepository.getEnterpriseBeansContainers(DefaultContainerRepository.java:95)
         at com.sap.engine.services.ejb3.runtime.impl.DefaultRemoteObjectFactory.resolveReference(DefaultRemoteObjectFactory.java:73)
         at com.sap.engine.services.ejb3.runtime.impl.EJBObjectFactory.getObjectInstance(EJBObjectFactory.java:145)
         at com.sap.engine.services.ejb3.runtime.impl.EJBObjectFactory.getObjectInstance(EJBObjectFactory.java:64)
         at com.sap.engine.system.naming.provider.ObjectFactoryBuilderImpl._getObjectInstance(ObjectFactoryBuilderImpl.java:77)
         at com.sap.engine.system.naming.provider.ObjectFactoryBuilderImpl.access$100(ObjectFactoryBuilderImpl.java:33)
         at com.sap.engine.system.naming.provider.ObjectFactoryBuilderImpl$DispatchObjectFactory.getObjectInstance(ObjectFactoryBuilderImpl.java:228)
         at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:283)
         at com.sap.engine.services.jndi.implclient.ClientContext.lookup(ClientContext.java:450)
         at com.sap.engine.services.jndi.implclient.OffsetClientContext.lookup(OffsetClientContext.java:224)
         at com.sap.engine.services.jndi.implclient.OffsetClientContext.lookup(OffsetClientContext.java:243)
         at javax.naming.InitialContext.lookup(InitialContext.java:392)
         at javax.naming.InitialContext.lookup(InitialContext.java:392)
         at com.sap.glx.mapping.execution.implementation.function.BeanFunctionProvider.createBeanFunction(BeanFunctionProvider.java:24)
         at com.sap.glx.mapping.execution.implementation.Compiler$NativeBeanFunction.invokeNative(Compiler.java:362)
         at com.sap.glx.mapping.execution.implementation.rule.invocation.StandardInvocation.step(StandardInvocation.java:133)
         at com.sap.glx.mapping.execution.implementation.rule.expression.DeepExpression$Resolver.resolve(DeepExpression.java:45)
         at com.sap.glx.mapping.execution.implementation.rule.expression.DeepExpression$Resolver.<init>(DeepExpression.java:27)
         at com.sap.glx.mapping.execution.implementation.rule.expression.DeepExpression.internalExpress(DeepExpression.java:77)
         at com.sap.glx.mapping.execution.implementation.rule.expression.AbstractExpression.express(AbstractExpression.java:50)
         at com.sap.glx.mapping.execution.implementation.rule.part.AbstractPart.processSourceExpression(AbstractPart.java:117)
         at com.sap.glx.mapping.execution.implementation.rule.part.TerminalPart.internalPartake(TerminalPart.java:23)
         at com.sap.glx.mapping.execution.implementation.rule.part.AbstractPart.partake(AbstractPart.java:87)
         at com.sap.glx.mapping.execution.implementation.rule.mapping.NarrowMapping.internalMap(NarrowMapping.java:42)
         at com.sap.glx.mapping.execution.implementation.rule.mapping.AbstractMapping.map(AbstractMapping.java:49)
         at com.sap.glx.mapping.execution.implementation.rule.invocation.StandardInvocation$ImplementedInput.receive(StandardInvocation.java:77)
         at com.sap.glx.mapping.execution.implementation.invoker.MediatedSdoInvoker$Mediator.createInputDataObject(MediatedSdoInvoker.java:110)
         at com.sap.glx.mapping.execution.implementation.invoker.MediatedSdoInvoker.invokeNative(MediatedSdoInvoker.java:155)
         at com.sap.glx.mapping.execution.implementation.Compiler$NativeBeanFunction.invokeNative(Compiler.java:364)
         at com.sap.glx.mapping.execution.implementation.rule.invocation.StandardInvocation.step(StandardInvocation.java:133)
         at com.sap.glx.mapping.execution.implementation.rule.expression.DeepExpression$Resolver.resolve(DeepExpression.java:45)
         at com.sap.glx.mapping.execution.implementation.rule.expression.DeepExpression$Resolver.<init>(DeepExpression.java:27)
         at com.sap.glx.mapping.execution.implementation.rule.expression.DeepExpression.internalExpress(DeepExpression.java:77)
         at com.sap.glx.mapping.execution.implementation.rule.expression.AbstractExpression.express(AbstractExpression.java:50)
         at com.sap.glx.mapping.execution.implementation.rule.part.AbstractPart.processSourceExpression(AbstractPart.java:117)
         at com.sap.glx.mapping.execution.implementation.rule.part.BroadPart.internalPartake(BroadPart.java:38)
         at com.sap.glx.mapping.execution.implementation.rule.part.AbstractPart.partake(AbstractPart.java:87)
         at com.sap.glx.mapping.execution.implementation.rule.part.BroadPart.internalPartake(BroadPart.java:46)
         at com.sap.glx.mapping.execution.implementation.rule.part.AbstractPart.partake(AbstractPart.java:87)
         at com.sap.glx.mapping.execution.implementation.rule.mapping.NarrowMapping.internalMap(NarrowMapping.java:42)
         at com.sap.glx.mapping.execution.implementation.rule.mapping.AbstractMapping.map(AbstractMapping.java:49)
         at com.sap.glx.mapping.execution.implementation.Runner.transform(Runner.java:61)
         at com.sap.glx.mapping.execution.implementation.Runner.transform(Runner.java:41)
         at com.sap.glx.core.internaladapter.Transformer$TransformerTemplateAccessor$MapperTemplate$ImplementedInvocationHandler.map(Transformer.java:3016)
         at com.sap.glx.core.internaladapter.Transformer$TransformerTemplateAccessor$MapperTemplate$ImplementedInvocationHandler.invoke(Transformer.java:2997)
         at com.sap.glx.core.internaladapter.Transformer$TransformerInvocationHandler.invoke(Transformer.java:3284)
         at com.sap.glx.core.dock.impl.DockObjectImpl.invokeMethod(DockObjectImpl.java:530)
         at com.sap.glx.core.kernel.trigger.config.Script$MethodInvocation.execute(Script.java:245)
         at com.sap.glx.core.kernel.trigger.config.Script.execute(Script.java:791)
         at com.sap.glx.core.kernel.execution.transition.ScriptTransition.execute(ScriptTransition.java:63)
         at com.sap.glx.core.kernel.execution.transition.Transition.commence(Transition.java:138)
         at com.sap.glx.core.kernel.mmtx.DirectNestedTransaction.inPrepare(DirectNestedTransaction.java:67)
         at com.sap.glx.core.kernel.mmtx.AbstractTransaction.do_prepare(AbstractTransaction.java:198)
         at com.sap.glx.core.kernel.mmtx.AbstractTransaction.commit(AbstractTransaction.java:81)
         at com.sap.glx.core.kernel.mmtx.DirectNestedTransaction.inPrepare(DirectNestedTransaction.java:68)
         at com.sap.glx.core.kernel.mmtx.AbstractTransaction.do_prepare(AbstractTransaction.java:198)
         at com.sap.glx.core.kernel.mmtx.AbstractTransaction.commit(AbstractTransaction.java:81)
         at com.sap.glx.core.kernel.mmtx.PrimaryTransaction.inPrepare(PrimaryTransaction.java:125)
         at com.sap.glx.core.kernel.mmtx.AbstractTransaction.do_prepare(AbstractTransaction.java:198)
         at com.sap.glx.core.kernel.mmtx.AbstractTransaction.commit(AbstractTransaction.java:81)
         at com.sap.glx.core.kernel.execution.LeaderWorkerPool$Follower.run(LeaderWorkerPool.java:129)
         at com.sap.glx.core.resource.impl.common.WorkWrapper.run(WorkWrapper.java:58)
         at com.sap.glx.core.resource.impl.j2ee.ServiceUserManager$ServiceUserImpersonator$1.run(ServiceUserManager.java:124)
         at java.security.AccessController.doPrivileged(Native Method)
         at javax.security.auth.Subject.doAs(Subject.java:337)
         at com.sap.glx.core.resource.impl.j2ee.ServiceUserManager$ServiceUserImpersonator.run(ServiceUserManager.java:121)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:182)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:299)
    at: NamingException: Exception during lookup operation of object with name xxxxx.com/devc~eardynamicusers/LOCAL/DynamicUsersBean/bean.DynamicUsersBeanLocal, cannot resolve object reference.
    Edited by: Hemanth Racharla on Jun 19, 2011 6:18 PM

  • How do I deal with Tokenized strings that are blank?

    I'm writing a little application that writes data to a file. It sends data to the file as a "|" delineated string. Then I use tokenizer to break up the string as follows:
    try {
                                  String searchtext = SearchTxt.getText();
                                  String tokenString = "";
                                  String[] returnData = new String[8];
                                  File filedata = new File("bigbase.txt");
                                  BufferedReader in = new BufferedReader(
                                  new FileReader(filedata));
                                  String line = in.readLine();
                                  while ( line != null) {
                                  Pattern pat = Pattern.compile(searchtext);
                                  Matcher mat = pat.matcher(line);
                                       if ( mat.find() ) {
                                       StringTokenizer t = new StringTokenizer(line, "|");
                                       maintextArea.setText("");
                                       int count = 0;
                                            while (t.hasMoreTokens()) {
                                                 tokenString = t.nextToken();
                                                 returnData[count] = tokenString;
                                                 maintextArea.append(tokenString + " ");
                                                 System.out.println(tokenString);
    etc etc etc
    The problem is that when the tokens are blank, I get an endless loop when I try to print out the data on that last line. How do I deal with Tokens that are blank so they don't endlessly loop my output?
    Thanks
    MrThis

    Most people would probably tell you to use:
    String.split(...);
    But I'm not most people and I wrote this class before regex support was added to the String class which is based on StringTokenizer but supports empty tokens:
    http://www.discoverteenergy.com/files/SimpleTokenizer.java

  • Transformation in osb

    Hi,
    I have a senario where i need to transform element in request packet.
    EG. In the request packet I have a element <FullName>sam.sung</FullName>
    In the response i need to change it to
    <FirstName>sam</FirstName>
    <LastName>sung</LastName>
    How to go about it...any idea. we are using a wsdl to hit the required webservice.

    You can do it in various ways using XQuery.
    For ex. one way to do the same would be using tokenize function like suggested above.
    <MyResponse>
              for $token at $index in fn:tokenize($body//FullName, '\.')
                    return
              if ($index = 1)
              then
                   <FirstName>{$token}</FirstName>
              else
                   <LastName>{$token}</LastName>
    </MyResponse>Or you can also implement it using substring functions:
    <MyResponse>
         <FirstName>{fn:substring-before($body//FullName, '.')}</FirstName>
         <lastName>{fn:substring-after($body//FullName, '.')}</LastName>
    </MyResponse>

Maybe you are looking for