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)

Similar Messages

  • 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 ?

  • 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)

  • How to use List String in JSP page?

    Hello All,
    I am having problem using List<String> in my JSP page. Below is my JSP code.
    <%@ page import="java.util.*, java.io.*"%>
    <html>
    <body>
    <h1 align="center">Beer Recommendations JSP</h1>
    <p>
    <%
    List<String> beerBrands = (List<String>)request.getAttribute("styles");
    Iterator<String> it = beerBrands.iterator();
    while(it.hasNext()){
         out.print("<br>try: " + it.next());
    %>
    </body>
    </html>
    When I compile the above JSP code in Eclipse 3.4 (using JBoss 4.2 as my Application Server), I get the following Warning.
    Type safety: Unchecked cast from Enumeration to Enumeration<String>
    If I add the "@SuppressWarnings("unchecked")" to the code, Eclipse does not give any Error during compilation. But, at runtime, I get the following Error.
    org.apache.jasper.JasperException: Unable to compile class for JSP:
    An error occurred at line: 10 in the jsp file: /BeerAdvice.jsp
    Syntax error, annotations are only available if source level is 5.0
    7: <p>
    8:
    9: <%
    10: @SuppressWarnings("unchecked")
    11: List<String> beerBrands = (List<String>)request.getAttribute("styles");
    12: Iterator<String> it = beerBrands.iterator();
    13: while(it.hasNext()){
    An error occurred at line: 11 in the jsp file: /BeerAdvice.jsp
    The type List is not generic; it cannot be parameterized with arguments <String>
    8:
    9: <%
    10: @SuppressWarnings("unchecked")
    11: List<String> beerBrands = (List<String>)request.getAttribute("styles");
    12: Iterator<String> it = beerBrands.iterator();
    13: while(it.hasNext()){
    14:      out.print("<br>try: " + it.next());
    An error occurred at line: 11 in the jsp file: /BeerAdvice.jsp
    Syntax error, parameterized types are only available if source level is 5.0
    8:
    9: <%
    10: @SuppressWarnings("unchecked")
    11: List<String> beerBrands = (List<String>)request.getAttribute("styles");
    12: Iterator<String> it = beerBrands.iterator();
    13: while(it.hasNext()){
    14:      out.print("<br>try: " + it.next());
    Any help is very much appreciated.
    Thank you for your help.
    Thanks,
    Chubha

    Hi anotherAikman,
    Thank you for your help. I currently have the following version of the Java.
    {color:#800000}java version "1.6.0_17"
    Java(TM) SE Runtime Environment (build 1.6.0_17-b04)
    Java HotSpot(TM) Client VM (build 14.3-b01, mixed mode, sharing)
    {color:#000000}{color:#000000}Does it mean I have Java SE Version 6 Update 17 and you are suggesting me to download the Java EE Version 6?{color} If this is correct, can you please let me know what difference does it make?
    I am now going to install the Java EE 6 and try this out.
    Thank you for your help.{color}
    {color:#000000}Thanks,
    Chubha{color}
    {color}

  • Problems using parseEscapedXML with a string containing ampersant

    Hi,
    I'm trying to pass a string with a url in it to the parseEscapedXML funtion. The string looks like this:
    http://www.test.com/test&id2
    I get an error message saying the entity id2 cannot be resolved and that it must end with ;
    I tried escaping (replacing & by &amp;) and double escaping (&amp;amp;) but that didn't solve anything.
    Any suggestions?

    I'll be a little more specific.
    Our service takes several input parameters (all strings, amongst them is the url parameter).
    We use a file template which is an xml, containing this kind of stuff:
    <element>$url$</element>
    We load the template into a string, then use java string replacement and getVariableData to replace the template stuff with the values that were received from the input.
    To finalize, the string, forming a perfect xml, is parsed with parseEscapedXML and passed on to another service.
    To sum up: if url contains
    a [AMPERSANT] a
    it failes.
    if url contains
    a [ESCAPED AMPERSANT] a
    it also fails.
    So Marc, I think you suspected that I had some other characters causing the problem, but they aren't there. Unless you mean I should escaped my whole template ...

  • I downloaded a application to my iphone5, however when i open the application i receive a message stating that my device clock apperars to be incorrect as a result you may experience problems using this application. How do i fix this issue?

    Im trying to watch a show but because of this message its not allowing me to do so. Again the error message im receiving is " Your device's clock appears to be incorrect as a result you ,ay experince problems using this application" how do i resolve this issue?

    If there are problems with updating or with the permissions then best is to download the full version and trash the currently installed version to do a clean install of the new version.
    Download a new copy of the Firefox application and save the disk image file to the desktop
    *Firefox 26.0: http://www.mozilla.org/en-US/firefox/all.html
    *Trash the current Firefox application (open the Applications folder in the Finder and drag the Firefox application to the Trash) to do a clean (re-)install
    *Install the new version that you have downloaded
    *https://support.mozilla.org/kb/Installing+Firefox+on+Mac
    Your personal data is stored elsewhere in the Firefox profile folder, so you won't lose your bookmarks and other personal data when you uninstall and (re)install Firefox.
    *http://kb.mozillazine.org/Profile_folder_-_Firefox

  • Receiver SOAP Adapter Use Query String

    Hello everybody,
    I want to include in my Receiver SOAP Adapter the message id as part of the URL String, but I need to include only the MessageId value, if I use the Use Encoded Headers and Use Query String options it includes all the header fields as part of the URL, is there a way to define only the fields that I need?, thanks in advance.
    Regards,
    Julio Cesar

    May be you could try to use adapter specific message attribute "TServerLocation". This will help you set the dynamic URL.
    http://help.sap.com/saphelp_nw04/helpdata/en/29/5bd93f130f9215e10000000a155106/frameset.htm
    Regards,
    Prateek

  • Problem using string to store evt.target.data and apply property filters

    I have about 9 buttons on my stage and I want to write code for the rollover and rollout effects, I only want to write the code once so I am trying to pass the button info into a string via evt.target.data and it pass the info properly into my string variable but when I try to set my filter to that variable, setting my movieclip instance name to that variable, I get 2 errors:
    1119: Access of possibly undefined property filters through a reference with static type String.
    Warning: 1072: Migration issue: String is not a dynamic class.  Instances cannot have members added to them dynamically.
    My code is:
    import fl.transitions.Tween;
    import fl.transitions.easing.*;
    var thumbArray:Array=new Array();
    var movieClipLoader:Loader;
    var movieClipsStage:Array=new Array(mc0,mc1,mc2,mc3,mc4,mc5,mc6,mc7,mc8);
    toolTip_mc.alpha=0;
    var lumRd:Number=.2127;
    var lumGr:Number=.7152;
    var lumBl:Number=.0722;
    //grayscale
    var grayscale:ColorMatrixFilter = new ColorMatrixFilter([lumRd, lumGr, lumBl, 0, 0,
    lumRd, lumGr, lumBl, 0, 0,
    lumRd, lumGr, lumBl, 0, 0,
    0, 0, 0, 1, 0]);
    //drop shadow
    var ds:DropShadowFilter = new DropShadowFilter();
    ds.distance=5;
    ds.blurX=10;
    ds.blurY=10;
    ds.alpha=.7;
    //varialbe to store movieclips based on rollover
    var whichThumb:String;
    var myXMLInfo:XML;
    var thumbList:XMLList;
    var toolNameList:XMLList;
    var myXMLLoader:URLLoader=new URLLoader  ;
    myXMLLoader.load(new URLRequest("stars.xml"));
    myXMLLoader.addEventListener(Event.COMPLETE, loadComplete);
    function loadComplete(evt:Event):void {
    myXMLLoader.removeEventListener(Event.COMPLETE, loadComplete);
    myXMLInfo=XML(evt.target.data);
    thumbList= new XMLList();
    toolNameList=myXMLInfo.star.@toolname;
    thumbList=myXMLInfo.star.@thumbimage;
    for (var n:int=0; n<movieClipsStage.length; n++) {
    movieClipLoader=new Loader();
    movieClipLoader.load(new URLRequest(thumbList[n]));
    movieClipsStage[n].addChild(movieClipLoader);
    mc0.filters=mc1.filters=mc2.filters=mc3.filters=mc4.filters=mc5.filters=mc6.filters=mc7.fi lters=mc8.filters=[ds,grayscale];
    mc0_bu.addEventListener(MouseEvent.ROLL_OVER, thumbRollEffect);
    function thumbRollEffect(evt:MouseEvent):void {
    whichThumb = evt.target.name;
    whichThumb.filters=[ds];
    Thank you for your help!

    kglad, thanks for helping.
    basically, i am a newbie and i'm not clear on your answer . if evt.currentTarget is better, I would like to use the best method, so thanks. i'm trying to get my head around what's going on here in the code. i get that actionscript is storing a "reference" to the object but I don't get why I can't put that reference (which is the name of the movieclip on the stage I wish to apply filters to, i.e. mc0) into a string variable (whichThumb) and then use that string variable to apply the filter (whichThumb.filters=[ds];)
    on one hand, i'm getting error that says "possibly undefined property filters thru a ref with string" which I don't get because the filters are defined outside of the function and are called intially in the load function with no problem. and on the other hand, i am getting another error saying there is a "migraiton issue" with my string not being a dynamic class. do i need to make the var whichThumb another type other than string? if so, what type. maybe that will also solve the "undefined property" issue as well.
    still learning, Thanks for help!

  • I am having problems sending emails when using apps. I dont receive any emails when I try to send documents such as pdf or pictures. I tried sending it to my other email account but I don't get any email. What is wrong?

    I am having problems sending emails when using apps. I dont receive any emails when I try to send documents such as pdf or pictures. I tried sending it to my other email account but I don't get any email. What is wrong?

    System Preferences > Network > your-connection-medium > (Assist me) > ( Diagnostics )
    This sometimes provides additional helpful information, sometimes not so much.

  • Problem using a GUI, a loop and a different thread for the loop

    Hi everyone!
    First of all sorry if my post is in the wrong forum.
    I'm designing a client-server project to allow users to comunicate with each other, and I have a problem in the client class. I'm using the UDP transport protocol, and I'm not allowed to use TCP. The thing is, each client is allowed to send and receive a message at any time, so by pushing a button the "sending event" triggers and sends it, and in order to receive i've launched a receiving process in another different thread, so the sending procces wouldn't be blocked.
    This is the code of the client class, called Conversacion:
    package mymessenger;
    import javax.swing.*;
    import java.net.*;
    import java.io.*;
    import java.lang.*;
    import java.awt.*;
    import java.util.*;
    public class Conversacion extends javax.swing.JFrame {
        private InetAddress MaquinaServidor;
        private int PuertoServidor;
        private DatagramSocket MiSocket;
        private DatagramPacket PaqueteSalida;
        byte [] BufferEntrada= new byte[1024];
        private DatagramPacket PaqueteEntrada= new DatagramPacket (BufferEntrada,BufferEntrada.length);
        byte [] BufferSalida;
        int ack=0;
        int puerto_contrario;
        String direccion="192.168.1.102";
        String direccion_contraria;
        String destinatario_completo="";
        String nombre_destinatario="";
        String nombre_local="";
        String mensaje_recibido=""; // This is the variable I want to use every time a client receives a message
        boolean salir=false;
        public Conversacion()
            initComponents();
            esperar();
    @SuppressWarnings("unchecked")
    // Here would come the generated code by Netbeans, which is not relevant in this case
    private void enviarActionPerformed(java.awt.event.ActionEvent evt) {                                     
       // This is the sending event that calls a function to send the message to the server, i'll post it in another message
        void enviar (String mens) 
            // Function used to send the message to the server, i'll post it in another message
        void esperar() // Here's the problem (I think)
            new Thread(new Runnable() // I launch it in a new thread, so I don't block "enviar"
                public void run() // At first, the client sends some message to the server, so the server knows some data of the client. Go to the while() command please
                    String respuesta="";
                    try
                        MiSocket= new DatagramSocket();
                        MaquinaServidor= InetAddress.getByName(direccion);
                        PuertoServidor=7777;
                        String comando="ENVIAME LOS DATOS AQUI, A LA CONVERSACION";
                        byte[] na={(byte)(ack%2)};
                        comando= (new String (na))+comando;
                        BufferSalida = comando.getBytes();
                        PaqueteSalida = new DatagramPacket(BufferSalida,BufferSalida.length,MaquinaServidor,PuertoServidor);
                        segsend(PaqueteSalida);
                        ack++;
                        System.out.println("Estoy esperando un mensaje del servidor");
                        segreceive(PaqueteEntrada);
                        String retorno = new String(BufferEntrada, 1,PaqueteEntrada.getLength()-1);
                        int pos= retorno.indexOf("(");
                        int pos2=retorno.indexOf("]");
                        int pos3=retorno.indexOf("Ð");
                        nombre_destinatario=retorno.substring(0,pos-1);
                        destinatario_completo=retorno.substring(0,pos2+1);
                        direccion_contraria=retorno.substring(pos2+1,pos3);
                        nombre_local=retorno.substring(pos3+1);
                        setTitle(destinatario_completo+" - CONVERSACIÓN");
                        segreceive(PaqueteEntrada);
                        respuesta = new String(BufferEntrada, 1,PaqueteEntrada.getLength()-1);
                        puerto_contrario = Integer.parseInt(respuesta);
                        while (!salir) // Here begins the infinite loop I use to receive messages over and over again
                            segreceive(PaqueteEntrada); // I use segreceive that is kind of the same as "receive". No big deal about this
                            mensaje_recibido = new String(BufferEntrada, 1,PaqueteEntrada.getLength()-1); // Every time a client receives a message, I want to store it in the variable "mensaje_recibido"
                            int pos4 = mensaje_recibido.indexOf(":");                     // This next 4 commands are not relevant
                            String auxiliar=mensaje_recibido.substring(pos4+2);
                            if (auxiliar.equals("FINALIZAR CONVERSACION"))
                                setVisible(false);
                            SwingUtilities.invokeLater(new Runnable() // Now I want to asign the value of mensaje_recibido (the message I just received) into texto_total, a Swing text area
                                public void run()
                                    String auxi=texto_total.getText();
                                    if (auxi.equals(""))
                                        texto_total.setText(mensaje_recibido); // if the text area was empty, then then i put into it the message
                                    else
                                        texto_total.setText(auxi+"\n"+mensaje_recibido); // if it's not, then i put the message in the next line of the text area
                            Thread.sleep(1000);
                    catch (Exception e3)
                        System.out.println(e3);
            }).start();
        }The communication starts and one user is able to send all the messages he wants to the other one, but when the other wants to send one to the first user, the first user receives a message with the same character over and over again that looks like an square &#9632;. Again, this problem comes when a user that already sended a message, and wants to receive one for the first time (and next times). I searched in these forums all day and so far I couldn't fix it.
    This problem happens in the receiver client, not in the sender client and not in the server. I already looked into that and those things are doing what they have to. I would be really really grateful if somebody could tell me which is the problem or how to fix this, because I'm becoming nuts.
    Now I'm going to post the function "enviar" which sends the message, and the content of "enviarActionPerformed" which calls "enviar".
    Again, excuse me if this is the wrong forum for this question. and sorry for my English too.

    This is the rest of the code, though I don't think the problem is here, maybe by pushing the sending button it causes the receiving problem:
    private void enviarActionPerformed(java.awt.event.ActionEvent evt) {                                      
            String mensaje=texto.getText();
            mensaje=nombre_local+" dice: "+mensaje;
            texto.setText("");
            String auxiliar=texto_total.getText();
            if (auxiliar.equals(""))
                texto_total.setText(mensaje);
            else
                texto_total.setText(auxiliar+"\n"+mensaje);
            enviar(mensaje);
        void enviar (String mens)
            String respuesta="";
            try
                MiSocket= new DatagramSocket();
                MaquinaServidor= InetAddress.getByName(direccion);
                PuertoServidor=7777;
                BufferedReader Teclado= new BufferedReader(new InputStreamReader(System.in));
                BufferEntrada = new byte[1024];
                PaqueteEntrada = new DatagramPacket (BufferEntrada,BufferEntrada.length);
                BufferSalida=new byte[1024];
                String comando="RETRANSMITIR MENSAJE";
                byte[] na={(byte)(ack%2)};
                comando= (new String (na))+comando;
                BufferSalida = comando.getBytes();
                PaqueteSalida = new DatagramPacket(BufferSalida,BufferSalida.length,MaquinaServidor,PuertoServidor);
                segsend(PaqueteSalida);
                ack++;
                String puerto= Integer.toString(puerto_contrario);
                int pos = mens.indexOf(":");
                String auxiliar=mens.substring(pos+2);
                comando=mens+"-"+direccion_contraria+"*"+puerto;
                byte[] nb={(byte)(ack%2)};
                comando= (new String (nb))+comando;
                BufferSalida = comando.getBytes();
                PaqueteSalida = new DatagramPacket(BufferSalida,BufferSalida.length,MaquinaServidor,PuertoServidor);
                segsend(PaqueteSalida);
                ack++;
                if (auxiliar.equals("FINALIZAR CONVERSACION"))
                    setVisible(false);
            catch(Exception e)
                System.out.println(e);
        }I'm gonna keep working on it, if I manage to fix this I'll let you know. Thanks a lot!

  • Unable to connect using connect string in linus using sys user in Linux

    Hi,
    I am facing problem in using connect string while connecting as sys user in Linux OS
    For example:
    When I am connecting as
    sys/sysoracle as sysdba its getting connected.
    But when I am providing the connect string such as sys/sysoracle@TEST as sysdba its showing with error as:
    ORA-12505: TNS :listener does not currently know of SID in connect descriptor
    Any help will be benefitial for me
    Thanks and Regards

    >
    ORA-12505:
    TNS:listener does not currently know of SID given in connect descriptor
    Cause:     The listener received a request to establish a connection to a database or other service. The connect descriptor received by the listener specified a SID for an instance (usually a database instance) that either has not yet dynamically registered with the listener or has not been statically configured for the listener. This may be a temporary condition such as after the listener has started, but before the database instance has registered with the listener.
    Action:     
    - Wait a moment and try to connect a second time.
    - Check which instances are currently known by the listener by executing: lsnrctl services <listener name>
    - Check that the SID parameter in the connect descriptor specifies an instance known by the listener.
    - Check for an event in the listener.log file.>
    So are you sure that TEST is a right connection string that you are using and is rightly configured?
    HTH
    Aman....

  • Error accesing/using a String object.......

    Hi again folks!
    Well now I have other problem, I don?t know what's happening, but I have simple C++ program as shared object which retrieves information from a Database, with the query results it makes a single string with all the data retrieved.
    This C++ program is called by a Java program using JNI, but when my Java program receives the string and tries to parse it with the StringTokenizer object I get an error like this:
    SIGSEGV 11* segmentation violation
    si_signo [11]: SIGSEGV 11* segmentation violation
    si_errno [0]: Error 0
    si_code [1]: SEGV_ACCERR [addr: 0x45cb2448]
    stackbase=DFFFF0A0, stackpointer=DFFFD0CC
    Full thread dump:
    "SIGQUIT handler" (TID:0xdd300190, sys_thread_t:0x42020, state:R, thread_t:
    t@5, sp:0x0 threadID:0xdeaf0dd8, stack_base:0xdeaf0d6c, stack_size:0x20000) prio
    =0
    "Finalizer thread" (TID:0xdd3000d0, sys_thread_t:0x41fb8, state:CW, thread_t
    : t@4, sp:0x0 threadID:0xdebb0dd8, stack_base:0xdebb0d6c, stack_size:0x20000) pr
    io=1
    "main" (TID:0xdd3000a8, sys_thread_t:0x42908, state:R, thread_t: t@1, sp:0x0
    threadID:0x20a18, stack_base:0xdffff0a0, stack_size:0x800000) prio=5 *current t
    hread*
    ObjectFactory.createObject(Compiled Code)
    Test.main(Compiled Code)
    Registered Monitor Dump:
    PCMap lock: <unowned>
    Thread queue lock: <unowned>
    Name and type hash table lock: <unowned>
    String intern lock: <unowned>
    JNI pinning lock: <unowned>
    JNI global reference lock: <unowned>
    BinClass lock: <unowned>
    Class loading lock: owner "main" (0x42908, 1 entry)
    Java stack lock: <unowned>
    Code rewrite lock: <unowned>
    Heap lock: <unowned>
    Has finalization queue lock: <unowned>
    Finalize me queue lock: <unowned>
    Waiting to be notified:
    "Finalizer thread"
    Monitor cache expansion lock: <unowned>
    Monitor registry: owner "main" (0x42908, 1 entry)
    Abort (core dumped)
    I dont know if I have to do something special before use the String, what's happening?
    Any comment will be welcome.
    Thanks in advance.

    I hope this could help to clarify the scenario
    In a previous query I get the number of rows returned by the next query
    this number is stored at SQL_NUM_SEGS.arr variable. When I have the number of rows I reserve memory for the char array that I'm going to return with all the information.
    AC01_TRAMA=(char *)malloc(atol(SQL_NUM_SEGS.arr) * INT02_TAM_SEG);
    /*embedded PL/SQL code*/
    EXEC SQL DECLARE CUR_EMISORA CURSOR FOR
    SELECT rtrim(to_char(NUM_EMISORA)) || '|' || rtrim(SERIE) || '|' || EMISORA || '|' || STATUS FROM NUCL_EMISORA WHERE STATUS NOT LIKE 'BAJA';
    EXEC SQL OPEN CUR_EMISORA;
    The next lines of code generate a string like this:
    "UTIL0000|366|239|93-1|FINASA |VIGE|243|3-90|BONSER |VIGE|248|2-94|BONSER |VIGE|287|970403|GOBFED |VIGE|362|93-4|BANOBRA |VIGE|404|2-90|BONSER |VIGE|407|2-95|FINASA |VIGE|633|95|BANMEXI |VIGE|641|2-94|PROMEX |VIGE|645|1-95|FINASA |VIGE|647|1-96|FINASA |VIGE|660|92|BANORTE |VIGE|677|93-3|BANOBRA |VIGE|678|1-90|BIATLAN |VIGE|736|2-95|BONSER |VIGE|786|1-94|BNCI |VIGE|1007|021024|GOBFED |VIGE|1008|021121|GOBFED |VIGE|"
    this string is assigned to AC01_TRAMA(char pointer)and then I return this string in the next way:
    return ( (env)->NewStringUTF(AC01_TRAMA) );
    My java program is this:
    public class Monitor
    public native String consultaGeneral();
    static
    System.load("/afs/invermexico.com.mx/usr2/salponce/gustavo/jni/src_db/Monitor.so");
    public String getTrama()
         String strTrama=consultaGeneral();
    return strTrama;
    public static void main(String []args)
    String strEmisora, strNumEmisora, strStatus,strSerie;
    Monitor m=new Monitor();
    System.out.println(m.getTrama());
    /*java.util.StringTokenizer STk = new java.util.StringTokenizer(m.getTrama(),"|");
    while(objSTk.hasMoreTokens())     
    strEmisora = objSTk.nextToken();
    strNumEmisora = objSTk.nextToken();
    strStatus = objSTk.nextToken();
    strSerie = objSTk.nextToken();
    System.out.println("\n<------>\n"+ strEmisora+"\n"+strNumEmisora+"\n"+strStatus+"\n"+strSerie);
    }//while
    Well, this java program works fine but if I try to create an String tokenizer with it the program crashes, even if I assign the result into a new String object.
    I'm going to put all the code rigth here
    C++ program
    #include "ast_bd.h"
    #include "Monitor.h"
    #include <stdlib.h>
    #include <stdio.h>
    #include <strings.h>
    #include <jni.h>
    #define CHA01_NOMBRE_APP "UTIL0000"
    #define CHA02_FIN_DE_SEG "|"
    #define INT01_TAM_LONG 20
    #define INT02_TAM_SEG 52 /*52 BYTES; Tama�o de los 4 datos en conjunto*/
    Prop�sito :-Determinar cuales son las emisoras con estado de vigente
    o bloqueado.
    -Obtener los datos de una emisora espec�fica.
    -Actualizar los datos de una emisora espec�fica.
    JNIEXPORT jstring JNICALL Java_Monitor_consultaGeneral
    (JNIEnv *env, jobject obj)
    long LO01_STATUS=1;
    char CH01_NUM_SEGS[INT01_TAM_LONG];
    char AC01_TRAMA, AC02_SEG;
    EXEC SQL BEGIN DECLARE SECTION;
    VARCHAR SQL_NUM_SEGS[INT01_TAM_LONG],
    SQL_RESULT[INT02_TAM_SEG];
    EXEC SQL END DECLARE SECTION;
    EXEC SQL WHENEVER SQLERROR CONTINUE;
    open_db();
    EXEC SQL SELECT to_char(COUNT(1)) INTO:SQL_NUM_SEGS FROM NUCL_EMISORA WHERE STATUS NOT LIKE 'BAJA';
    LO01_STATUS = sqlca.sqlcode;
    if( !LO01_STATUS ) /*si todo sali� bien*/
    strcpy(CH01_NUM_SEGS,SQL_NUM_SEGS.arr);
    CH01_NUM_SEGS[SQL_NUM_SEGS.len]='\0';
    AC01_TRAMA=(char *)malloc(atol(SQL_NUM_SEGS.arr) * INT02_TAM_SEG);
    sprintf(AC01_TRAMA,"%s|%s|\0", CHA01_NOMBRE_APP, CH01_NUM_SEGS);
    EXEC SQL DECLARE CUR_EMISORA CURSOR FOR
    SELECT rtrim(to_char(NUM_EMISORA)) || '|' || rtrim(SERIE) || '|' || EMISORA || '|' || STATUS FROM NUCL_EMISORA WHERE STATUS NOT LIKE 'BAJA';
    EXEC SQL OPEN CUR_EMISORA;
    LO01_STATUS = sqlca.sqlcode;
    if( !LO01_STATUS ) /*si todo sali� bien*/
    do
    EXEC SQL FETCH CUR_EMISORA INTO :SQL_RESULT;
    LO01_STATUS = sqlca.sqlcode;/*Recuperamos el estado de la operacion fetch*/
    if( !LO01_STATUS )
    AC02_SEG=(char *)malloc(SQL_RESULT.len);
    strcpy(AC02_SEG,SQL_RESULT.arr);
    AC02_SEG[SQL_RESULT.len]='\0';
    strcat(AC01_TRAMA,AC02_SEG);
    strcat(AC01_TRAMA,CHA02_FIN_DE_SEG);
    }/*if fetch correcto*/
    else
    LO01_STATUS=1;
    }while(!LO01_STATUS);
    EXEC SQL CLOSE CUR_EMISORA;/*Cerramos el cursor*/
    Si no se recuperaron registros, se indicara en el numero de segmentos
    al inicio de la trama.
    }/*if open cursor*/
    }/*if conteo*/
    puts(AC01_TRAMA);
    return ( (env)->NewStringUTF(AC01_TRAMA) );
    }/*consulta_general*/
    Java programs
    public class Monitor
    public native String consultaGeneral();
    static
    System.load("/afs/invermexico.com.mx/usr2/salponce/gustavo/jni/src_db/Monitor.so");
    public String getTrama()
         String strTrama=consultaGeneral();
    return strTrama;
    public static void main(String []args)
    String strEmisora, strNumEmisora, strStatus,strSerie;
    Monitor m=new Monitor();
    System.out.println(m.getTrama());
    /*java.util.StringTokenizer STk = new java.util.StringTokenizer(m.getTrama(),"|");
    while(objSTk.hasMoreTokens())     
    strEmisora = objSTk.nextToken();
    strNumEmisora = objSTk.nextToken();
    strStatus = objSTk.nextToken();
    strSerie = objSTk.nextToken();
    System.out.println("\n<------>\n"+ strEmisora+"\n"+strNumEmisora+"\n"+strStatus+"\n"+strSerie);
    }//while
    Thank's

  • Use special string as key of DES

    I want to use a special string as key of DES.
    I f I want to use a string which length is more than 8 as key,what should I do?
    Thanks

    Although DES has been designed for using keys composed of eight 7-bit ASCII characters with parity (i.e., plain-text passwords), you do not need to use such "weak" keys. Common passwords have almost no "entropy" (i.e., random information); so you must not use passwords directly in any algorithm (DES, AES, RC4 etc.).
    Remember - keys are not passwords; keys can be derived from passwords. Cryptographic algorithms usually use keys, not passwords.
    The PBE algorithm (Password-Based Encryption) use passwords for encrypting, but do not use the passwords directly. It calculates a special function than derives a key from a password.
    Study the PBE algorithm instead of trying to use the password as a key directly.
    I will give an example to make you understand the problem better.
    There is a class of functions called "cryptographic hashes" that works "digesting" the bytes you pass to it.
    They receive any quantity of bytes as input, and return a fixed-size result (160 bits = 20 bytes for SHA-1, 128 bits = 16 bytes for MD5).
    Examples of cryptographic hash are the MD5 and SHA-1 functions.
    I will give several words that are very near in spelling, but their hashes are completely different.
    The SHA-1 of "password" is 5BAA61E4 C9B93F3F 0682250B 6CF8331B 7EE68FD8
    The SHA-1 of "passwords" is A267F7DB A707256B 0B664DEE 86AB9AE8 B4941218
    The SHA-1 of "passwort" is 2E2B6533 A81BC154 30CF65DE 46DC097E EB5BA70C
    The SHA-1 of "Password" is 8BE3C943 B1609FFF BFC51AAD 666D0A04 ADF83C9D
    If you modify a byte in the content, the value is completely altered. You can see that the SHA-1 of "password" and "Password" are completely different.
    The "naive" way of deriving a key from a password is simply to calculate the SHA-1 of the password, throwing out the unneeded bits (for instance, if you use DES, you can use only the first 8 bytes - 64 bits of the SHA-1 value.)
    The PBE algorithm uses a more sofisticated and secure scheme but the inspiration is that you can derive a key from a password, and use the key to encrypt your data.

  • I am fed up with Spring and Apple passing me off to one another and neither will fix the problem. I am unable to receive a connection on my phone.

    I am fed up with Spring and Apple passing me off to one another and neither will fix the problem. I am unable to receive a connection on my phone.
    The internet goes out and I have to reset network setting each and every time. This is only a temporary solution which by the time I release the line with Spring or leave the apple store the issue is back. Sprint indicates that it is a know issue with the Iphone 5 and apple says it is a network issue as Sprint's network is not up to par with the Iphone and can not meet the expectations on the Iphone 5.
    I have attached a few picture, as you can see it clearly says I have 5 bars and 3g available but I have no connections what so ever.
    This issue affects all data and so I can not send or receive picture messages, use apps, or access the internet. The data goes in and out intermittently and it seems the phone chooses what I can and can't do.
    For example I can watch Youtube or Vevo videos but I can not access Facebook or Instagram.
    Is anyone else having this issue?
    I will soon loose my patience....
    I have reset my phone three time and have reset network and other setting mutltiple times.

  • Huge problem using apple mail while sending email to a group...

    Hey - I am quite confused... apple mail has huge problems using groups with about 150 addresses when writing and sending an email... the writing of emails is nearly impossible. Once the group name is inserted in the addressline (address book in iCloud!), apple mail uses nearly 100% CPU and further writing is nearly impossible. When sending such an email, all addresses are suddenly visible - though the box is NOT checked and the addresses should be hidden... what can I do? I use this feature (sending mails to groups) on a daily basis and cannot accept visible addresses...
    Greetings and sorry for inconvenient english...
    Christof

    How about next time you send to the group, cc yourself, or include yourself in the group. Then receive the email on the iphone, you can "reply all" in order to send to the group. If you use an imap account, you can make a new folder, call it something like "groups", and save different group emails there for the next time you need to "reply all".

Maybe you are looking for

  • Agent mapping & credit block Issue

    hi friends , Client Issue : inter linking issue 1) Agent should assign to partner function(sold to party ) & should trigger the agent commission automatically in pricing procedure which should not include in basic price . 2)  If one customer is not s

  • What's the best spyware/antivirus software for Macbook Pros?

    I have a job that requires some protection from spyware or viruses which I should already have, but never took the time.  Any suggestions?

  • Getting dump like LIST_TOO_MANY_LPROS

    Hi Friends, I have created a Dialogue program with 6 subscreens with 3 normal screens. after doing some processing from Subscreen and to navigate to other screens , I am using Call screen. The leave to screen XXX is throwing error. If i use call scre

  • Shared outlook calendar

    Hello, For business I use a couple of shared calendars on outlook.  I can't work out how to see these on my iphone 3Gs. Any advice on how to view shared calendars from outlook 2007 please? Many thanks Kirsten

  • Acrobat XI crashes when reading/copying from sticky note.

    has anyone else had an issue with reading or coping text from sticky note. amendements are higlighted using the sticky note. it would be great to know as I've gone back to using 9. thanks