This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Rust Web Development and have Bastian Gruber on-line!
See this thread for details.
Win a copy of Rust Web Development this week in the Other Languages forum!

kong song

+ Follow
since May 12, 2009
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 kong song

Hi all:

The following code is extracted from org.apache.commons.chain.CatalogFactory source code.

Who can tell me under what conditions, Thread.currentThread().getContextClassLoader()==null,and fall down to execute

Why did it do this ?
Thanks for any comments !

In fact, object model and relationship model 's disaccord to be coordinated completely by ORM is impossible.
Hibernate hide subway SQL, you can not controll it precisely. if you try to use native sql in hibernate,orm featrue would be lost;
so in my company's recent new ERP project,I drop Hibernate ,and choose IBATIS。
Does anybody have the same idea? Thanks.
I have some customize data and process need to be initialized only once when Jboss AS is starting.
I have used some ejb Life Cycle Event to handle it,but the result seems not well.

so,How can I define some method or service for initializing global resource and container just only call once? and How about recycle such resource only when the container is closing.

12 years ago
As We know the bean class may define one @PostConstruct method,
When the EJB server is first started, it may create a number of stateless bean instances and enter them into the Method-Ready Pool.
My Question is that when I define a PostConstruct method in stateless bean, Does this method is invoked for each instance?
in the other words, If I define PostConstruct method for some global resource initialization which should be executed only once, does container call this mehod by each instance more than once?

after all,How can I define some method for initializing global resource and container just only call once? and How about recycle such resource only when the container is closing.

I want improve my EJB3 development still.
Although I have used EJB3 with JBoss AS to achieve our app for more than one year,I still wonder how to used some 'advance feature' about EJB3 :JMS,TimeService, etc.
Expecially about handle transaction ,and I heard JPA 's NamedQuery has some good performance....

So I really want to get some mature projects with excellent source code used EJB3 .

Thanks very much!
12 years ago
Thanks Peter,I have tried to map hostname with IP both in host and client in 'host file'.
The problem is solved as soon as I re-start service ,and I can call remote ejb successful!!
subsequently,I tried to modify the 'host file', I found it must be mapped " win2003" in client machine,but the Host side is not necessary !

Then I checked my studio machines 's 'host file' there is not 'IP hostname' mapping for host either in client or host, but it still can call remote ejb successfully?
Is it related Router config?

Thanks lot !
12 years ago
Jboss is an application server, which support EJB,JMS....right now it contains web server(Tomcat)
Tomcat is a web server only support for servlet an jsp
12 years ago
All excetipn is shown below:
12 years ago
Thanks Peter,
I have start Jboss server at Host (
and run command "telnet 1099 " at Client.
then the client command line shows the following message:

Yes,There is some unrecognizable code...,may be rmi error?but I really do not know how to solve.

I have try to re-install windows2003,but the problem still exist!
I use the command " telnet ...." in the other machine,but the result message is as the same as above!
What should I do next?


12 years ago
My develop environment:

client: winXP/JDK6/IP: [real machine]
host: windows2003 /JDK6 /JBoss5.0 /hostname:win2003/IP: [host is run in VMware6 at client's real machine] bridge

both of them are work well independently,


All the code is easy, I make host code to jar named 'test.jar' deploye jboss5-->default--->deploye, copy test.jar to client machine

set classPath to reference .
then running host jboss AS,and Client 'main' method remote call EJB.

All above I have try many times in my studio,There is no problem,and got the right result successfully.
(-b has set to jboss)

Today , In order to run demo for client, I help my boss to build the distributed environment as the same as above in his

machine,but I meet the accident,
when running the client programe the exception shows:

javax.naming.CommunicationException [Root exception is java.rmi.ConnectException: Connection refused to host: win2003;

nested exception is: Connection refused: win2003]

IP can ping pass, At Client I can browse to view the Remote Jboss console.
and The Exception can be solved if running client and host in the same machine.

what happend? windows2003 server config problem?JBoss config? but the same env config can run success in my studio.
12 years ago
You can download the plugin at
but this is only for jboss AS, the source code is easy to understand,
you can use it in Struts2's action ,interceptor...

you need to config the struts.xml to set globle interceptor:com.opensymphony.xwork2.ejb3plugin.InjectEJBInterceptor

good luck!