chaohua wang

Ranch Hand
+ Follow
since Dec 22, 2002
Merit badge: grant badges
For More
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 chaohua wang

Hi Folks,

I have a question regarding the REST token.

the client code called 2 different REST server endpoint to request token.

One endpoint, for each request, I always got the same token: "5016b058e4b0e55ed3dbaeb9
But another endpoint, each request, i always got different token.

Could some body tell me reason why?

Thank you!

Chwang

the following is request and response token

this one has same token response:



But another endpoint, each request, i got different token. the following token is DDz9gfFF1UBoWCJaW68pCMJa_aYczxJ6. if I send request again, token will be changed.


11 years ago
Hi Folks,

I am a newer for webservice.
I have a python web service at server side.
i can put web service client call as a URL in the browser.

https://lochost:8080/spinrpc.py?method=Location.update&id=1120001&update_lifecycle=ok

But I am not use how to write a java code to make client call, and can i use java.net.URL to make a call?


how to write a SOAP xm file for these values?
method=Location.update&id=1120001&update_lifecycle=ok

Thank you in advance.

Chwang
12 years ago
Hi Folks,

I have a RMI client, needs to add private IP adapter for cluster purpose. it communicates with RMI server at different machine.

IP config is this:


169.254.31.28 is a private IP. 16.124.133.168 is public IP.

Before I added this private IP. RMI client and Server communicate all right.

But After i added this private IP.


my client filed on a method call: servicesRef.getPaciVersions();



I debugged servicesRef object. its host is this private IP address (169.254.31.28). Before it was public IP,
so this call threw a IO exception.

I am not sure only why this host only has this private IP, no public IP. After I removed this private adapter, host has public IP.

my server RMI side. the code like this:




not sure why paciVesionService contains only private IP address. my code seems not do it.

Please help.

Thank you!

Chwang
12 years ago
Hi Folks,

I have 2 type (IP4 and IP6) Address data,which are String.
IP4 : "15.2.3.56" format
IP6: "1080:0:0:0:8:800:200C:417A" format.

I wonder if there is any java API to validate them? so I don't have to write a code to it using StringTokenize.

Thank you!

Chwang
13 years ago
Paul,
I see, Thank you very much for the excellent explanation.

Best Regards,
Chwnag
13 years ago
hi Folks,

I have a
cat class , its super class is animal class.

cat extends animal{

}
i got a cat list:

List<cat> catlist= task.getCatList();

I need to pass this catlist to a method:

public takeCareOfAllanimals (List<animal> animals).


I am not sure how to do this? I tied to cast catlist to (animal)catlist, but it doesn't allow me.

thank you

Chwang
13 years ago
Hi Folks,

I need to convert special character ® to number code &# 174;

http://www.webmonkey.com/2010/02/special_characters/

is there any java API method which can do convert?
Thank you
Chwang
13 years ago
Thank you very much.

Chaohua
15 years ago
Hi, Folks,

I set up the following scheduler attributes. then started the jboss server before 12:00 am. I expected scheduler would be called at 12:00 am. but it was not called. Did I miss something in the following confg file? my scheduler is fine because when I set StartAtStartup=true, then restarted server, my scheduler was called.
Thanks,

chwang

Code:

<server>
<mbean code="org.jboss.varia.scheduler.Scheduler"
name=":service=MyAppScheduler">
<attribute name="StartAtStartup">false</attribute>
<attribute name="SchedulableClass">MySchedulableImpl</attribute>
<attribute name="InitialStartDate">12/3/2008 12:00 am</attribute>
<attribute name="SchedulePeriod">60000</attribute>
<attribute name="InitialRepetitions">-1</attribute>
</mbean>
</server>
15 years ago
Hi, folks,

I have a hibernate POJO object, which has a method

public void setResults(Clob results) {
this.results = results;
}


but i have variable pro, which is Map type and has some values.
I need to pass this Haspmap value to this mehtod,
like this,
dataobject.setResults((Clob)pro);

it can complie. but when i run it,

I got an exception,
17:24:12,332 ERROR [STDERR] at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:166)
17:24:12,332 ERROR [STDERR] Caused by: javax.transaction.TransactionRolledbackException: java.util.HashMap cannot be cast to java.sql.Clob; nested exception is:
java.lang.ClassCastException: java.util.HashMap cannot be cast to java.sql.Clob

How can i fix this issue? there is any way to cast Hashmap to a Clob.
Please help, Thank you!

Chwang
Hi, folks,

I have a hibernate POJO object, which has a method

public void setResults(Clob results) {
this.results = results;
}


but i have variable pro, which is Map type and has some values.
I need to pass this Haspmap value to this mehtod,
like this,
dataobject.setResults((Clob)pro);

it can complie. but when i run it,

I got an exception,
17:24:12,332 ERROR [STDERR] at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:166)
17:24:12,332 ERROR [STDERR] Caused by: javax.transaction.TransactionRolledbackException: java.util.HashMap cannot be cast to java.sql.Clob; nested exception is:
java.lang.ClassCastException: java.util.HashMap cannot be cast to java.sql.Clob

How can i fix this issue? there is any way to cast Hashmap to a Clob.
Please help, Thank you!

Chwang
hi, folks,

I have a POJO object (hibernate).

import java.sql.Clob;

public void setResults(Clob results) {
this.results = results;
}


but i have variable pro, which is Map type and has some values.

dataobject.setResults((Clob)pro);

it can complie. but when i run it,

I got an exception,
17:24:12,332 ERROR [STDERR] at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:166)
17:24:12,332 ERROR [STDERR] Caused by: javax.transaction.TransactionRolledbackException: java.util.HashMap cannot be cast to java.sql.Clob; nested exception is:
java.lang.ClassCastException: java.util.HashMap cannot be cast to java.sql.Clob

How can i fix this issue? there is any way to transform Hashmap to a Clob.
Please help, Thank you!

Chwang
16 years ago
thank you very. I think i did right. but not sure i will be hired.
Hi, Folks,

I had an interview with HP yesterday. They asked me a question.
I didn't get a right answer. I think.
I know t.start() will call run function, although t=null, Right?

Thread t = new Thread(); t.start(); t = null; now what will happen to the created thread?

Please help!

Thank you.

Chwang
Thank you very much, I got it.
16 years ago