File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes BEA/Weblogic and the fly likes Own TCP server within Weblogic Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "Own TCP server within Weblogic" Watch "Own TCP server within Weblogic" New topic
Author

Own TCP server within Weblogic

robert sturn
Greenhorn

Joined: Jul 17, 2008
Posts: 17
I am writing a TCP server and trying to run it from within weblogic.

Here are the steps I followed.

During weblogic startup (ie web application start) I create a thread which is a java ServerSocket running on configured port say for example 5555 or 8888.

Later clients send tcp requests to this java server and server responds.

Each client request is handled in a seperate thread.

This works well on windows.

I am having problems when i deploy this on unix in test environment.

My question is whether is it a good idea to run my own Server socket from within weblogic.If it is not what is the common way of implementing this kind of requirement.
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8997
    
    9

Originally posted by robert sturn:
My question is whether is it a good idea to run my own Server socket from within weblogic.


I think it's a Bad Idea:
If application components contain the same functionality
provided by J2EE system infrastructure, there are clashes and mis-management of the functionality.
For example, if enterprise beans were allowed to manage threads, the J2EE
platform could not manage the life cycle of the enterprise beans, and it could not properly manage transactions.

J2EE 1.4 Specification section 6.2.1 Programming Restrictions

You are very light on the details of your situation, but I'd be inclined to make the custom server stand-alone and have it communicate with the main application via message queues, RMI/EJB calls, web services or something of that nature.


[How To Ask Questions On JavaRanch]
robert sturn
Greenhorn

Joined: Jul 17, 2008
Posts: 17
Thanks Joe for reply.
domenico febbo
Greenhorn

Joined: Mar 24, 2009
Posts: 4
Hi all,
I have the same question:
In this moment I have a JAVA multi-thread Server used to manage multi-clients connection for TCP raw data.
The data flow is insert in a WebLogic 9.3 queue with a JMS producer.
Now I need to deploy the TCP server inside the WL server, but I need to configure WL to open a configurable port for that raw TCP traffic.
Is that possible?
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8997
    
    9

Welcome to the JavaRanch.
You should take a few minutes and read our FAQ: HowToAskQuestionsOnJavaRanch. It's a Bad Idea to hijack a post, especially when the general direction of the post recommends a course of action that is the opposite of the one you have taken.

but I need to configure WL to open a configurable port for that raw TCP traffic.

WebLogic does not block ports. If you have your own ServerSocket listening for connections, WebLogic doesn't manage the connection at all (which is why it's a Bad Idea) and therefore doesn't need to be configured.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Own TCP server within Weblogic