Java Mailing List Archive

http://www.junlu.com/

Google
Google
Mailing List
Home
Forum Home
JBoss - Java Application Server
Tomcat - JSP/Servlet container
Struts - A MVC web framework
iText - An open source PDF Java Library
JDOM - JDOM XML Parser
J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition
JSP - A mailing list about Java Server Pages specification and reference
J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog
Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology
Struts & Hibernate
Subjects
JSP editor plugin for eclipse ?
org apache jasper JasperException: Unable to compile class for JSP
Tomcat: Connection reset by peer: socket write error
Cannot retrieve definition for form bean null
Struts Tiles Tutorial (free Struts training)
Where do I download Tomcat 4 0 6?
Data Access Object (DAO) pattern, example DAO 's
Where to download Tomcat v 4 1 24 from?
Tomcat 5 0 16 Requested resource not available
Oracle Connection Pooling in 3 2 2
Servlet : Session invalidate
Servlet action is currently unavailable
Tomcat/Struts Unicode Encoding/Decoding problems
Tomcat and webapplication specific java library path
Running a Simple JMS Example
Mapping in workers2 properties
org apache jasper JasperException
Cannot find message resources under key org apache struts action
   MESSAGE
problem with html:text bean throwing exception
Cannot find message resources under key org apache struts action MESSAGE
invalid direct reference problem with solution
Tool for jsp debug Try Sysdeo Eclipse Plugin
Tomcat 5 Cannot load JDBC driver class 'null ' SQL state: null
weblogic ejbc
java properties file
Jboss 3 2 3 Coyote Can 't re
Tomcat 5, Apache2 and mod jk2 integration problem
JBoss example problem new to J2EE
url string for connecting jboss to oracle
Value attribute of <html:checkbox
javax servlet ServletException: BeanUtils populate
HTTP Status 404 The requested resource is not available
5 0 18: Windows XP Pro vs Windows 2000
 
- Closing the socket connection and sending multiple res

- Closing the socket connection and sending multiple res

2007-07-18       - By cazuza

 Back
Please I need help,

Appologies in advance if the questions are too naive, but I'm just starting
with Jboss and have a head full of doubts.

I have try to implement a socket server using jboss remoting and have hit a
wall.
the timeout attribute works but doesn't close the socket instead it sends error
messages to the console.

16:05:52,492 ERROR [STDERR] java.net.SocketTimeoutException Source code of java.net.SocketTimeoutException: Read timed out
 | 16:05:52,492 ERROR [STDERR] at java.net.SocketInputStream.socketRead0
(Native Method)
 | 16:05:52,492 ERROR [STDERR] at java.net.SocketInputStream.read
(SocketInputStream.java:129)
 | 16:05:52,492 ERROR [STDERR] at sun.nio.cs.StreamDecoder$CharsetSD.readBytes
(StreamDecoder.java:411)
 | 16:05:52,493 ERROR [STDERR] at sun.nio.cs.StreamDecoder$CharsetSD.implRead
(StreamDecoder.java:453)
 | 16:05:52,493 ERROR [STDERR] at sun.nio.cs.StreamDecoder.read(StreamDecoder
.java:183)
 | 16:05:52,493 ERROR [STDERR] at java.io.InputStreamReader Source code of java.io.InputStreamReader
(InputStreamReader.java:167)
 | 16:05:52,493 ERROR [STDERR] at java.io.BufferedReader Source code of java.io.BufferedReader(BufferedReader
.java:136)
 | 16:05:52,493 ERROR [STDERR] at java.io.BufferedReader Source code of java.io.BufferedReader
(BufferedReader.java:299)
 | 16:05:52,493 ERROR [STDERR] at java.io.BufferedReader Source code of java.io.BufferedReader
(BufferedReader.java:362)
 | 16:05:52,493 ERROR [STDERR] at com.xxxxx.dbi.socket.TextUnMarshaller.read
(TextUnMarshaller.java:53)
 | 16:05:52,493 ERROR [STDERR] at org.jboss.remoting.transport.socket
.ServerThread.versionedRead(ServerThread.java:652)
 | 16:05:52,493 ERROR [STDERR] at org.jboss.remoting.transport.socket
.ServerThread.processInvocation(ServerThread.java:530)
 | 16:05:52,493 ERROR [STDERR] at org.jboss.remoting.transport.socket
.ServerThread.dorun(ServerThread.java:383)
 | 16:05:52,493 ERROR [STDERR] at org.jboss.remoting.transport.socket
