Ben Zahler

Greenhorn
+ Follow
since Sep 04, 2002
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Ben Zahler

Hi,
I need to get the ip of my machine, and noticed that InetAddress.getLocalHost() is slower than expected on my Fedora 12 machine.

Each call takes between 30 and 100 milliseconds.

However, the "hostname" command executes in 1 millisecond.

Also, on my windows system, this is a lot faster.

i have checked the /etc/hosts and also the /etc/nsswitch.conf points to the /etc/hosts file first.

Can anyone explain why the call takes so much time?

thanks a lot

Ben
in my test case, nothing else happens in the loop, and if comment the line

the memory doesn't increase.

I did profile it with a simple profiler and saw a lot of data in char[] .
13 years ago
Hi all,
I have a simple java method dealing with Stringbuffers and Strings that eats up much more Memory than it should. The problem is in a loop, which inserts the same String (insertString) in multiple places into a StringBuffer (docStringBuffer):




insertString is a String which is about 30kb, docStringBuffer is initially 15Mb.
I insert the String 5000 times, which means the docStringBuffer gets to about 170Mb.

When I run the code, however, the JVM takes up much memory than I'd expect. At the first execution of the loop, it's about 100Mb, which I find very normal. But after 2000 iterations, this is up to 800Mb! And with 4000 iterations, I get an OOM.

I can understand that the JVM needs 30Mb more after 1000 iterations, but can anyone explain why after each 1000 iterations the JVM needs an additional 450MB?

My Java version is
java version "1.5.0"
Java(TM) 2 Runtime Environment, Standard Edition (build pwi32devifx-20070608 (SR5+IY99712))
IBM J9 VM (build 2.3, J2RE 1.5.0 IBM J9 2.3 Windows XP x86-32 j9vmwi3223-20070426 (JIT enabled)
J9VM - 20070420_12448_lHdSMR
JIT - 20070419_1806_r8
GC - 200704_19)
JCL - 20070608


I have also tried to do the same thing with different combinations of Strings/Stringbuffer (i.e. decraring docString as a Stringbuffer), but it made virtually no difference.

thanks for any help,
Ben
13 years ago
Hi,
i do not really know the api, but since you've set the mime type of the content to text/html, everything inside will be interpreted as html.

maybe a different mime type would solve your problem...
13 years ago
Hi all,
I use the Java PrintService to print big files (1 Gb). The printService uses the system's temporary directory to store the file, but I'd like it to go to some other place.

is there a way to configure this?

I do not want to change the system's temp directory as this is ok for all ohter things.

thanks for any help,

Ben
13 years ago
I've had the same problem, you have to modify an xmi file in the clients EAR:
make sure the ibm-webservicesclient-ext.xmi contains something like this:

<serviceRefs serviceRefLink="service/XXXService">
<portQnameBindings portQnameLocalNameLink="XXXService">
<clientServiceConfig>
<securityRequestGeneratorServiceConfig>
<integrity name="int_req1" order="1">
<messageParts Dialect="http://www.ibm.com/websphere/webservices/wssecurity/dialect-was" name="int_req_body" keyword="body"/>
</integrity>
<confidentiality name="conf_gen" order="2">
<messageParts Dialect="http://www.ibm.com/websphere/webservices/wssecurity/dialect-was" name="conf_gen_body" keyword="bodycontent"/>
</confidentiality>
</securityRequestGeneratorServiceConfig>
<securityResponseConsumerServiceConfig>
<requiredIntegrity name="int_con1" usage="Required">
<messageParts Dialect="http://www.ibm.com/websphere/webservices/wssecurity/dialect-was" name="int_con_body" keyword="body"/>
</requiredIntegrity>
<requiredConfidentiality name="conf_con" usage="Required">
<messageParts Dialect="http://www.ibm.com/websphere/webservices/wssecurity/dialect-was" name="conf_con_body" keyword="bodycontent"/>
</requiredConfidentiality>
</securityResponseConsumerServiceConfig>
</clientServiceConfig>
</portQnameBindings>
</serviceRefs>
15 years ago
Hi all,
I am getting the following error:

Sep 18, 2006 12:58:22 PM com.sun.faces.lifecycle.InvokeApplicationPhase execute
SEVERE: Index: 0, Size: 0
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.ArrayList.RangeCheck(ArrayList.java:546)
at java.util.ArrayList.remove(ArrayList.java:389)
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:274)
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:384)
at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:75)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:217)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:90)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)


Nothing of the stacktrace is my own code, is there anything known about this?


thanks in advance

ben
15 years ago
JSF
Hi all,
I am getting the following error:

Sep 18, 2006 12:58:22 PM com.sun.faces.lifecycle.InvokeApplicationPhase execute
SEVERE: Index: 0, Size: 0
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.ArrayList.RangeCheck(ArrayList.java:546)
at java.util.ArrayList.remove(ArrayList.java:389)
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:274)
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:384)
at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:75)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:217)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:90)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)


Nothing of the stacktrace is my own code, is there anything known about this?


thanks in advance

ben
15 years ago
Hi all,
I have a strange runtime.exec problem: Depending on the command, the command is executed or not. First, here's the code:




When I copy the command I printed out and execute it from the command line. On the other hand, executing a simple scipt in the same folder and with the same permission as my "real" command works... any ideas what's wrong?

Thanks a lot!
Cheers
Ben


[Edited to use code tags - Paul Sturrock]
[ September 18, 2006: Message edited by: Paul Sturrock ]
15 years ago
Hi all,
i have a field in my app in which the user will have to write a number in the format ##/########-####.
Ideally, when he clicks into the field, he is guided by displaying __/________-__ in the field.

This works almost with the standard components, except that in my app, the field is not required and if I use the default components I always get Conversion errors if when the field is empty.

Ok, so I wrote my own converter, which allows either correct or empty entries, but as soon as I associate my converter with the input text component, the helper mask does not show up anymore.

Any ideas what could be the problem?
thanks in advance
ben
15 years ago
JSF
in the <h:dataTable> tag, you should have defined an attribut "var". The bean associated with the selected row is stored in the request with this name.

In my case, the name is " varrecords", thus I get the bean with

this.getRequestScope.get("varrecords")

hope this helps!
15 years ago
JSF
Hi ranchers!
I've got a problem with my EJBs: how can I make them notify my clients if something's changed? I've tried registring my client as a observer with the bean, but the container wouldn't let me do that (I get a RemoteException), so I tried using Proxies, but when I called getProxy() to obtain the Proxy-Object from the bean I only got a clone which didn't help my cause...
Is there anyone how could helo me?
thanx a lot
Ben
Hi!
I need to access 8 identical databases. One client needs to access only one database at a time (the user decides which one), but there may be different users accessing different dbs simultaneously. Is it possible to do this with one CMP EJB (for each table)? Or would it make sense to have 8 identical "Beans" that differ only in the db-connection all on the same server?
Thanxs
Ben