JBoss Vesion : jboss-4.0.2
JDK-Version : jdk 1.5_03

The config level changes are , I tried making a jboss_home and a jboss_base.
So I can change the binaries of JBoss when needed.

You can look at the part of start script.


export JBOSS_HOME=/opt/GEinet/jboss-4.0.2
  | 
  | STATUS=10
  | while [ $STATUS -eq 10 ]
  | do
  | # Execute the JVM
  |    "$JAVA" $JAVA_OPTS \
  |    -Djboss.base.dir=$JBOSS_BASE \
  |    -Djboss.server.base.dir=$JBOSS_BASE/server/ \
  |    -Djboss.server.base.url=file:$JBOSS_BASE/server/ \
  |    -Djboss.server.home.dir=$JBOSS_BASE/server/default \
  |    -Djboss.server.config.dir=$JBOSS_BASE/server/default/conf \
  |    -Djboss.server.lib.dir=$JBOSS_BASE/server/default/lib \
  |    -Djboss.server.data.dir=$JBOSS_BASE/server/default/data \
  |    -Djava.endorsed.dirs="$JBOSS_ENDORSED_DIRS" -classpath 
"$JBOSS_CLASSPATH" org.jboss.Main -c default >$JBOSS_CONSOLE 2>&1 & 
  |    if [ ! -z "$JBOSS_PID" ]; then
  |         echo $! > $JBOSS_PID
  |    fi
  |    STATUS=$?
  |    echo "JBoss started with jvm  code : $STATUS , you can find logs at 
$JBOSS_CONSOLE"
  | done

OS Info :

uname -a
Linux gealnx28 2.4.21-9.ELsmp #1 SMP Thu Jan 8 17:08:56 EST 2004 i686 i686 i386 
GNU/Linux

FD Max Size: 1024 (This is reached after a period of time)

Problem StackTrace    (Running on DEBUG MODE)
-------------------

2005-11-03 16:51:25,683 WARN  [org.jboss.mq.il.uil2.UILServerILService] Failed 
to setup client connection
java.net.SocketException: Too many open files
        at java.net.PlainSocketImpl.socketAccept(Native Method)
        at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:384)
        at java.net.ServerSocket.implAccept(ServerSocket.java:450)
        at java.net.ServerSocket.accept(ServerSocket.java:421)
        at 
org.jboss.mq.il.uil2.UILServerILService.run(UILServerILService.java:124)
        at java.lang.Thread.run(Thread.java:595)


Error Reproduction:
------------------------
This happens after some hours since the server is started.


Scenario:
------------

I have a external system that puts messages into a queue and a servlet browsing 
and consuming this on a 
timeinterval. I run this on a while loop. When the fd limit is full this is 
what i get on the client side...


StackTrace :
--------------------------------
2005-11-08 06:51:09,447|UIL2.SocketManager.ReadTask#7313 
client=3.130.200.40:8093|DEBUG|org.jboss.mq.il.uil2.SocketManager|Created 
ObjectInputStream
2005-11-08 
06:51:09,448|TP-Processor23|DEBUG|org.jboss.mq.il.uil2.UILClientILService|Starting
2005-11-08 06:51:09,448|UIL2.SocketManager.ReadTask#7315 
client=3.130.200.40:8093|DEBUG|org.jboss.mq.il.uil2.SocketManager|Begin 
ReadTask.run
2005-11-08 06:51:09,448|UIL2.SocketManager.WriteTask#7316 
client=3.130.200.40:8093|DEBUG|org.jboss.mq.il.uil2.SocketManager|Begin 
WriteTask.run
2005-11-08 06:51:09,448|UIL2.SocketManager.WriteTask#7316 
client=3.130.200.40:8093|DEBUG|org.jboss.mq.il.uil2.SocketManager|Created 
ObjectOutputStream
2005-11-08 06:51:09,449|UIL2.SocketManager.WriteTask#7316 
client=3.130.200.40:8093|DEBUG|org.jboss.mq.il.uil2.SocketManager|End 
WriteTask.run
2005-11-08 06:51:09,449|TP-Processor24|WARN|tptpgateway.init.InitServlet|Fatal 
Error while checking for new messages
2005-11-08 
06:51:09,482|TP-Processor24|ERROR|org.jboss.mq.SpyJMSException|org.jboss.mq.SpyJMSException:
 Cannot authenticate user; - nested throwable: (java.net.SocketException: 
Socket closed)
        at 
org.jboss.mq.SpyJMSException.getAsJMSException(SpyJMSException.java:66)
        at 
org.jboss.mq.SpyJMSException.rethrowAsJMSException(SpyJMSException.java:51)
        at org.jboss.mq.Connection.authenticate(Connection.java:1118)
        at org.jboss.mq.Connection.(Connection.java:267)
        at org.jboss.mq.Connection.(Connection.java:338)
        at org.jboss.mq.SpyConnection.(SpyConnection.java:68)
        at 