.ServerThread.run(ServerThread.java:165)
 | 16:05:57,492 ERROR [STDERR] java.net.SocketTimeoutException Source code of java.net.SocketTimeoutException: Read timed out
 | 16:05:57,493 ERROR [STDERR] at java.net.SocketInputStream.socketRead0
(Native Method)
 | 16:05:57,493 ERROR [STDERR] at java.net.SocketInputStream.read
(SocketInputStream.java:129)
 | 16:05:57,493 ERROR [STDERR] at sun.nio.cs.StreamDecoder$CharsetSD.readBytes
(StreamDecoder.java:411)
 | 16:05:57,493 ERROR [STDERR] at sun.nio.cs.StreamDecoder$CharsetSD.implRead
(StreamDecoder.java:453)
 | 16:05:57,493 ERROR [STDERR] at sun.nio.cs.StreamDecoder.read(StreamDecoder
.java:183)
 | 16:05:57,493 ERROR [STDERR] at java.io.InputStreamReader Source code of java.io.InputStreamReader
(InputStreamReader.java:167)
 | 16:05:57,493 ERROR [STDERR] at java.io.BufferedReader Source code of java.io.BufferedReader(BufferedReader
.java:136)
 | 16:05:57,494 ERROR [STDERR] at java.io.BufferedReader Source code of java.io.BufferedReader
(BufferedReader.java:299)
 | 16:05:57,494 ERROR [STDERR] at java.io.BufferedReader Source code of java.io.BufferedReader
(BufferedReader.java:362)
 | 16:05:57,494 ERROR [STDERR] at com.xxxxx.dbi.socket.TextUnMarshaller.read
(TextUnMarshaller.java:53)
 | 16:05:57,494 ERROR [STDERR] at org.jboss.remoting.transport.socket
.ServerThread.versionedRead(ServerThread.java:652)
 | 16:05:57,494 ERROR [STDERR] at org.jboss.remoting.transport.socket
.ServerThread.processInvocation(ServerThread.java:530)
 | 16:05:57,494 ERROR [STDERR] at org.jboss.remoting.transport.socket
.ServerThread.dorun(ServerThread.java:383)
 | 16:05:57,494 ERROR [STDERR] at org.jboss.remoting.transport.socket
.ServerThread.run(ServerThread.java:165)
 |
unless the client closes the connection itself it seems that the server will
timeout and write error messages to STDERR. I don't want to rely on the client
to close the connection, is it possible to close the socket connection after
sending the response?

the other question is How do I send multiple messages back to the client. At
the moment on my invoke method I receive the request, parse it and return a
string, what do I have to do to send another string without concatenating to
the previous string? lets say I'm reading a huge file and want to send it line
by line.

here is my configuration file


 | <server>
 | <!-- ==================================================================== -
->
 |   <!-- Invokers to the JMX node                                            
-->
 |   <!-- ====================================================================
-->
 |    <mbean code="org.jboss.remoting.transport.Connector"
 |           name="com.xxxx:service=Connector,transport=socket"
 |           display-name="RacingDB Socket transport Connector">
 |       <attribute name="Configuration">
 |          <config>
 |             <invoker transport="socket">
 |                <attribute name="timeout">5000</attribute>
 |                <attribute name="dataType" isParam="true">text</attribute>
 |                <attribute name="marshaller" isParam="true">com.xxxx.dbi
.socket.TextMarshaller</attribute>
 |                <attribute name="unmarshaller" isParam="true">com.xxxx.dbi
.socket.TextUnMarshaller</attribute>
 |                <attribute name="serverSocketClass">com.xxxx.dbi.socket
.SimpleInputStreamWrapper</attribute>
 |                <attribute name="serverBindAddress">${jboss.bind.address}<
/attribute>
 |                <attribute name="serverBindPort">6193</attribute>
 |                <attribute name="enableTcpNoDelay" isParam="true">true<
/attribute>
 |             </invoker>
 |             <handlers>
 |                <handler subsystem="RDBIS">com.xxxx.dbi.socket.Handler<
/handler>
 |             </handlers>
 |          </config>
 |       </attribute>
 |    </mbean>
 |
 | </server>  
 |

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic
&p=4065244#4065244

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode
=reply&p=4065244
__ ____ ____ ____ ____ ____ ____ ____ ____ ____
jboss-user mailing list
jboss-user@(protected)
https://lists.jboss.org/mailman/listinfo/jboss-user

©2008 junlu.com - Jax Systems, LLC, U.S.A.