Problem using java String.split() method

Hi all, I have a problem regarding the usage of java regular expressions. I want to use the String.split() method to tokenize a string of text. Now the problem is that the delimiter which is to be used is determined only at runtime and it can itself be a string, and may contain the characters like *, ?, + etc. which are treated as regular expression constructs.
Is there a way to tell the regular expression that it should not treat certain characters as quantifiers but the whole string should be treated as a delimiter? I know one solution is to use the StringTokenizer class but it's a legacy class & its use is not recommended in Javadocs. So, does there exist a way to get the above functionality using regular expressions.
Please do respond if anyone has any idea. Thanx
Hamid

public class StringSplit {
public static void main(String args[]) throws Exception{
new StringSplit().doit();
public void doit() {
String s3 = "Dear <TitleNo> ABC Letter Details";
String[] temp = s3.split("<>");
dump(temp);
public void dump(String []s) {
System.out.println("------------");
for (int i = 0 ; i < s.length ; i++) {
System.out.println(s);
System.out.println("------------");
Want to extract only string between <>
for example to extract <TitleNo> only.
any suggestions please ?

Similar Messages

  • Problem using Java Mail API with WLS 7.0

    Hi All,
    I am trying to use the Java Mail API provided by WLS 7.0. I have made the
    settings metioned in the WLS 7.0 docs. However when I try to run the program I
    am getting the following error:
    javax.naming.NoInitialContextException: Need to specify class name in environment
    or system property, or as an applet parameter, or in an application resource file:
    java.naming.factory.initial
    at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:6
    46)
    at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:246
    at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.jav
    a:283)
    at javax.naming.InitialContext.lookup(InitialContext.java:350)
    The code that I have written is as follows
    import java.util.*;
    import javax.activation.*;
    import javax.mail.*;
    import javax.mail.internet.*;
    import javax.naming.*;
    import java.io.*;
    import java.net.InetAddress;
    import java.util.Properties;
    import java.util.Date;
    public class MailTo {
         public static void main(String args[])
              try
                   //Context ic = getInitialContext();
                   InitialContext ic = new InitialContext();
    /* My jndi name is "testSession" */
                   Session session = (Session) ic.lookup("testSession"); /* THE PROBLEM IS SHOWN
    IN THIS LINE */
                   Properties props = new Properties();
                   props.put("mail.transport.protocol", "smtp");
                   props.put("mail.smtp.host", "XX.XX.XX.XX");
    /* For security reasons I have written the ip add in this format */
                   props.put("mail.from", "[email protected]"); /* for security reasons i have
    changed the mail address */
                   Session session2 = session.getInstance(props);
                   Message msg = new MimeMessage(session2);
                   msg.setFrom();
                   msg.setRecipients(Message.RecipientType.TO, InternetAddress.parse("[email protected]",
    false));
                   msg.setSubject("Test Message");
                   msg.setSentDate(new Date());
                   MimeBodyPart mbp = new MimeBodyPart();
                   mbp.setText("This is a mail sent to you using JAVA Mail API and Weblogic Server");
                   Multipart mp = new MimeMultipart();
                   mp.addBodyPart(mbp);
                   msg.setContent(mp);
                   Transport.send(msg);
              catch(Exception e)
                   e.printStackTrace();
         }//end of main
    public static Context getInitialContext()
         throws NamingException
              Properties p = new Properties();
              p.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
              p.put(Context.PROVIDER_URL, "t3://localhost:7501/testWebApp");
                   p.put(Context.SECURITY_PRINCIPAL, "weblogic");
                   p.put(Context.SECURITY_CREDENTIALS, "weblogic");
              return new InitialContext(p);
    }//end of class
    Can anyone please tell me what is the problem. I thought that we cannot directly
    do
    InitialContext ic = new InitialContext();
    So I had written a method getInitialContext() as shown in the above piece of code,
    but that too did not work.
    Eagerly awaiting a response.
    Jimmy Shah

    You can use InitialContext ic = new InitialContext() only if you are using a startup class, servlet or a JSP i.e
    server side code.
    If you are using a java client you need to use Context ic = getInitialContext();
    Try this code
    import java.util.*;
    import javax.activation.*;
    import javax.mail.*;
    import javax.mail.internet.*;
    import javax.naming.*;
    import java.io.*;
    import java.net.InetAddress;
    import java.util.Properties;
    import java.util.Date;
    public class MailTo {
    public static void main(String args[])
    try {
    Properties h = new Properties();
    h.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
    h.put(Context.PROVIDER_URL, "t3://localhost:7001");
    Context ic = new InitialContext(h);
    Session session = (Session) ic.lookup("testSession");
    Properties props = new Properties();
    props.put("mail.transport.protocol", "smtp");
    props.put("mail.smtp.host", "XX.XX.XX.XX");
    props.put("mail.from", "[email protected]");
    Session session2 = session.getInstance(props);
    Message msg = new MimeMessage(session2);
    msg.setFrom();
    msg.setRecipients(Message.RecipientType.TO,InternetAddress.parse("[email protected]",false));
    msg.setSubject("Test Message");
    msg.setSentDate(new Date());
    MimeBodyPart mbp = new MimeBodyPart();
    mbp.setText("This is a mail sent to you using JAVA Mail API and Weblogic Server");
    Multipart mp = new MimeMultipart();
    mp.addBodyPart(mbp);
    msg.setContent(mp);
    Transport.send(msg);
    catch(Exception e)
    e.printStackTrace();
    }//end of main
    }//end of class
    We have shipped a javamail example in the samples\server\src\examples\javamail folder.
    Jimmy Shah wrote:
    Hi All,
    I am trying to use the Java Mail API provided by WLS 7.0. I have made the
    settings metioned in the WLS 7.0 docs. However when I try to run the program I
    am getting the following error:
    javax.naming.NoInitialContextException: Need to specify class name in environment
    or system property, or as an applet parameter, or in an application resource file:
    java.naming.factory.initial
    at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:6
    46)
    at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:246
    at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.jav
    a:283)
    at javax.naming.InitialContext.lookup(InitialContext.java:350)
    The code that I have written is as follows
    import java.util.*;
    import javax.activation.*;
    import javax.mail.*;
    import javax.mail.internet.*;
    import javax.naming.*;
    import java.io.*;
    import java.net.InetAddress;
    import java.util.Properties;
    import java.util.Date;
    public class MailTo {
    public static void main(String args[])
    try
    //Context ic = getInitialContext();
    InitialContext ic = new InitialContext();
    /* My jndi name is "testSession" */
    Session session = (Session) ic.lookup("testSession"); /* THE PROBLEM IS SHOWN
    IN THIS LINE */
    Properties props = new Properties();
    props.put("mail.transport.protocol", "smtp");
    props.put("mail.smtp.host", "XX.XX.XX.XX");
    /* For security reasons I have written the ip add in this format */
    props.put("mail.from", "[email protected]"); /* for security reasons i have
    changed the mail address */
    Session session2 = session.getInstance(props);
    Message msg = new MimeMessage(session2);
    msg.setFrom();
    msg.setRecipients(Message.RecipientType.TO, InternetAddress.parse("[email protected]",
    false));
    msg.setSubject("Test Message");
    msg.setSentDate(new Date());
    MimeBodyPart mbp = new MimeBodyPart();
    mbp.setText("This is a mail sent to you using JAVA Mail API and Weblogic Server");
    Multipart mp = new MimeMultipart();
    mp.addBodyPart(mbp);
    msg.setContent(mp);
    Transport.send(msg);
    catch(Exception e)
    e.printStackTrace();
    }//end of main
    public static Context getInitialContext()
    throws NamingException
    Properties p = new Properties();
    p.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
    p.put(Context.PROVIDER_URL, "t3://localhost:7501/testWebApp");
    p.put(Context.SECURITY_PRINCIPAL, "weblogic");
    p.put(Context.SECURITY_CREDENTIALS, "weblogic");
    return new InitialContext(p);
    }//end of class
    Can anyone please tell me what is the problem. I thought that we cannot directly
    do
    InitialContext ic = new InitialContext();
    So I had written a method getInitialContext() as shown in the above piece of code,
    but that too did not work.
    Eagerly awaiting a response.
    Jimmy Shah--
    Rajesh Mirchandani
    Developer Relations Engineer
    BEA Support

  • Problems using java.xml.xpath - How to get values from DTMNodeList?

    Sorry for the waffle in the subject title, but I was unsure what to call it. I hope this thread is in the correct forum.
    I'm having problems using xpath to parse some data from an XML file. I am able to create an expression which obtains the elements I wish to retreive, but I'm unsure on how to go about getting their values. So far I have..
    public int getTerms(int PMID)
              String uri = "http://www.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=pubmed&id="
                           + PMID + "&retmode=xml";
              // Create an XPath object with the XPathFactory class
              XPathFactory factory = XPathFactory.newInstance();
              XPath xPath = factory.newXPath();
              // Define an InputSource for the XML article
              InputSource inputSource = new InputSource(uri);
              // Create the expression
              String expression = "/PubmedArticleSet/PubmedArticle/MedlineCitation/MeshHeadingList/MeshHeading/DescriptorName";
              // Use this expression to obtain a NodeSet of all the MeSH Headings for the article
              try
                   DTMNodeList nodes = (DTMNodeList) xPath.evaluate(expression,
                         inputSource, XPathConstants.NODESET);
                   int length = nodes.getLength();
                   String[] terms = new String[length];
                   // Test mesh terms are being stored.
                    *for (int i=0; i<length; i++)*
    *                    System.out.println(i + ": " + nodes.item(i).getNodeValue());*
                                                    return nodes.getLength();
              catch (XPathExpressionException e2)
              { System.out.println("Article with PMID " + PMID + " has no associated MeSH terms");}
              // return a default
              return 0;
         } The part in bold is the problematic code. I wish to retreive the values of each of the nodes I have taken into my DTMNodeList using a for loop to iterate through each node, and use the getNodeValue() method from the Node class which should return a string. However, the values I retreive are NULL. In the test document I use, the elements do have values.
    Here is a snippet of the XML file I am reading in:
    <MeshHeadingList>
      <MeshHeading>
      <DescriptorName MajorTopicYN="N">Binding Sites</DescriptorName>
      </MeshHeading>
    - <MeshHeading>
      <DescriptorName MajorTopicYN="N">Chromatium</DescriptorName>
      <QualifierName MajorTopicYN="Y">enzymology</QualifierName>
      </MeshHeading>
    - <MeshHeading>
      <DescriptorName MajorTopicYN="Y">Cytochrome c Group</DescriptorName>
      </MeshHeading>
    - <MeshHeading>
      <DescriptorName MajorTopicYN="N">Electron Spin Resonance Spectroscopy</DescriptorName>
      </MeshHeading>
    - <MeshHeading>
      <DescriptorName MajorTopicYN="N">Flavins</DescriptorName>
      </MeshHeading>
    - <MeshHeading>
      <DescriptorName MajorTopicYN="N">Heme</DescriptorName>
      </MeshHeading>
    - <MeshHeading>
      <DescriptorName MajorTopicYN="N">Hydrogen-Ion Concentration</DescriptorName>
      </MeshHeading>
    - <MeshHeading>
      <DescriptorName MajorTopicYN="N">Iron</DescriptorName>
      <QualifierName MajorTopicYN="N">analysis</QualifierName>
      </MeshHeading>
    - <MeshHeading>
      <DescriptorName MajorTopicYN="N">Magnetics</DescriptorName>
      </MeshHeading>
    - <MeshHeading>
      <DescriptorName MajorTopicYN="N">Oxidation-Reduction</DescriptorName>
      </MeshHeading>
    - <MeshHeading>
      <DescriptorName MajorTopicYN="N">Protein Binding</DescriptorName>
      </MeshHeading>
    - <MeshHeading>
      <DescriptorName MajorTopicYN="N">Protein Conformation</DescriptorName>
      </MeshHeading>
    - <MeshHeading>
      <DescriptorName MajorTopicYN="N">Temperature</DescriptorName>
      </MeshHeading>
      </MeshHeadingList>Any help would be appreciated.. thanks :-)

    Answered my own question....
    The element value is actually the child of the node I am current at, so instead of doing:
    i + ": " + nodes.item(i).getNodeValue()); I should have really done:
    i + ": " + nodes.item(i).getChildNode().getNodeValue());

  • Strange Corba performance problem using java 1.6

    I have a java server talking to java and C++ clients using CORBA and moved from java 1.4.2 to 1.6.
    Using java 1.4.2 for a large block of data, the client consistently refreshes in about 28-32 seconds.
    Using Java 1.6 the times vary between 19 and 135 seconds.
    After restarting the server all clients consistently take a simlar amount of time (usually between 32-35 seconds). But sometimes when the server is started the clients see a time between 19-25 seconds, sometimes between 50-55 seconds, and very occassionally over we see times of over 100 seconds.
    Once started, the server seems to pick up some setting or behaviour that causes it to run at a fairly fixed rate.
    We have tried adjusting the GIOP fragment and block size, which can change the performance, but no mater what size we use, we still see this strange behaviour where the server sometime runs in "fast" mode and sometimes in "slow" mode.
    The server side cpu usage is higher when it is in "fast" mode. Client side cpu is higher in slow mode. Amount of data transfered does not appear to change.
    Server runing on Linux RedHat Ent 4u5 - client Linux RedHat 9, RedHat Ent 4u5.
    I see a similar behaviour even when I run the client and server on the same machine.
    Any thoughts on where I should look next anyone?
    Write a simple corba server/client that shows the problem.
    Investigate Other Corba networking settings
    measure the client server packet size and performance.
    Thanks

    3 forums is not enough to post this in, I mean, it is such a HUGE problem,
    you should post it in at least another 20 forums.

  • Using java.lang.reflect.Method.invoke on a static method?

    This is probably a FAQ, but I am finding it impossible to construct a search which answers this question for me.
    How do I call java.lang.reflect.Method.invoke on a static (e.g. class) method? Is it even possible?
    Thanks,
    dwh

    Is this of any help?
    http://www.esus.com/javaindex/j2se/jdk1.2/javalang/reflection/reflection.html
    Cheers,
    Joris

  • Problem Using Java Store Procedure (java class) to connect to sybase

    Hi, I'm trying to use a java class to obtain some data from another databse (SYBASE) in another server.. here are the code
    package pkg;
    import com.sybase.jdbcx.SybDriver;
    import java.sql.Connection;
    import java.sql.Driver;
    import java.sql.DriverManager;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.sql.Statement;
    public class clsTest
    public clsTest()
    public static void main(String[] args)
    testConn("");
    private static void testConn()
    Connection _con= null;
    String host = "XXX";
    String port= "XXX";
    String url = host + ":" + port;
    Statement _stmt= null;
    int timeout = 10;
    boolean needsReconnect = true;
    SybDriver sybDriver = null;
    try
    Class c = Class.forName("com.sybase.jdbc3.jdbc.SybDriver");
    sybDriver = (SybDriver) c.newInstance();
    DriverManager.registerDriver((Driver) sybDriver);
    catch (Exception e)
    System.err.print("Unable to load the Sybase JDBC driver. "
    + e.toString());
    e.printStackTrace(System.out);
    if (needsReconnect)
    try
    if (_con != null)
    _con.close();
    url="jdbc:sybase:Tds:BDSERVER:PORT/BD";
    System.err.println("Trying to connect to: " + url);
    DriverManager.setLoginTimeout(timeout);
    con = DriverManager.getConnection(url,"usrquery","mundial");
    _stmt = _con.createStatement();
    boolean results = _stmt.execute("select count(*) from TABLA");
    if (results)
    ResultSet rs= _stmt.getResultSet();
    rs.next();
    System.err.println(rs.getString(1));
    _con.close();
    catch (SQLException sqle)
    System.err.println(sqle.toString() + " Restart connection.");
    return;
    catch (Exception e)
    e.printStackTrace();
    System.err.println("Unexpected Exception: " + e.toString());
    return;
    When I run the proyect using the IDE JDeveloper I have no problem, but when I make de use loadjava I receive these error message
    creating : resource META-INF/MANIFEST.MF
    loading : resource META-INF/MANIFEST.MF
    Error while creating resource META-INF/MANIFEST.MF
    ORA-29547: Java system class not available: oracle/aurora/rdbms/Compiler
    creating : class pkg/clsTest
    loading : class pkg/clsTest
    creating : resource jconn3.jar
    loading : resource jconn3.jar
    Error while creating resource jconn3.jar
    ORA-29547: Java system class not available: oracle/aurora/rdbms/Compiler
    granting : execute on class pkg/clsTest to public
    Error while computing shortname of pkg/clsSybaseLAE
    ORA-06550: line 1, column 13:
    PLS-00201: identifier 'DBMS_JAVA.SHORTNAME' must be declared
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    resolving: class pkg/clsTest
    errors : class pkg/clsTest
    ORA-29521: referenced name java/lang/StringBuffer could not be found
    ORA-29521: referenced name java/lang/Class could not be found
    ORA-29521: referenced name com/sybase/jdbcx/SybDriver could not be found
    ORA-29521: referenced name java/sql/Driver could not be found
    ORA-29521: referenced name java/sql/DriverManager could not be found
    ORA-29521: referenced name java/lang/System could not be found
    ORA-29521: referenced name java/lang/Exception could not be found
    ORA-29521: referenced name java/io/PrintStream could not be found
    ORA-29521: referenced name java/sql/Connection could not be found
    ORA-29521: referenced name java/sql/Statement could not be found
    ORA-29521: referenced name java/sql/ResultSet could not be found
    ORA-29521: referenced name java/sql/SQLException could not be found
    ORA-29521: referenced name java/lang/Object could not be found
    ORA-29521: referenced name java/lang/String could not be found
    synonym : pkg/clsTest
    The following operations failed
    resource META-INF/MANIFEST.MF: creation
    class pkg/clsTest: resolution
    resource jconn3.jar: creation
    exiting : Failures occurred during processing
    Please some one help me!.. Thank's a lot

    Thanks, you was right, but I have another problem
    The following operations failed
    class cl/bcch/clsSyBase: resolution
    source cl/bcch/clsSyBase: creation (createFailed)
    oracle.aurora.server.tools.loadjava.ToolsException: Failures occurred during processing
         at oracle.aurora.server.tools.loadjava.LoadJava.process(LoadJava.java:1057)
         at oracle.jdeveloper.deploy.tools.OracleLoadjava.deploy(OracleLoadjava.java:124)
         at oracle.jdeveloper.deploy.tools.OracleLoadjava.deploy(OracleLoadjava.java:53)
         at oracle.jdevimpl.deploy.OracleDeployer.deploy(OracleDeployer.java:98)
         at oracle.jdevimpl.deploy.StoredProcHandler.doDeploy(StoredProcHandler.java:503)
         at oracle.jdevimpl.deploy.StoredProcHandler.doDeploy(StoredProcHandler.java:381)
         at oracle.jdevimpl.deploy.StoredProcHandler.doDeploy(StoredProcHandler.java:300)
         at oracle.jdevimpl.deploy.StoredProcProfileDt$Action$1.run(StoredProcProfileDt.java:598)
    #### Export incomplete. #### 09-01-2008 02:28:39 PM
    *** Note ***
    One possibility for the database export failure is that the target Database may not support JDK version 1.4. Updating your Project Properties compiler Source & Target to an earlier release could fix this problem.
    ************

  • In a JSP having a problem using out.println in method

    I am trying to update a field on a form using JAVASCRIPT generated by JSP. The following code works fine when in the main body of the code.
    The field tota on form mainform is updated based on the contents of strTest.
    out.println("<SCRIPT LANGUAGE='JavaScript'>")
    out.println("document.mainform.tota.value = " + strTest);
    out.println("document.mainform.tota.focus()");
    out.println("</SCRIPT>");
    But if you have 10 flds that you want updated, it would be nice NOT to have to use 40 lines of code to do it. I am trying to build a method that will accept a field name and some data to put in a form field. I started small and just wanted to update 1 fld using the method below:
    <%!
    //Declare method to update form fields
    void Update_Frm_Fld()
    out.println("<SCRIPT LANGUAGE='JavaScript'>")
    out.println("document.mainform.tota.value = " + strTest);
    out.println("document.mainform.tota.focus()");
    out.println("</SCRIPT>");
    %>
    I keep getting the error:
    Time_Entry_jsp.java:21: cannot resolve symbol
    symbol : variable out
    location: class org.apache.jsp.Time_Entry_jsp
    out.println("");
    ^
    Help.....

    try this:
    <%@ page import="java.io.*" %>
    <%!
    //Declare method to update form fields
    public void Update_Frm_Fld(HttpServletResponse response)
         throws ServletException, IOException{
              PrintWriter out=response.getWriter();
              out.println("<SCRIPT LANGUAGE='JavaScript'>");
              out.println("document.mainform.tota.value = "+1);
              out.println("document.mainform.tota.focus()");
              out.println("</SCRIPT>");
    %>and when you call the function use this:
    <%Update(response);%>

  • Problem using & inside string in a query

    hi all, i have a problem with one of my query.
    i try using an & inside a string in a query and sqlplus and toad prompt me to enter a value. it is reconizing it as input. this is my query
    select department_name from dept where dept_name = 'S&R';
    how can write this query without sqlplus/toad asking me to enter a value for :R
    i tried to escape & by using 'S\&R' but nothing happen.

    In SQL*Plus you SET DEFINE OFF like this:
    SQL> set define off
    SQL> select 'S&R' from dual;
    'S&
    S&R(can't help you with Toad)

  • Problem using selector string in JMSn receiver

    Hi
    We are creating own JMS Queues in our code, and are using the message selector clause to distinguish between the messages.
    We are using Weblogic version 9.1.
    Although, this works when it is a standalone application (i.e when have two files to send and receive from the JMS Queue), but however the same logic fails when we integrate this with our existing code deployed on WebLogic.
    In our code, we initially receive messages from IBM MQ, before passing it onto the JMS Queue.
    On the receiver side, we use the selector clause to separate the messages.
    The code snippet is as below:
    Here we are doing the steps necessary to receive message from the weblogic queue. But we are getting exception at line createReceiver(this.queue, strQuery); The exception is in the file attached.
    ctx = getInitialContext(WEBLOGICURL);
    System.out.println("this.connectionFactoryString: \r" +
    this.connectionFactoryString);
    this.qconFactory = (QueueConnectionFactory) ctx.lookup(this.connectionFactoryString);
    System.out.println("this.qconFactory: \r" + this.qconFactory);
    this.qcon = this.qconFactory.createQueueConnection();
    System.out.println("this.qcon: \r" + this.qcon);
    this.qsession = this.qcon.createQueueSession(false,Session.AUTO_ACKNOWLEDGE);
    System.out.println("this.qsession: \r" + this.qsession);
    this.queue = (Queue) ctx.lookup(this.queueName);
    System.out.println("this.queue: \r" + this.queue);
    // Note find out whether we are getting this
    final String strQuery;
    strQuery = "JmsConductorID = '1234'";
    System.out.println(
    "strQuery in jmsReceive()of LTDSRequest.java: \r" + strQuery);
    this.qreceiver = this.qsession.createReceiver(this.queue, strQuery);
    System.out.println("Receiver created "+qreceiver);
    this.qreceiver.setMessageListener(this);
    this.qcon.start();
    javax.jms.InvalidSelectorException: weblogic.messaging.kernel.InvalidExpressionException: Expression : "JmsConductorID = '1234'"
    at weblogic.jms.dispatcher.DispatcherAdapter.convertToJMSExceptionAndThrow(DispatcherAdapter.java:110)
    at weblogic.jms.dispatcher.DispatcherAdapter.dispatchSync(DispatcherAdapter.java:45)
    at weblogic.jms.client.JMSSession.consumerCreate(JMSSession.java:2473)
    at weblogic.jms.client.JMSSession.createConsumer(JMSSession.java:2231)
    at weblogic.jms.client.JMSSession.createReceiver(JMSSession.java:2102)
    at weblogic.jms.client.WLSessionImpl.createReceiver(WLSessionImpl.java:866)
    at com.mycom.dep.myfunc.Request.init(Request.java:203)
    at com.mycom.dep.myfunc.Request.<init>(Request.java:151)
    at jrockit.reflect.NativeConstructorInvoker.newInstance([Ljava.lang.Object;)Ljava.lang.Object;(Unknown Source)
          at jrockit.reflect.InitialConstructorInvoker.newInstance([Ljava.lang.Object;)Ljava.lang.Object;(Unknown Source)
          at java.lang.reflect.Constructor.newInstance([Ljava.lang.Object;I)Ljava.lang.Object;(Unknown Source)
          at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:82)
          at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:78)
          at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:156)
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:683)
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:621)
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
          at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:245)
          at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:141)
          at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:242)
          at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:156)
          at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:246)
          at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:128)
          at org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:324)
          at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:97)
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:683)
    Please can someone help?
    Regards,
    Prasad                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    In SQL*Plus you SET DEFINE OFF like this:
    SQL> set define off
    SQL> select 'S&R' from dual;
    'S&
    S&R(can't help you with Toad)

  • Problem using Category to split a large file

    I want to split a large class file by putting methods used only internally into a separate source file. The original file is "Calculator.m"; the new file is "CalculatorP2.m" which has been added to the project. In the main file I have added the statement:
    #import "CalculatorP2.m"
    just ahead of "@implementation Calculator".
    In "CalculatorP2.m I have placed the statements:
    #import "Calculator.h"
    @interface Calculator ( CalculatorP2 )
    @end
    @implementation Calculator ( CalculatorP2 )
    ahead of the source code. The compiler is happy with this but the linker fails, saying:
    /usr/bin/ld: multiple definitions of symbol .objccategory_name_CalculatorCalculatorP2
    Any idea as to how to fix this? I am using XCode 2.4.1.

    SecondViewControllerP2.h:
    #import <UIKit/UIKit.h>
    #import "SecondViewController.h"
    @interface Secondviewcontroller(SecondviewcontrollerP2)
    - (void)method1;
    @end
    SecondViewControllerP2.m:
    #import "SecondViewControllerP2.h"
    @implementation Secondviewcontroller(SecondviewcontrollerP2)
    - (void)method1 {
    NSLog(@"method1");
    @end
    SecondViewController.m:
    #import "SecondViewController.h"
    #import "SecondViewControllerP2.h"
    @implementation Secondviewcontroller
    @end

  • Problem using Java under Vista - Need help, please

    Hi everybody, I'm looking after a solution to resolve following problem : for one of my customer who's needing to use a secure access to a HTTPS URL, after Java is started, I receive the Java logo but it must be followed by an authentification screen where it's needed to enter a login + password. Sometimes it work (I think only when I force to reload the HTTPS certificate) but each time, the application freeze on this screen that I can see in the Task Bar but I can only close it and impossible to access it for the next step of the process. It's working on an original Windows Vista Home Premium pre-installed on a Sony Vaio Laptop and I've already use the application on another computer with Vista Business without any problem. Thanks in advance.

    Thanks for your answer. I've just tried on my XP Laptop. Here are the steps : after several windows, the Java start into a blank window and I receive then the logo at the left side of the window. After, in this case I'm asked to accept the HTTPS certificate and remember it if I want. When accepted, I receive then new "little" window (like a dialof box) with "Authentifaction request" when I need to enter again a login + password. If I recieve this last window, it mean that all is going fine but in my "problem" case, after the Java window, I see only this authentification request onthe task bar but no way to open it or to see it on the screen but no error message except ont the java window (no answer). Perhaps one more information, indication, it appaers "Oracle Application Server Forms Services" into the title bar.

  • Problem using Java Webstart to kick off CORBA Client

    Dear all,
    I am currently having a problem in using the Java Webstart to kick off
    the CORBA Client, I set up the JNLP file jvm properties as following:
    <resources>
    <j2se version="1.4*" java-vm-args="-Xms64m -Xmx256m -verbose -esa
    -Xnoclassgc -client -Dswing.useSystemFontSettings=false ">
         <resources>
         <property name="vbroker.orb.initRef"
    value="NameService=corbaloc::10.35.55.82:20005/NameService"/>
    </resources>
    </j2se>
    </resources>
    The problem I have is that when the webstart starting the client, the
    client just simply dies during the startup and I find the log message
    following:
    org.omg.CORBA.ORBPackage.InvalidName
         at com.inprise.vbroker.orb.ORB.resolve_initial_references(ORB.java:943)
    So it is showing that there is problem with the vbroker.orb.initRef
    setting, know that if I don't use the webstart to start the client and
    simply use the windows batch file, using the jvm properties as:
    java -Dvbroker.orb.initRef=NameService=corbaloc::10.31.51.80:20001/NameService
    It would work perfectly.
    Could you tell if I miss anything when configuing the webstart jnlp
    file on this regard? Currently, I think that the only way I can set
    the JVM properties in the JNLP file is to use its properties tag to
    set the system properties for the application.
    Thanks heaps in advance for any help you can give here !!!
    Victor

    Hi, Andre,
    No, I have tried both of your suggestion and there was no joy. I still have the following error and the client jvm just crashes during starting up:
    org.omg.CORBA.ORBPackage.InvalidName
         at com.inprise.vbroker.orb.ORB.resolve_initial_references(ORB.java:943)
    I believe it is still related to the jvm properties:
    <property name="vbroker.orb.initRef" value="NameService=corbaloc::10.35.55.82:20005/NameService"/>
    And know that when I used "-Dvbroker.orb.initRef=NameService=corbaloc::10.35.55.82:20005/NameService" in the windows batch file, the client runs ok.
    Is this indicating that there is the limitation of using the webstart to invoke CORBA client?
    Any further help would be very appreciated!
    Victor

  • Help...problems using java comm API

    Hi all
    im using Fedora Core and in order to list all the available serial ports for my computer i'm using the classic program TestEnumeration, but when running from jbuilder 2005 not from shell i received the following errors:
    Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path
    Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver
    Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path
    Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver
    warning: no ports found - make sure javax.comm.properties file is found
    i have followed all the instruction to install comm API but i received the same error i need help plz if someone can
    thx

    import java.io.*;
    import java.util.*;
    import javax.comm.*;
    import java.lang.*;
    import java.Buff.*;
    public class SimpleRead implements Runnable, SerialPortEventListener
         static CommPortIdentifier portId;
         static Enumeration portList;
         InputStream inputStream;
         SerialPort serialPort;
         Thread readThread;
         public static void main(String[] args)
         {//System.out.println("hello");
              portList = CommPortIdentifier.getPortIdentifiers();
              while (portList.hasMoreElements())
                   portId = (CommPortIdentifier) portList.nextElement();
                   if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL)
              if (portId.getName().equals("COM1"))
                   // if (portId.getName().equals("/dev/term/a")) {
              SimpleRead reader = new SimpleRead();
         public SimpleRead()
         try
              serialPort = (SerialPort) portId.open("SimpleReadApp", 2000);
         catch (PortInUseException e)
                                  System.out.println(e);
         try
         inputStream = serialPort.getInputStream();
         catch (IOException e)
                        System.out.println(e);
                   try
    serialPort.addEventListener(this);
                   catch (TooManyListenersException e)
                        System.out.println(e);
         serialPort.notifyOnDataAvailable(true);
         try
         serialPort.setSerialPortParams(9600,
    SerialPort.DATABITS_8,
    SerialPort.STOPBITS_1,
    SerialPort.PARITY_NONE);
              catch (UnsupportedCommOperationException e)
                        System.out.println(e);
    try {
    out = new OutputStreamWriter(serialPort.getOutputStream());
    out.write("ATQ0V1E0");
    out.flush();
    out.write("ATQ0V1E0");
    Out.close();
    //System.out.println("ATQ0V1E0");
    catch (IOException e) {}
    try {
    int line;
    int result ;
    InputStream = serialPort.getInputStream();
    int num= inputStream.available();
    InputStreamReader reader = new InputStreamReader(inputStream);
    System.out.println(reader.ready());
    while ((line = reader.read()) <= 0)
    result =reader.read();
    System.out.println("Success " + result);
    reader.close();
    catch (IOException e) {}
    readThread = new Thread(this);
    readThread.start();
    try {
    OutputStream = SerialPort.getOutputStream();
    catch (IOException e) {}
              System.out.println("ATQ0V1E0");
    public void run()
         try
    Thread.sleep(500);
    catch (InterruptedException e)
                   System.out.println(e);
    public void serialEvent(SerialPortEvent event)
    switch(event.getEventType())
    case SerialPortEvent.BI:
    case SerialPortEvent.OE:
    case SerialPortEvent.FE:
    case SerialPortEvent.PE:
    case SerialPortEvent.CD:
    case SerialPortEvent.CTS:
    case SerialPortEvent.DSR:
    case SerialPortEvent.RI:
    case SerialPortEvent.OUTPUT_BUFFER_EMPTY:
    break;
    case SerialPortEvent.DATA_AVAILABLE:
    byte[] readBuffer = new byte[20];
    try
    while (inputStream.available() > 0)
    int numBytes = inputStream.read(readBuffer);
    System.out.print(new String(readBuffer));
    catch (IOException e)
                        System.out.println(e);
    break;
    hi friends am getting these errors
    C:\programs>javac SimpleRead.java
    SimpleRead.java:115: illegal start of expression
    public void run()
    ^
    SimpleRead.java:159: ';' expected
    ^
    2 errors
    please help me....
    its very urgent....this is the first program of mine.... am so tensed..
    i should finish this soon... please help me...
    this is my mail ID
    [email protected]

  • Problem using java crypto class... Please help me

    Hi, i'm trying to do application that send information via socket, and i have to send the data encrypted,
    i`m trying to implemented the RC4 algorithm.... I read an article that said that the java sdk 1.4 has already
    implemented the securities classes. So I made this little program:
    import javax.crypto.spec.*;
    import javax.crypto.*;
    import java.security.*;
    import java.io.*;
    public class MicroRC4
    public void encriptaClavePublica(String trama)
    Cipher rc4Cipher;
    byte[] rc4KeyByte;
    SecretKey rc4Key;
    String keyStr;
    String messageEncryp;
    byte[] messageEncrypByte;
    rc4Key = null;
    messageEncryp = trama;
    // Clave para encriptar el mensaje
    keyStr = new String();
    keyStr = "12345678";
    rc4KeyByte = new byte[8];
    messageEncrypByte = new byte[255];
    for(int i=0; i < 8; i++)
    rc4KeyByte[i] = (byte)keyStr.charAt(i);
    try
    for(int i=0; i < messageEncryp.length(); i++)
    messageEncrypByte[i] = (byte)messageEncryp.charAt(i);
    rc4Key = (SecretKey)new SecretKeySpec(rc4KeyByte, "RC4");
    rc4Cipher = Cipher.getInstance("RC4");
    rc4Cipher.init(Cipher.ENCRYPT_MODE, rc4Key);
    byte[] result = null;
    result = rc4Cipher.doFinal(messageEncrypByte);
    System.out.println("Usage:"+result);
    catch(Exception e)
    System.out.println(" Error: " + e.getMessage());
    System.out.println("\n........................................\n");
    I don't know what is wrong but when i run the application it show me the following message :
    Error: Algorithm RC4 not available
    Does anybody know what is wrong ??
    Does anybody can help me ??
    or tell me when can i find some source code that implement de RC4 algorithm
    Thank's in advance..
    Alejandro.

    Hi Alejandro,
    In the ends i decided to implement the algorithm by
    myself, i did it... any way thank's again.... If
    anybody want to see the code, send me a mail......
    AlejandroCan I also get the source code? my email id is [email protected]
    Thanks a lot!
    Srik.

  • Charset problems using java applet.

    Im running a java applet where the text is displayed in a JEditorPane.
    When running the applet locally the charset is all fine, but when i push the applet into a webserver the charset is displayed incorrectly.
    Anyone have any thoughts why this can happen?

    Actually this was caused because I signed the jarfiles running on the server. Why does that happen?

Maybe you are looking for

  • Can Grow Vertical Alignment Error in Embedded Report View, but not in .PDF

    Hello, I have seen postings about this issue before, but have yet to find a solution.  I am using Visual Studio 2008 w/ the basic version of Crystal Reports that is included. I have a simple report that displays results of a stored procedure as rows

  • Satellite Pro M30 Win 7 - webcam does not work on msn messenger

    Hi all I have a Satellite Pro M30 Modell Nr.: PSM35E and have just changed to Windows 7. But the Nvidia Card NVIDIA GeForceTM FX Go5200 Grafik mit 64 MB RAM does not work properly. I could find a driver from Vista and installed it, have Aero pics on

  • Trouble with Boot Device

    I'm having some trouble with boot devices on my Neo Plat and I hoped someone here might have a fix. I recently installed a new hard-drive as C. I've gone into Bios/Advanced Features and set the boot order to the following: Hard Drive CD-ROM Floppy Wh

  • Uploading edited photos from Lightroom to Picasa

    Hi I have recently purchased Lightroom 4. I have edited my photos and saved them as JPEG. I exported them to my computer and wanted to select some for my Picasa web album. I have never resized previously and uploaded full size as I thought they are m

  • HT2731 Can not connecttoitunes iTunes

    I have ipad2 when I try to add apps it keeps saying cannot connect to iTunes my wifi is connect and I can surf the Internet with no problems