Method Chaining

Hi all,
I have these method chaining:
boolean b = Services.getInstance().getEntitleReferenceService().getUser(username) != null;
As I understood, I have to follow the method chain from right to left, right?
Services.getInstance()> returns an object of type: Services
On the Services object, I call the method: getEntitleReferenceService()
this method returns an object of type: EntitlementsReferenceService which is object of type interface: EntitlementsReferenceService
The only class that implements that interface is: RemoteEntitleReferenceService.java
In RemoteEntitleReferenceService.java, I have the method: getUser(String userID)
The point is that the method: getUser() does NOT return boolean as expected!
This is the method signature:
public User getUser(final String userId){}
I have this part of code in Intellij and it does not show an error as it usually does when these kind of error happens.
Does anybody has any idea that where am I making a mistake? Any help is greatly appreciated.

The point is that the method: getUser() does NOT return boolean as expected! Nobody expects it to. It'll return a reference, which will be evaluated against null, and the reult of that gets assigned to the boolean.

Similar Messages

  • Somebody explain me method chaining.

    Hi.
    I'm looking for somebody to give me an explanation of how does Method Chaining (I think this is how it's called) work.
    i.e:
    myObject.setPrice(2)
    .setQuantity(10)
    .solveLifeProblems()
    .setAvailavility(true);
    Where's the theory about this?
    Can I do this with every class?
    What requisites are needed so that I can use this technique with my classes?
    What if the method, say solveLifeProblems() returns somethin strange (such as an boolean or another object)?
    Thanks.

    All you're doing is invoking a method on the return value of another method. All solveLiveProblems() has to do is return a class with a method called setAvailability.
    Sodog()
    .cat()
    .monkey();is the same as
    dog().cat().monkey();which is the same as (for example)
    Hammer hammer = dog();
    Screwdriver sd = hammer.cat();
    sd.monkey();I'd advise not formatting your code like this until you have more experience.

  • Method chaining and casting

    I was wondering if anyone knows whether it is possible to somehow apply method chaining on an object that requires a cast.
    For example:
    ArrayList ar = new ArrayList();
    ar.add(new Integer(3));
    int i = ar.get(0).intValue();The third line obviously produces a compile error to the effect that you can't call method intValue() on object Object.
    To get the int value from the ArrayList above I have to do the following:
    ArrayList ar = new ArrayList();
    ar.add(new Integer(3));
    Integer intObject = (Integer)ar.get(0);
    int i = intObject.intValue();Is it at all possible to get the int value somehow without explicitly creating an Integer object? Is there a possible way to combine method chaining and casting in this case?

    You may combine the two lines by casting at the same time:
    int i = ((Integer)ar.get(0)).intValue();
    Notice the additional brackets to help the compiler understand the precedence of your intentions. It makes no sense if the compile tries to call intValue THEN cast to Integer.
    When you call:
    Integer intObject = (Integer)ar.get(0);
    No Integer object is created, only a reference to the object is created. I'm not sure if an implicit reference is created in the previous example, but I see no substantial benefit using the first method. In fact I won't use it as its not very readable (to me).

  • Method Chaining - Benefit?

    Hiii...
    I have read about Method Chaining like
    obj.method1().method2().method3();
    Its easy for development like you are concatinating 3 calls into 1, but I want to know whether its improving perfromance something or not?
    Thanks..

    endasil wrote:
    georgemc wrote:
    String url = new StringBuilder("file://")
    .append(baseUrl).append(File.separator)
    .append(resourceDir).append(File.separator)
    .append(resourceName)
    .append(extension).toString();Now you can just read down the "right-hand column" and see what the url string is composed of.Forgive my ignorance, but how is that example better than
    String url = "file://" +
    baseURL + File.separator +
    resourceDir + File.separator +
    resourceName +
    extension;I don't mean to attack an example whose purpose was something different (it correctly showed why chain methods), but I just thought I'd ask. It seems to me like using a StringBuilder really only has benefit if you're going to be building the string dynamically/not all in one statement. Otherwise just using String concatenation seems cleaner.:sigh: I'm not being side-tracked here. By your own admission, the example was to demonstrate method chaining.

  • ABAP OO: methods as method params, method chains

    Hello all,
    I am currently developing quite much ABAP OO and wonder if this is possible, because I got compilation errors.
    a) Methods as method params w/o temp vars:
    I have a method whose parameter shall be the return value (let s say a string) shall be the parameter:
    document->set_owner( owner = person->get_name( ) ).
    This throws an error and I have to code this instead
    data: owner type String.
    ownerString = person->get_owner( ).
    document->set_owner( owner = ownerString ).
    ... so I have always a temp variable which is getting MUCH overhead when having such stuff often...
    Am I doing wrong or is this impossible in ABAP OO? ...am used to do such things in all other languages I know... mean, that methods can be params of other methods.
    b) "chaining of methods"
    Is this possible somehow?:
    data: tmp type String.
    tmp = employee->get_orgUnit( )->get_name( ).
    Calling one level (the get_OrgUnit() method) works fine, but an immediate call to the second level ( get_name() method) fails and I have to code this:
    data: tmp     type String,
          orgUnit type ZOrgUnit.
    orgUnit = employee->get_orgUnit( ).
    tmp = orgUnit->get_name( ).
    This also very annoying to have so much temporary help variables on the way.
    Is there any help for me?
    Thank you for any hints and reagrds,
    Timo

    Hi Timo,
    as Richard's reply says it's impossible in ABAP-OO. The nature of this language is ABAP not OO
    Only helpful for you, could be the returning parameter. It's very useful in conditional expressions like
    if m1->a() = '2'.
    A preferred parameter to avoid writing parameter names like
    m1->b( '2' ).
    All other useful stuff of method or parameter chaining, and so on is NOT possible. Sorry.

  • How to determine the Servlet which current request is mapped to

    Hello folks,
    having a filter, i want to discover the servlet (if any) which will serve the current request. I want to have it before the chain execution. Does someone has an idea how to accomplish this using Servlet API? The old API provided the getServlet(String name) method for this task. Here the sample code:
    Servlet servingInstance = discoverServlerForRequest(request); //i look for implementation of this method
    chain.doFilter(request,response);I know that it would be very easy to get the servlet AFTER processing the chain, but the clue for me is to get it before.
    Maybe Tomcat has implemented some special servlet context attributes to map it?
    any hint appreciated!
    thanks

    its possible, for sure. but then I need two filters to achieve it. I'll post my solution later, if there wont be any other ideas. I know that tomcat maps many objects by attributes...maybe there is a key for it.

  • Segmentation Fault

    Hi-
    I've experienced a segmentation fault from Berkeley DB XML Java bindings running in a web application (Tomcat). I'm not able to reproduce the error myself, but it's particularly troubling becasue it brought down the entire JVM that was running the web site. I'm not at all proficient with JNI, so maybe I'm not able to properly diagnose the problem from the logs. Below is the seg fault error that was logged by the JVM:
    # An unexpected error has been detected by Java Runtime Environment:
    #  SIGSEGV (0xb) at pc=0x063966c3, pid=20961, tid=1839516576
    # Java VM: Java HotSpot(TM) Server VM (11.3-b02 mixed mode linux-x86)
    # Problematic frame:
    # V  [libjvm.so+0x3966c3]
    # If you would like to submit a bug report, please visit:
    #   http://java.sun.com/webapps/bugreport/crash.jsp
    ---------------  T H R E A D  ---------------
    Current thread (0x08822c00):  JavaThread "http-8080-6" daemon [_thread_in_vm, id=21027, stack(0x6da2c000,0x6da4d000)]
    siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x00000000
    Registers:
    EAX=0x00000000, EBX=0x08b598d8, ECX=0x0006da4b, EDX=0x08822c00
    ESP=0x6da4b6d4, EBP=0x6da4b738, ESI=0x00000ffc, EDI=0x6db77880
    EIP=0x063966c3, CR2=0x00000000, EFLAGS=0x00010216
    Top of Stack: (sp=0x6da4b6d4)
    0x6da4b6d4:   00000000 67c9ecf8 67c9ece3 08b598d8
    0x6da4b6e4:   6db77880 6db77888 6db77c74 08822c00
    0x6da4b6f4:   00000000 00c5a1e3 6da4b718 08822c00
    0x6da4b704:   6e000048 00000011 67d0b11c 08822c00
    0x6da4b714:   0000001d 6da4b738 67c92fa4 08822d14
    0x6da4b724:   08a64cb4 08c4cddc 67d0b11c 00000000
    0x6da4b734:   0000001d 6da4b7f8 67c732db 08822d14
    0x6da4b744:   00000000 00000000 67c9ece3 6da4b7d0
    Instructions: (pc=0x063966c3)
    0x063966b3:   ac 8b 43 08 89 45 b0 8b 43 0c 89 45 b4 8b 45 0c
    0x063966c3:   8b 00 50 e8 35 02 fe ff 83 ec 0c 89 c6 50 e8 72
    Stack: [0x6da2c000,0x6da4d000],  sp=0x6da4b6d4,  free space=125k
    Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
    V  [libjvm.so+0x3966c3]
    C  [libdbxml_java-2.4.so+0x2612db]  _Z17createCPPXmlValueP7JNIEnv_P8_jobjectPb+0xd3
    C  [libdbxml_java-2.4.so+0x26bbcd]  _Z24createCPPXmlQueryContextP7JNIEnv_P8_jobjectP7_jclass+0x969
    C  [libdbxml_java-2.4.so+0x27f2ff]  Java_com_sleepycat_dbxml_dbxml_1javaJNI_XmlManager_1prepare_1_1SWIG_10+0xe7
    j  com.sleepycat.dbxml.dbxml_javaJNI.XmlManager_prepare__SWIG_0(JLcom/sleepycat/dbxml/XmlManager;Ljava/lang/String;Lcom/sleepycat/dbxml/XmlQueryContext;)J+0
    j  com.sleepycat.dbxml.XmlManager.prepare(Ljava/lang/String;Lcom/sleepycat/dbxml/XmlQueryContext;)Lcom/sleepycat/dbxml/XmlQueryExpression;+7
    j  com.mycompany.dao.xml.XmlDao.executeQuery(Ljava/lang/String;Lcom/sleepycat/dbxml/XmlQueryContext;)Ljava/util/List;+14
    j  com.mycompany.dao.xml.XMLArticleDAO.getArticleId(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;+91
    j  com.mycompany.service.impl.DefaultArticleService.getArticleIdFromUrl(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;+7
    j  com.mycompany.controller.Level3Controller.handleRequestInternal(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)Lorg/springframework/web/servlet/ModelAndView;+236
    j  org.springframework.web.servlet.mvc.AbstractController.handleRequest(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)Lorg/springframework/web/servlet/ModelAndView;+62
    j  org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;Ljava/lang/Object;)Lorg/springframework/web/servlet/ModelAndView;+6
    j  org.springframework.web.servlet.DispatcherServlet.doDispatch(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V+224
    j  org.springframework.web.servlet.DispatcherServlet.doService(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V+219
    j  org.springframework.web.servlet.FrameworkServlet.processRequest(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V+10
    j  org.springframework.web.servlet.FrameworkServlet.doGet(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V+3
    j  javax.servlet.http.HttpServlet.service(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V+35
    j  javax.servlet.http.HttpServlet.service(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V+30
    j  org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V+374
    j  org.apache.catalina.core.ApplicationFilterChain.doFilter(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V+101
    j  org.apache.catalina.core.StandardWrapperValve.invoke(Lorg/apache/catalina/connector/Request;Lorg/apache/catalina/connector/Response;)V+804
    j  org.apache.catalina.core.StandardContextValve.invoke(Lorg/apache/catalina/connector/Request;Lorg/apache/catalina/connector/Response;)V+365
    j  org.apache.catalina.core.StandardHostValve.invoke(Lorg/apache/catalina/connector/Request;Lorg/apache/catalina/connector/Response;)V+64
    j  org.apache.catalina.valves.ErrorReportValve.invoke(Lorg/apache/catalina/connector/Request;Lorg/apache/catalina/connector/Response;)V+6
    j  org.apache.catalina.core.StandardEngineValve.invoke(Lorg/apache/catalina/connector/Request;Lorg/apache/catalina/connector/Response;)V+42
    j  org.apache.catalina.connector.CoyoteAdapter.service(Lorg/apache/coyote/Request;Lorg/apache/coyote/Response;)V+157
    j  org.apache.coyote.http11.Http11Processor.process(Ljava/net/Socket;)V+432
    j  org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Ljava/net/Socket;)Z+82
    j  org.apache.tomcat.util.net.JIoEndpoint$Worker.run()V+41
    j  java.lang.Thread.run()V+11
    v  ~StubRoutines::call_stub
    V  [libjvm.so+0x375c9d]
    V  [libjvm.so+0x5057f8]
    V  [libjvm.so+0x3755b0]
    V  [libjvm.so+0x37563d]
    V  [libjvm.so+0x3e5ca5]
    V  [libjvm.so+0x5cde5d]
    V  [libjvm.so+0x506929]
    C  [libpthread.so.0+0x53cc]
    Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
    j  com.sleepycat.dbxml.dbxml_javaJNI.XmlManager_prepare__SWIG_0(JLcom/sleepycat/dbxml/XmlManager;Ljava/lang/String;Lcom/sleepycat/dbxml/XmlQueryContext;)J+0
    j  com.sleepycat.dbxml.XmlManager.prepare(Ljava/lang/String;Lcom/sleepycat/dbxml/XmlQueryContext;)Lcom/sleepycat/dbxml/XmlQueryExpression;+7
    j  com.mycompany.dao.xml.XmlDao.executeQuery(Ljava/lang/String;Lcom/sleepycat/dbxml/XmlQueryContext;)Ljava/util/List;+14
    j  com.mycompany.dao.xml.XMLArticleDAO.getArticleId(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;+91
    j  com.mycompany.service.impl.DefaultArticleService.getArticleIdFromUrl(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;+7
    j  com.mycompany.controller.Level3Controller.handleRequestInternal(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)Lorg/springframework/web/servlet/ModelAndView;+236
    j  org.springframework.web.servlet.mvc.AbstractController.handleRequest(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)Lorg/springframework/web/servlet/ModelAndView;+62
    j  org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;Ljava/lang/Object;)Lorg/springframework/web/servlet/ModelAndView;+6
    j  org.springframework.web.servlet.DispatcherServlet.doDispatch(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V+224
    j  org.springframework.web.servlet.DispatcherServlet.doService(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V+219
    j  org.springframework.web.servlet.FrameworkServlet.processRequest(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V+10
    j  org.springframework.web.servlet.FrameworkServlet.doGet(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V+3
    j  javax.servlet.http.HttpServlet.service(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V+35
    j  javax.servlet.http.HttpServlet.service(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V+30
    j  org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V+374
    j  org.apache.catalina.core.ApplicationFilterChain.doFilter(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V+101
    j  org.apache.catalina.core.StandardWrapperValve.invoke(Lorg/apache/catalina/connector/Request;Lorg/apache/catalina/connector/Response;)V+804
    j  org.apache.catalina.core.StandardContextValve.invoke(Lorg/apache/catalina/connector/Request;Lorg/apache/catalina/connector/Response;)V+365
    j  org.apache.catalina.core.StandardHostValve.invoke(Lorg/apache/catalina/connector/Request;Lorg/apache/catalina/connector/Response;)V+64
    j  org.apache.catalina.valves.ErrorReportValve.invoke(Lorg/apache/catalina/connector/Request;Lorg/apache/catalina/connector/Response;)V+6
    j  org.apache.catalina.core.StandardEngineValve.invoke(Lorg/apache/catalina/connector/Request;Lorg/apache/catalina/connector/Response;)V+42
    j  org.apache.catalina.connector.CoyoteAdapter.service(Lorg/apache/coyote/Request;Lorg/apache/coyote/Response;)V+157
    j  org.apache.coyote.http11.Http11Processor.process(Ljava/net/Socket;)V+432
    j  org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Ljava/net/Socket;)Z+82
    j  org.apache.tomcat.util.net.JIoEndpoint$Worker.run()V+41
    j  java.lang.Thread.run()V+11
    v  ~StubRoutines::call_stub
    ---------------  P R O C E S S  ---------------
    Java Threads: ( => current thread )
      0x088d4800 JavaThread "http-8080-8" daemon [_thread_blocked, id=21029, stack(0x66e7d000,0x66e9e000)]
      0x08b3d400 JavaThread "http-8080-7" daemon [_thread_blocked, id=21028, stack(0x6da0b000,0x6da2c000)]
    =>0x08822c00 JavaThread "http-8080-6" daemon [_thread_in_vm, id=21027, stack(0x6da2c000,0x6da4d000)]
      0x08823400 JavaThread "http-8080-5" daemon [_thread_blocked, id=21022, stack(0x65cdf000,0x65d00000)]
      0x0881e000 JavaThread "http-8080-4" daemon [_thread_blocked, id=21019, stack(0x6da4d000,0x6da6e000)]
      0x08d75400 JavaThread "pool-2-thread-1" [_thread_blocked, id=21018, stack(0x660df000,0x66100000)]
      0x08976400 JavaThread "http-8080-3" daemon [_thread_blocked, id=21017, stack(0x6da6e000,0x6da8f000)]
      0x08976000 JavaThread "http-8080-2" daemon [_thread_blocked, id=21011, stack(0x6da8f000,0x6dab0000)]
      0x08c4c000 JavaThread "http-8080-1" daemon [_thread_blocked, id=21006, stack(0x6dd9d000,0x6ddbe000)]
      0x08b65000 JavaThread "TP-Monitor" daemon [_thread_blocked, id=21005, stack(0x6ddbe000,0x6dddf000)]
      0x08c5ec00 JavaThread "TP-Processor4" daemon [_thread_in_native, id=21004, stack(0x6dddf000,0x6de00000)]
      0x08c62c00 JavaThread "TP-Processor3" daemon [_thread_blocked, id=21003, stack(0x6df41000,0x6df62000)]
      0x08b66800 JavaThread "TP-Processor2" daemon [_thread_blocked, id=21002, stack(0x6df62000,0x6df83000)]
      0x08eab000 JavaThread "TP-Processor1" daemon [_thread_blocked, id=21001, stack(0x6df83000,0x6dfa4000)]
      0x08c53800 JavaThread "http-8080-Acceptor-0" daemon [_thread_in_native, id=21000, stack(0x6dfa4000,0x6dfc5000)]
      0x08c5d000 JavaThread "ContainerBackgroundProcessor[StandardEngine[Catalina]]" daemon [_thread_blocked, id=20999, stack(0x6df1c000,0x6df3d000)]
      0x08c9e400 JavaThread "pool-1-thread-1" [_thread_blocked, id=20998, stack(0x66ea5000,0x66ec6000)]
      0x08684800 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=20996, stack(0x6e1e0000,0x6e201000)]
      0x08683000 JavaThread "CompilerThread1" daemon [_thread_blocked, id=20995, stack(0x6e201000,0x6e282000)]
      0x0867e800 JavaThread "CompilerThread0" daemon [_thread_blocked, id=20994, stack(0x6e282000,0x6e303000)]
      0x0867d000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=20993, stack(0x6e303000,0x6e324000)]
      0x0867b800 JavaThread "Surrogate Locker Thread (CMS)" daemon [_thread_blocked, id=20992, stack(0x6e324000,0x6e345000)]
      0x08668000 JavaThread "Finalizer" daemon [_thread_blocked, id=20991, stack(0x6e545000,0x6e566000)]
      0x08666c00 JavaThread "Reference Handler" daemon [_thread_blocked, id=20990, stack(0x6e566000,0x6e587000)]
      0x08058800 JavaThread "main" [_thread_in_native, id=20962, stack(0xb7fc9000,0xb7fea000)]
    Other Threads:
      0x08663400 VMThread [stack: 0x6e587000,0x6e608000] [id=20989]
      0x08686800 WatcherThread [stack: 0x6e15f000,0x6e1e0000] [id=20997]
    VM state:not at safepoint (normal execution)
    VM Mutex/Monitor currently owned by a thread: None
    Heap
    par new generation   total 471872K, used 261897K [0x70490000, 0x90490000, 0x90490000)
      eden space 419456K,  60% used [0x70490000, 0x7fb7eb48, 0x89e30000)
      from space 52416K,  17% used [0x89e30000, 0x8a703c70, 0x8d160000)
      to   space 52416K,   0% used [0x8d160000, 0x8d160000, 0x90490000)
    concurrent mark-sweep generation total 524288K, used 0K [0x90490000, 0xb0490000, 0xb0490000)
    concurrent-mark-sweep perm gen total 22400K, used 22275K [0xb0490000, 0xb1a70000, 0xb4490000)
    ***DYNAMIC LIBRARIES TRUNCATED (POST TOO LONG)***
    VM Arguments:
    jvm_args: -Xmx1024m -Xms1024m -Xmn512m -Xss128k
    -XX:ParallelGCThreads=20 -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:SurvivorRatio=8
    -XX:TargetSurvivorRatio=90 -XX:MaxTenuringThreshold=31 -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
    -Djava.util.logging.config.file=/opt/apps/tomcat-6.0.18/conf/logging.properties -Djava.endorsed.dirs=/opt/apps/tomcat-6.0.18/endorsed
    -Dcatalina.base=/opt/apps/tomcat-6.0.18 -Dcatalina.home=/opt/apps/tomcat-6.0.18 -Djava.io.tmpdir=/opt/apps/tomcat-6.0.18/temp
    java_command: org.apache.catalina.startup.Bootstrap start
    Launcher Type: SUN_STANDARD
    Environment Variables:
    PATH=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/opt/apps/php/bin:/opt/apps/apache2/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin
    LD_LIBRARY_PATH=/usr/java/jdk1.6.0_13/jre/lib/i386/server:/usr/java/jdk1.6.0_13/jre/lib/i386:/usr/java/jdk1.6.0_13/jre/../lib/i386:/opt/dbxml/lib
    SHELL=/bin/bash
    Signal Handlers:
    SIGSEGV: [libjvm.so+0x6071f0], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
    SIGBUS: [libjvm.so+0x6071f0], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
    SIGFPE: [libjvm.so+0x5048b0], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
    SIGPIPE: [libjvm.so+0x5048b0], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
    SIGXFSZ: [libjvm.so+0x5048b0], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
    SIGILL: [libjvm.so+0x5048b0], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
    SIGUSR1: SIG_DFL, sa_mask[0]=0x00000000, sa_flags=0x00000000
    SIGUSR2: [libjvm.so+0x506d80], sa_mask[0]=0x00000000, sa_flags=0x10000004
    SIGHUP: [libjvm.so+0x506b20], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
    SIGINT: SIG_IGN, sa_mask[0]=0x00000000, sa_flags=0x00000000
    SIGTERM: [libjvm.so+0x506b20], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
    SIGQUIT: [libjvm.so+0x506b20], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
    ---------------  S Y S T E M  ---------------
    OS:Red Hat Enterprise Linux ES release 4 (Nahant Update 8)
    uname:Linux 2.6.9-89.ELsmp #1 SMP Mon Apr 20 10:34:33 EDT 2009 i686
    libc:glibc 2.3.4 NPTL 2.3.4
    rlimit: STACK 10240k, CORE 0k, NPROC 32742, NOFILE 1024, AS infinity
    load average:0.00 0.00 0.00
    CPU:total 4 (4 cores per cpu, 1 threads per core) family 6 model 15 stepping 11, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3
    Memory: 4k page, physical 2073300k(27792k free), swap 5197384k(1995648k free)
    vm_info: Java HotSpot(TM) Server VM (11.3-b02) for linux-x86 JRE (1.6.0_13-b03), built on Mar  9 2009 01:16:42 by "java_re" with gcc 3.2.1-7a (J2SE release)
    time: Mon Jul  27 01:51:01 2009
    elapsed time: 11252 secondsI see some "thread blocked" statements, one of them being on the "Low Memory Detector" daemon. Not sure what to make of that.
    This is the method chain (from what I can tell) that caused the error:
    public String getArticleId(String type, String category, String normalizedTitle)
              throws DAOException, DataNotFoundDAOException {
              XmlQueryContext context = null;
              try{
                   context = this.getXmlManager().createQueryContext();
                   context.setEvaluationType(context.Eager);
                   context.setVariableValue("type", new XmlValue(type));
                   context.setVariableValue("category", new XmlValue(category));
                   context.setVariableValue("normalizedTitle", new XmlValue(normalizedTitle));
                   context.setVariableValue("containerName", new XmlValue(this.getContainer().getName()));
                   List<String> results = executeQuery(articleIdQuery, context);
                   if(results.size()>1){
                        logger.warn(String.format("more than one article found for type:%s, category:%s, normalized-title:%s", type, category, normalizedTitle));
                   }else if(results.size()==0){
                        throw new DataNotFoundDAOException(String.format("unable to find an article that matches type:%s, category:%s, normalized-title:%s", type, category, normalizedTitle));
                   /* dbxml returns query values far xml attributes in this format: {}id="this_is_the_id_we_want"
                    * we must extract the id before returning
                   String idString = results.get(0);
                   return idString.substring(idString.indexOf("\"")+1, idString.length()-1);
              }catch (XmlException e) {
                   throw new DAOException("there was a problem querying the database", e);
              } finally{
                   context.delete();
         protected List<String> executeQuery(String query, XmlQueryContext context)
                   throws DAOException {
              // Prepare (compile) the query
              List<String> xmlNodes = new ArrayList<String>();
              XmlQueryExpression qe = null;
              XmlResults results = null;
              try {
                   qe = xmlManager.prepare(query, context);
                   logger.debug("about to perform query: " + qe.getQuery());
                   results = qe.execute(context);
                   while (results.hasNext()) {
                        xmlNodes.add(results.next().asString());
              } catch (XmlException e) {
                   throw new DAOException("Unable to retrieve Page from db", e);
              } finally{
                   if(results != null){
                        results.delete();
                   if(qe != null){
                        qe.delete();
              return xmlNodes;
         }And this is the query that was passed into the method:
    collection($containerName)/article[type=$type and category=$category and normalized-title=$normalizedTitle]/@idSince this happened in a running web application, I unfortunately can't determine exactly which values were set for the query variables in this instance. However, by the nature of this application, those values are NOT taken from user input, so it would be safe to assume that the input comes from a valid, finite set of values.
    Any help would be greatly appreciated.
    Thanks
    Edited by: eric44 on Jul 27, 2009 2:34 PM

    Thanks Lauren.
    I have not yet applied the patch. I will do so shortly. However, I was able to do a bit more tracing, and I think I've gotten to the root of the problem. The seg fault is happening when a null value is used in a query. That is, a Java variable whose value is null is used as the constructor argument to new XmlValue(String s), and then that value is used in the query. I don't know exactly where the error is happening; the log seems a tad ambiguous. Again, I'm not really comfortable at the low-level, but it seems that the stack trace is rooted in the "prepare" java method, but then there seems to be some native trace directly referencing the creation of XmlValue
    Stack: [0x6da2c000,0x6da4d000],  sp=0x6da4b6d4,  free space=125k
    Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
    V  [libjvm.so+0x3966c3]
    C  [libdbxml_java-2.4.so+0x2612db]  _Z17createCPPXmlValueP7JNIEnv_P8_jobjectPb+0xd3
    C  [libdbxml_java-2.4.so+0x26bbcd]  _Z24createCPPXmlQueryContextP7JNIEnv_P8_jobjectP7_jclass+0x969
    C  [libdbxml_java-2.4.so+0x27f2ff]  Java_com_sleepycat_dbxml_dbxml_1javaJNI_XmlManager_1prepare_1_1SWIG_10+0xe7
    j  com.sleepycat.dbxml.dbxml_javaJNI.XmlManager_prepare__SWIG_0(JLcom/sleepycat/dbxml/XmlManager;Ljava/lang/String;Lcom/sleepycat/dbxml/XmlQueryContext;)J+0
    j  com.sleepycat.dbxml.XmlManager.prepare(Ljava/lang/String;Lcom/sleepycat/dbxml/XmlQueryContext;)Lcom/sleepycat/dbxml/XmlQueryExpression;+7thanks again

  • Wht is call chaning?

    hi,
    wht is call chaning?
    is this work's in java
    sum(sum(sum(2)));

    Please use code tags next time. Either use the button labelled code, above the textarea while posting or manually wrap your code in code tags like this:
    {code}
    //Your code here
    {code}
    to have it formatted like this:
        //Your code hereChaining basically allows you to call a method on the object returned by another method call without needing to use a reference variable. For example, you can write:
    String testString = "  My String  ";
    String testString2 = testString.trim(); //returns "My String";
    String testString3 = testString2.toUpperCase(); //returns "MY STRING";
    String finalString = testString3;As you can see, testString2 and testString3 are not being used beyond these three statements; we actually only want testString and finalString.
    The same thing can be written using method chaining as:
    String testString = "  My String  ";
    String finalString = testString.trim().toUpperCase();                            And this will only work for methods that return an object. If the method call returns a primitive or nothing ( signature has void ), then you obviously can't call anything on that.
    That's why your code fails to compile:
    hum ref=new hum();
    ref.sum(5).sum(5);sum() returns nothing. If you modified it to return int, that also would not work since it's a primitive. If you returned Integer, you could probably call a method on that. But not sum() since sum() isn't defined in Integer.
    And no, it's not the same as concatenation. That's something to do with strings.
    Edited by: nogoodatcoding on Oct 30, 2007 12:49 PM

  • Introducing JavaStates - a new API for state based GUI development in Swing

    JavaStates partially implements the semantics of D Harel' statecharts.
    It is currently hosted as source forge project:
    [https://sourceforge.net/projects/javastates/]
    , and has been used for several years for teaching Java Swing and the specification of man machine interfaces at ESIL
    [http://www.esil.univmed.fr]
    [http://laurent.henocque.com]
    The project provides several demos, including a full fledged swing text editor, and is stable.
    Details can be found here too:
    [http://javastates.posterous.com/]
    I'd be very happy to interact with both experts and users.
    I claim that Javastates tremendously improve the quality and speed of GUI development.
    Do you agree?
    Edited by: lhenocque on Mar 4, 2010 4:18 AM

    Thanks for the good practise hint, and many more thanks for your interest.
    I haven't tried anything but don't you get an explosion of states?
    explosion of states is controlled by concurrent regions. Two states in two concurrent regions can be active at the same time.
    There can be no 'explosion' anyway since the states are programmer declared. The list is finite, and under control.
    For example the program I'm working on has a table and actions are enabled based on:
    -no selection/single selection/multi selection
    -top/bottom row selected (move up/down action)
    -user read/write permission
    -properties of the object of the selected row
    The situation you describe is handled by (at least) four concurrent regions.
    The typical error is usually forgetting a particular one which result in action being enabled/disabled when the shouldn't. Currently solving that by having a callback method which enables all the action correctly and gets called whenever there is a selection/security/etc update.
    Javastates cares for both setting the properties of the states (including the callbacks to fire) and for the cleanup. Using this allows for defect free interfaces in the sense that nothing can be left over.
    Using Javastates helps you to separate your logic in the same way as object programming with virtual functions does. You should end up replacing a code with many if/thens by separate listeners, dynamically set by callbacks.
    Also fluent interface method chaining is nice until it becomes a flood in my opinion - similar to how GroupLayout is better handled by Matisse GUI builder than by hand, JavaStates might benefit more from a graphical tool.
    You are right. Both apis exist. The fluent api is provided for simplicity, since it prevents from declaring useless local variables.
    Also for a GUI builder. I created the foundation of Javastates for an interpreted language called WIZ in the IDE Openside around 1990 (that was in C).
    Then later I implemented a subset of the current Java features in C++, that were interfaced in the GUI Builder called ILOG Views.
    So yes I agree a GUI can help, but anyway the Java code resulting from using states is mare more concise and structured than it would otherwise.

  • NumberFormat.getCurrencyInstance(Locale l) does not work

    Hi everybody!
    I got stuck on very simple thing. I'm working on jdk 1.3. For some reason I can't use 1.4 currently. Anyway it should not matter.
    I have small class for converting numeric (just integral very simple strings from flat database):
    import java.text.*;
    import java.util.*;
    public class Price extends AbstractDataObject{
    private Locale locale;
    private String value;
    //private NumberFormat format;
      public Price(String value) {
          this(value, Locale.US);
      public Price(String value, Locale locale) {
           this.value = value;
           this.locale = locale;
    public Object getData() {
              return new BigDecimal(value).setScale(2, BigDecimal.ROUND_HALF_UP);
         public String toString() {
              String result = "";
              NumberFormat format = NumberFormat.getCurrencyInstance(locale);
              double val = ((BigDecimal)getData()).doubleValue();
               result = format.format(val);
                 return new String(result);//(format.format(val));
             public  String getLocale(){//for debugging
              return locale.toString();
    }In other class I call:
    AbstractDataObject d8 = AbstractDataObject.getInstance("Price", "126767", Locale.GERMANY);
    System.out.println("Price " + d8.toString());
         System.out.println("Locale" + " " + ((Price)d8).getLocale());And get:
    Price $126,767.00
    Locale en_US
    What gives?

    Hi, thanks, I screwd in method chaining. Somewhere here:
             return getInstance(fieldName, value, Locale.US);
       public static final AbstractDataObject getInstance
                                 (String fieldName, String value, Locale locale) {//, Locale locale) {
            return getInstance(fieldName, value, locale, DISPLAY_DEFAULT);
      public static AbstractDataObject getInstance
                                   (String fieldName, String value, Locale locale, int cur) {...I fixed it already. Actually I refactored everything.
    Thanks again.

  • Removing character entities

    I want to replace & a m p ; with &.
    (I've put spaces because the forum encoder is changing the code)
    I tried string1.replaceAll("& a m p ;","&");
    and it is not working
    Also tried
    string1.replaceAll("& a m p ; amp;","&");
    and it is not working.
    What is the correct code?

    philip wrote:
    ... were it not for your pointing out that String is immutable.The issue here is not that string is immutable but that the method is specified to return a value, not to change the state of the instance on which it is called.
    Only a very small percentage of the methods in the standard API both change the state and return the instance on which the method is invoked, usually as a convenience for method chaining. Unless you're absolutely sure about what you're doing, it's better to assign the returned value to the same or another reference.
    db

  • Process Chain execute method Schedule or Execute Synchronously

    Hi  Expert:
          When i execute  process chain, there are two methods to start the PC: Schedule and Execute Synchronously .
          Now i wander what the difference between the two methods for executing the PC.
          Thanks inadvance.

    Hi  prashanthk
        Thank your response,
        As a matter of fact, i execute the same process chain  which contains a  Abap Program with schedule and execute synchronously .
       But with schedule, the PC terminate with a error and execute synchronnusly the PC it run correctly .
      whether execute the PC in background or dialog mode can make a different result for the same PC .
      Now i  confused about this.
      Can you explain this in more detail for me?
    Thanks .

  • [svn] 4059: The measure() and updateDisplayList() methods of TextBox and TextGraphic now return early if the inheritingStyles and nonInheritingStyles proto chains haven 't been initialized, to avoid RTEs in the compose() method from invalid styles values.

    Revision: 4059
    Author: [email protected]
    Date: 2008-11-10 11:56:38 -0800 (Mon, 10 Nov 2008)
    Log Message:
    The measure() and updateDisplayList() methods of TextBox and TextGraphic now return early if the inheritingStyles and nonInheritingStyles proto chains haven't been initialized, to avoid RTEs in the compose() method from invalid styles values.
    QE Notes: None
    Doc Notes: None
    Bugs: SDK-17975
    Reviewer: Jason
    Ticket Links:
    http://bugs.adobe.com/jira/browse/SDK-17975
    Modified Paths:
    flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/TextBox.as
    flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/TextGraphic.as
    flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/graphicsClasses/TextGraphicEleme nt.as

    FYI - This regression has been filed here: http://bugs.adobe.com/jira/browse/SDK-31989

  • Load chain auto reaction method

    Hi All,
    In Bw 3.5   load chain is configured , if load fails an automatic mail is triggered with log message, now i want to change the mail id  of the sender .
    I had checked in RZ20 BW monitor->process chain and selected the failed one and  checked the properties and auto reaction method nothing is configured there.
    Where i have to check  to change the mail-id of the sender.
    Please suggest...
    Thanks,
    Subhash.G

    Dear subhash gadde ,
    if u want to maintain the  mail-id of the sender  right click on the process click the maintain message...then give the variant name and then in the next screen go to maintain recipient list. in that chage the mail and create new one ..as u wish...
    Regards,
    venu

  • ISE EAP-FAST chaining EAP-TLS inner method - authorizing against AD

    Just a question surrounding EAP-FAST chaining (EAP-TLS inner)  and the ability to authorize the username in the CN field of the certificate against AD. As an example for standard EAP-TLS I am able to specifiy that the username should be in a specific AD group. WIth EAP-FAST I seem unable to get the same functionality working - I suspect it is using the combined Chained username to poll with. Any advice would be much appreciated as I would like to differentiate users in different groups whilst retaining the EAP-TLS inner method.

    I have found the answer to my own question. In short my issues came down to the way that Microsoft populates the certificate subject fields in particular user certificates and the CN field.
    In my deployment I am using a single SSID with the following protocols:
    EAP-FAST (EAP-TLS inner) - Certs deployed via AD GPO
    EAP-TLS Machine Certs - Certs deploted via AD GPO
    EAP-TLS User Certs - Certs deployed via ISE and SCEP (utilising PEAP to auth the user)
    EAP-PEAP for Guest and onboarding purposes (no guest portal or MAB - not using the guest portal and CWA is awesome in my opinion).
    My certificate profile, created in ISE, utilised the CN field in the subject for principle username. This configuration works fine for machine certs and user certifcates generated via ISE as the CN field is acceptable for matching against AD. The problem however is that the user certs issued by AD GPO etc utilise the AD CN which as I understand cannot be used to ascertain group membership in AD.
    The solution seemed obvious - create a new cert profile that utilises the SAN field of the certifcate which is populated with "other name" attributes that can be matched against AD groups. The problem however is that my authentication policy for EAP protocols only allows the selection of one cert profile.... By using the SAN cert profile my EAP-TLS authentications broke but allowed successful auth of the EAP-FAST clients - not a good result.
    I figured that the a failure to match the first authentication policy (based on not matching allowed protocol) would then carry on to the next authentication policy allowing me to specifiy a different cert profile - again no dice as the first policy is matched on the wireless 802.1x condition but EAP-FAST protocol was not specified as an allowed protocol and it fails.
    The way around this was, lucky in my mind, basically I now match wireless 802.1x condition and Network Access Type:EAP-Chaining which allows me to specify the SAN cert profile for EAP-FAST connections. EAP-TLS obviously does not match the first authentication policy at all as it is not chaining. The subsequent policy is matched for EAP-TLS which specifies the CN cert profile.
    I know this explantion is long winded and perhaps obvious to some so for that I apologise. For those of you who are undertaking this and run into the same drama I hope it helps. Feel free to contact me for more information or clarification as this explanation is a mouthful to say the least.

Maybe you are looking for

  • What's wrong with this program?

    /* Daphne invests $100 at 10% simple interest. Deirdre invests $100 at 5% interest compounded annually. Write a program that finds how many years it takes for the value of Deirdre's investment to exceed the value of Daphne's investment. Aso show the

  • Distortion in final product

    I recently used my new Canon XH A1 High def. camcorder to record footage of a play performed at my daughters high school. The camcorders signal standard was set to High Definition. I then imported the footage into FCE HD version 3.5.1. FCE easy setup

  • Common Header in each page in WP8

    Hi, I am creating a Windows Phone application.I have a common header that I have to display in each page.Is there a way to create a common UI that could be included in every xaml page.If yes, then how can I do it?

  • Lightroom changes file date and time

    When I imported a large number of images to Lightroom, keeping the files in their original location, the dates and times of the files were updated. This is a bit of a pain because it means that about 4000 files will now be backed up again to the onli

  • Very slow i-tunes 7.1. Should i take an older version? Or something else?

    I-tunes upgraded itself to version 7.1 Since the 7 version (i think) my i-tunes is very slow. It takes 10 seconds when i click on a song to get it played. Besides that I installed some new anti-virussoftware (NOD32, Spysweeper). Is it possible that t