Search Results

Search found 4 results on 1 pages for 'oconnor0'.

Page 1/1 | 1 

  • HttpServletRequest.getServerName() occasionally returning null in concurrent use?

    - by oconnor0
    Under JBoss 4.0.1SP1, I have a servlet that makes multiple, concurrent calls to web services that are running under the same instance. I'm using request.getServerName() (on HttpServletRequest) to construct the endpoint URL. This normally works fine, but every once in a while returns null. I hadn't seen this before running the web service requests in parallel, and so I guessed that sharing the HttpServletRequest among threads won't always work or something. Any ideas on fixing this?

    Read the article

  • How do I add array indices to the XML produced by JAXB?

    - by oconnor0
    I have a Java bean ala @XmlRootElement public class Bean { @XmlElementWrapper(name = "ints") @XmlElement(name = "int") int[] values; // constructors, getters, setters, etc... } JAXB is producing XML like <bean> <ints> <int>12</int> <int>34</int> <int>56</int> </ints> </bean> I would like the array indices to be included on the <int> tags as array position conveys important value. Preferably as attributes like <bean> <ints> <int id='0'>12</int> <int id='1'>34</int> <int id='2'>56</int> </ints> </bean> Is there a way to do this?

    Read the article

  • Why are Java primitive types' modifiers `public`, `abstract`, & `final`?

    - by oconnor0
    In the process of doing some reflection on Java types, I came across an oddity that I do not understand. Inspecting int for its modifiers returns public, abstract, and final. I understand public and final, but the presence of abstract on a primitive type is non-obvious to me. Why is this the case? Edit: I am not reflecting on Integer but on int: import java.lang.reflect.Modifier; public class IntegerReflection { public static void main(final String[] args) { System.out.println(String.format("int.class == Integer.class -> %b", int.class == Integer.class)); System.out.println(String.format("int.class modifiers: %s", Modifier.toString(int.class.getModifiers()))); System.out.println(String.format("Integer.class modifiers: %s", Modifier.toString(Integer.class.getModifiers()))); } } The output when run: int.class == Integer.class -> false int.class modifiers: public abstract final Integer.class modifiers: public final

    Read the article

  • Slowing process creation under Java?

    - by oconnor0
    I have a single, large heap (up to 240GB, though in the 20-40GB range for most of this phase of execution) JVM [1] running under Linux [2] on a server with 24 cores. We have tens of thousands of objects that have to be processed by an external executable & then load the data created by those executables back into the JVM. Each executable produces about half a megabyte of data (on disk) that when read right in, after the process finishes, is, of course, larger. Our first implementation was to have each executable handle only a single object. This involved the spawning of twice as many executables as we had objects (since we called a shell script that called the executable). Our CPU utilization would start off high, but not necessarily 100%, and slowly worsen. As we began measuring to see what was happening we noticed that the process creation time [3] continually slows. While starting at sub-second times it would eventually grow to take a minute or more. The actual processing done by the executable usually takes less than 10 seconds. Next we changed the executable to take a list of objects to process in an attempt to reduce the number of processes created. With batch sizes of a few hundred (~1% of our current sample size), the process creation times start out around 2 seconds & grow to around 5-6 seconds. Basically, why is it taking so long to create these processes as execution continues? [1] Oracle JDK 1.6.0_22 [2] Red Hat Enterprise Linux Advanced Platform 5.3, Linux kernel 2.6.18-194.26.1.el5 #1 SMP [3] Creation of the ProcessBuilder object, redirecting the error stream, and starting it.

    Read the article

1