peter cooke

Ranch Hand
+ Follow
since Mar 16, 2004
Merit badge: grant badges
For More
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by peter cooke

can someone explain why java 8 starteed allowing "default" implementation of a method in an interface.
I thought that was the whole point of seperating Interfaces and Abstract classes.

I like it but what happened to convince people that change would be a good thing???
9 years ago
The problem is that when I do that in my local dev env the httpServletRequest. Has"localhost".

I'm not allowed to set a remote debuger or install VM.

I guess I could find an old laptop to simulate requests for versus versus
9 years ago
Hi guy's
I have a web app (go figure servlet - web app) standard url form It is on a cluster of IBM websphere servers being served by several nodes:,,

My question HttpServletRequest.getServerName() would it be or (I think just with HttpServletRequest.getLocalName() returning

can someone one definitively confirm that behavior?? On my local dev env. It all shows up as localhost.
9 years ago
thanks for the suggestion. A quick look at the link, but i will look further at the documentation. a quick Look at the link indicates aquillian assumes you are using jboss server.
10 years ago
I have a web app that calls webservices and servlets to actually funtion.
I have been asked to come up with a way to validate behavior in the actual container. Not using mocks and stubs and preferably not use the webapp presentation to test the server side function calls.

Hoping for some guidance on current strategies. What I am finding.
one of the desired goals is to not a

(the old way): HTTPUNIT/HTMLUNIT/Cactus ontop of junit - effective, developers have experience using it. Looks like it can be a real pain if you have to build long complex web conversations.

selinium: to track web app conversation. and replay it. pro/con fast easy but cannot separate browser app from back end calls.

There was a desire to use testng but I am not finding any documentation/examples on the web where testng is launching in-container based tests.

any thoughts/ opinions
10 years ago
I dont do a lot of webservice work so sorry for my novice understanding.

I have an existing web service that is used by lots of clients.

Foo[] methodA(@WebParam(name = "param1") Engine engine, @WebParam(name = "date") Date date);

In a specific client (flash web app) I need to pass an additional param.

Foo[] methodA(@WebParam(name = "param1") Engine engine, @WebParam(name = "date") Date date, @WebParam(name = "clientTimeZoneOffset"), Long clientTimeZoneOffset);

of course method A is called by a diverse variety of clients, only 1 needs to pass in the timezone offset.
In my study of webservices, I recollect some issue with parameters for methods exposed by webservices but cannot remember the full details. WHAT ARE THE RULES???

I am getting the following
main ]|2013-09-25 12:02:09,584|ERROR||| ContextLoader:307|Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'processService': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: An operation with name [{}methodA] already exists in this service

I have found documentation that says I can methods where the type varies, but not the number of args. Can I???

10 years ago
Hoping new annotations will help me do what I want to do.

I have 2 classes (Foo and Bar) in 2 different packages

Foo does not/cannot inherit from Bar.

Foo needs to call a method on bar.
The problem is the method need to allow access only to it from a call from the class Foo or Bar. Preferably hide it all together from other classes.

Any thoughts???
10 years ago
I have a runnable java class with main. It runs from eclipse.

I put is the same jvm argument and same classpath that runs in eclipse run configuration, but will not run from command line.
Is there a way to force eclipse to show me what the effective command line being run would be. It is not showing up in the console.

${IV4_ROOT}/pathToMissingProperty/* contains
${IV4_ROOT}/lib/* contains all the hibernate jars
${IV4_ROOT}/n4build/classes is the directory where ant compiles all the java classes to for the eclipse project.

from the command line executing

>java -classpath ${IV4_ROOT}/pathToMissingProperty/*:${IV4_ROOT}/lib/*:${IV4_ROOT}/n4build/classes: -DAPP_ENCRYPTION_PASSWORD=MYPAS_WORD com.mycompany.EventFixer

gives me

Any thoughts on why I am getting this exception???
Thanks for any help
1) would not take it. the ROI is not there.

I might take it if the company paid for it. But I have not worked for a company in the last 10 years that was willing to even think about paying 3K and my salary for a course.
I have looked at the eclipse tool and jhat.

Jhat dump_file - starts a web server at port 7000 and shows none of my classes. the only thing is shows is that there was 7 instances java.lang.Class, zero instance of java.lang.String

VisualVM won't even load it.

11 years ago
The production tomcat server ran out of memory and dumped a .hprof file. Yippie a crash dump.
But it is a binary file.

How do I spit out in human readable format what is in my hprof file???
11 years ago
HMMMM my ethernet sniffer confirms that unless my form has all of it's input elements populated it will not go accross the wire.

If I have assignments for both everything works and I see the request/response in my ethernet sniffer.

I remove the assignment of the value from either "some_param" or "another_param" my ethernet sniffer does NOT detect the request from the submit, and submit fails with a null pointer exeception in
11 years ago
I think I know the answer to this but hoping my understanding is incorrect.

I have a webform with

I browse to the file select it and submit it to the servlet.

the response from the contains is valid xml that includes a proprietary multi verison filesystem path (every version of the file is stored and retained forever and can see ver1 ver2 .... ver n) where the file was uploaded to. It is not a standard url or uri or file system path.

When I call submit on the form, I get " <error message="Bad file descriptor" type=""> Bad file descriptor....."

stack trace

I think submit sees the file tag and tries to build a java.util.File object with the contents of the file element.
is that correct?
11 years ago
the business requirements say that some_param and another_param are completely optional. If user does not put anything in then ... put null in db.
11 years ago
The test started working when I put in values for all html inputs.
So if I have a html form and it does not require all inputs to have data. Why does httpunit?
Is there somehting wrong with the form or my testcode that says "yes I know the form does not have values for all input. submit it anyways"
11 years ago