org.jboss.mq.SpyConnectionFactory.createConnection(SpyConnectionFactory.java:87)
        at 
tptpgateway.init.InitServlet.areThereNewMessages(InitServlet.java:205)
        at tptpgateway.init.InitServlet.coreWork(InitServlet.java:137)
        at tptpgateway.init.InitServlet.processRequest(InitServlet.java:123)
        at tptpgateway.init.InitServlet.doGet(InitServlet.java:167)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
        at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
        at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:204)
        at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
        at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
        at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
        at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
        at 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
        at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:307)
        at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:385)
        at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:748)
        at 
org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:678)
        at org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:871)
        at 
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
        at java.lang.Thread.run(Thread.java:595)
Caused by: java.net.SocketException: Socket closed
        at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:99)




Here the code which runs on the servlet :
---------------------------------------------


protected void coreWork(){
  |             try {
  |                     // Start the Listner for consuming the messages
  |                     logger.debug("Bootstrapping the Listner");
  |                     while (RUN_AS_DAEMON_STATUS) {
  |                             // Normal Execution
  |                             if (areThereNewMessages()) {                    
                
  |                                             logger.debug("New Messages were 
found");
  |                                             reciever = new 
MessageReciever();
  |                                             
reciever.connectAndRecieveMessages();                                           
  |                                             reciever.disconnectReciever();  
                                
  |                             } else {
  |                                     logger.debug("No Messages were found");
  |                             }
  |                             Thread.sleep(sleepingTime);
  |                     }
  | 
  |             } catch (Throwable th) {
  |                     logger.alert("Fatal Error occured in coreWork() 
!"+th.getMessage());                    
  |                     logger.printStackTrace(th);
  |                     logger.alert("Trying to recover from the error ,going 
back to core work");
  |                     coreWork();
  |             }
  |             
  |     }
  | 
  | 
  | 
  | 
  | 
  | 
  | private boolean areThereNewMessages() {
  |             boolean newMessageFound = false;
  |             try {
  |                     logger.debug("Loading the JMSConfiguration");
  |                     loadJMSConfig();
  |                     Properties jndi = getInitialContextProperties();
  | 
  |                     context = new InitialContext(jndi);
  |                     // Look up the ConnectionFactory
  |                     factory = (ConnectionFactory) context.lookup(jmsConfig
  |                                     .getAdminsteredConnFactoryName());
  |                     // Look up the Desination
  |                     dest = (Queue) 
context.lookup(jmsConfig.getInputJMSQueue());
  | 
  |                     // create the connection
  |                     connection = factory.createConnection();
  | 
  |                     // create the session
  |                     session = connection.createSession(false, 
Session.AUTO_ACKNOWLEDGE);
  | 
  |                     // create the browser
  |                     browser = session.createBrowser(dest);
  | 
  |                     // start the connection
  |                     connection.start();
  | 
  |                     Enumeration messages = browser.getEnumeration();
  |                     while (messages.hasMoreElements()) {
  |                             // set the flag to true
  |                             newMessageFound = true;
  |                             // Can remove this unwanted part
  |                             Message message = (Message) 
messages.nextElement();
  |                             if (message instanceof TextMessage) {
  |                                     TextMessage text = (TextMessage) 
message;
  |                                     String messageFromLaptop = 
text.getText();
  |                                     logger.debug("Browsed Msg From The 
Queue: " + messageFromLaptop);
  |                             } else if (message != null) {
  |                                     logger.debug("Browsed non text 
message");
  |                             }
  |                     }
  | 
  |             } catch (Throwable th) {
  |                     logger.alert("Fatal Error while checking for new 
messages");
  |                     logger.printStackTrace(th);
  |             } finally {
  |                     if (connection != null) {
  |                             try {
  |                                     browser.close();
  |                                     session.close();
  |                                     connection.close();
  |                             } catch (JMSException exception) {
  |                                     logger.alert("JMSException while 
disconnection connection",
  |                                                     exception.toString());
  |                             }
  |                     }
  |             }
  | 
  |             return newMessageFound;
  |     }
  | 
  | 
  | 
  |     private Properties getInitialContextProperties() {
  |             Properties env = new Properties();
  |             env.put(Context.SECURITY_PRINCIPAL, "guest");
  |             env.put(Context.SECURITY_CREDENTIALS,"guest");
  |             
env.put(Context.INITIAL_CONTEXT_FACTORY,"org.jboss.naming.HttpNamingContextFactory");
  |             env.put(Context.PROVIDER_URL, 
"http://gealnx28.appl.ge.com:8080/invoker/JNDIFactory";);
  |             return env;
  |     }
        
Hope this suffices to your comment.


Thanks and warm regards
Vignesh








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

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3906490


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to