[JBoss-dev] Problems with 'jboss-mq' and autodeployer
Ok, I'm at a loss as to what's going on in the JBossMQ module of CVS. I've been making changes to the underlying OIL transport module of JBoss and I still need to propagate those changes to the UIL transport code. I've been working by checking out the 'jboss-all' module from CVS so that I could run the testsuite code before I checked in any changes. Everything seems to work fine when JBoss is checked out as a whole. However, when I check out the 'jboss-mq' module from CVS anonymously, build it, and then run the server it doesn't deploy! No TCP/IP ports (or UDP/IP for that matter) are opened. So there's no endpoints for RMI to provide access to JNDI or the messaging transports. I'm going to try to blunder my way around the code, but if someone could provide some useful insight on where to look I would greatly appreciate it. I'm using a vanilla checkout of the jboss-mq module. Also, if you do a checkout of jboss-mq and then build, be sure to link the thirdparty/gnu/getopt/lib/getopt.jar into the lib directory or it will not run. Somethings amiss with the build.xml so that getopt.jar is not being added to the lib directory. I've sent an e-mail to the two individuals that built and modified the file asking for direction/help in that matter already. Below is the last few lines of the server log. Prehaps it will be of use to those who understand the autodeployer code better than I. Thanks Weave -- truncated server.log - 2002-01-14 08:27:40,215 TRACE [org.jboss.system.ServiceLibraries] Libraries adding URLClassLoader 956609115 key URL file:/home/weave/OpenNMS/jboss/jboss-mq.pserver/build/output/jbossmq-1.0.0Beta/lib/ext/jnpserver.jar 2002-01-14 08:27:40,215 DEBUG [org.jboss.deployment.ServiceDeployer] deployed classes for file:/home/weave/OpenNMS/jboss/jboss-mq.pserver/build/output/jbossmq-1.0.0Beta/lib/ext/jnpserver.jar 2002-01-14 08:27:40,216 DEBUG [org.jboss.deployment.ServiceDeployer] about to copy 0 local directories 2002-01-14 08:27:40,216 DEBUG [org.jboss.deployment.ServiceDeployer] addMBeans: url file:/home/weave/OpenNMS/jboss/jboss-mq.pserver/build/output/jbossmq-1.0.0Beta/conf/default/jboss-service.xml 2002-01-14 08:27:40,219 DEBUG [org.jboss.deployment.ServiceDeployer] deploying with ServiceController mbean mbean code=org.jboss.deployment.AutoDeployer name=JBOSS-SYSTEM:service=AutoDeployer attribute name=Deployers JBOSS-SYSTEM:service=ServiceDeployer; /attribute attribute name=URLs ../deploy/lib, ../deploy /attribute attribute name=Timeout 3000 /attribute /mbean 2002-01-14 08:27:40,225 DEBUG [org.jboss.system.ServiceCreator] About to create bean: JBOSS-SYSTEM:service=AutoDeployer 2002-01-14 08:27:40,266 DEBUG [org.jboss.system.ServiceCreator] Created bean: JBOSS-SYSTEM:service=AutoDeployer 2002-01-14 08:27:40,274 DEBUG [org.jboss.system.ServiceConfigurator] Deployers set to JBOSS-SYSTEM:service=ServiceDeployer; in JBOSS-SYSTEM:service=AutoDeployer 2002-01-14 08:27:40,277 DEBUG [org.jboss.system.ServiceConfigurator] URLs set to ../deploy/lib, ../deploy in JBOSS-SYSTEM:service=AutoDeployer 2002-01-14 08:27:40,277 DEBUG [org.jboss.system.ServiceConfigurator] Timeout set to 3000 in JBOSS-SYSTEM:service=AutoDeployer 2002-01-14 08:27:40,278 DEBUG [org.jboss.system.ServiceConfigurator] found 0 depends elements 2002-01-14 08:27:40,279 INFO [org.jboss.deployment.AutoDeployer] Initializing 2002-01-14 08:27:40,281 INFO [org.jboss.deployment.AutoDeployer] Initialized 2002-01-14 08:27:40,282 INFO [org.jboss.deployment.AutoDeployer] Starting 2002-01-14 08:27:40,285 DEBUG [org.jboss.deployment.AutoDeployer] Deployer 'JBOSS-SYSTEM:service=ServiceDeployer' isn't yet registered files for this deployer will not be deployed until it is deployed. 2002-01-14 08:27:40,287 DEBUG [org.jboss.deployment.AutoDeployer] Watching dir: /home/weave/OpenNMS/jboss/jboss-mq.pserver/build/output/jbossmq-1.0.0Beta/deploy/lib 2002-01-14 08:27:40,290 DEBUG [org.jboss.deployment.AutoDeployer] Watching dir: /home/weave/OpenNMS/jboss/jboss-mq.pserver/build/output/jbossmq-1.0.0Beta/deploy 2002-01-14 08:27:40,295 INFO [org.jboss.deployment.AutoDeployer] Started 2002-01-14 08:27:40,296 INFO [org.jboss.system.Server] Started in 0m:2s:124ms 2002-01-14 08:53:28,291 INFO [org.jboss.system.Server] Shutting down all services 2002-01-14 08:53:28,293 INFO [Default] Shutting down 2002-01-14 08:53:28,294 INFO [org.jboss.system.ServiceController] Stopping 2 services 2002-01-14 08:53:28,297 DEBUG [org.jboss.system.ServiceController] removing service: jboss.system:service=ServiceDeployer 2002-01-14 08:53:28,297 DEBUG [org.jboss.system.ServiceController] removing jboss.system:service=ServiceDeployer from server 2002-01-14 08:53:28,299 INFO [org.jboss.deployment.ServiceDeployer] Stopping 2002-01-14 08:53:28,309 WARN [org.jboss.deployment.ServiceDeployer] Unable to recursively delete the temp directory
[JBoss-dev] CVS update: jbossmq/src/main/org/jboss/mq/il/oil OILConstants.java OILClientIL.java OILClientILService.java OILServerIL.java OILServerILService.java
socket. This is +* set so the socket will periodically return to check +* the running flag. */ - private static JMSServer server; + private final static int SO_TIMEOUT = 5000; - private final static int ACKNOWLEDGE = 1; - private final static int ADDMESSAGE = 2; - private final static int BROWSE = 3; - private final static int CHECKID = 4; - private final static int CONNECTIONCLOSING = 5; - private final static int CREATEQUEUE = 6; - private final static int CREATETOPIC = 7; - private final static int DELETETEMPORARYDESTINATION = 8; - private final static int GETID = 9; - private final static int GETTEMPORARYQUEUE = 10; - private final static int GETTEMPORARYTOPIC = 11; - private final static int RECEIVE = 13; - private final static int SETENABLED = 14; - private final static int SETSPYDISTRIBUTEDCONNECTION = 15; - private final static int SUBSCRIBE = 16; - private final static int TRANSACT = 17; - private final static int UNSUBSCRIBE = 18; - private final static int DESTROYSUBSCRIPTION = 19; - private final static int CHECKUSER = 20; - private final static int PING = 21; + /** +* The JMS server where requests are forwarded to. +*/ + private static JMSServer server; - private final static int SO_TIMEOUT = 5000; /** -* Description of the Field +* The listening socket that receives incomming connections +* for servicing. */ private ServerSocket serverSocket; + + /** +* The managed serverIL. +*/ private OILServerIL serverIL; + /** +* The running flag that all worker and server +* threads check to determine if the service should +* be stopped. +*/ private volatile boolean running; + + /** +* The server port to bind to. +*/ private int serverBindPort = 0; + + /** +* The internet address to bind to by +* default. +*/ private InetAddress bindAddress = null; - private Thread worker; /** +* This class is used to encapsulate the basic connection and +* work for a connected client thread. The run() method of this +* class processes requests and sends responses to and from a +* single client. All requests are forwarded to the outer class' +* JMS server instance. +* +* @author Brian Weaver ([EMAIL PROTECTED]) +*/ + private final class Client + implements Runnable + { + /** + * The TCP/IP socket for communications. + */ + private Socket sock; + + /** + * The object output stream running on top of the + * socket's output stream. + */ + private ObjectOutputStream out; + + /** + * The objec5t input stream running on top of the + * socket's input stream + */ + private ObjectInputStream in; + + /** + * Allocates a new runnable instance to process requests from + * the server's client and pass them to the JMS server. The + * passed socket is used for all communications between the + * service and the client. + * + * @param s The socket used for communications. + * + * @throws java.io.IOException Thrown if an I/O error occurs + *constructing the object streams. + */ + Client(Socket s) + throws IOException + { + this.sock = s; + this.out= new ObjectOutputStream(new BufferedOutputStream(this.sock.getOutputStream())); + this.out.flush(); + this.in = new ObjectInputStream(new BufferedInputStream(this.sock.getInputStream())); + } + + /** + * The main threads processing routine. This loop processes + * requests from the server and sends the appropriate responses + * based upon the results. + */ + public void run() + { + int code = 0; + boolean closed = false; + ConnectionToken connectionToken = null; + + while (!closed running) + { +try +{ + // read in the next request/directive + // from the client + // + code = in.readByte(); +} +catch (EOFException e) +{ + // end of file, exit processing loop + // + break; +} +catch (IOException e) +{ + if(closed || !running) + { + // exit out of the loop if the connection + // is closed or the service is shutdown + // + break; + } + log.warn(Connection failure (1)., e); + break
[JBoss-dev] SpyTextMessage StringBuffer allocation!? (Memory Overload!)
I'm busy trying to run our application using JBossMQ and were having some sever memory problems with our application. I've been using OptimizeIt to track down what happening, and I've found that the class SpyTextMessage is using a java.lang.StringBuffer class to read int the UTF text from the ObjectInputStream. For some reason the initial capacity is set to 16K and the comment implies a bug for Strings greater than 64K in Java 1.3.*. From a first blush look one would think that the StringBuffer.toString() would optimize the memory use and chop the buffer size down. But based upon the information I got from OptimizeIt, the toString() method just wraps the already allocated char[] buffer in a String class. The main problem with this is that most of our text message are less that a few hundred bytes. The 16K buffer is killing the MQ server since we send a VERY large number of messages. I'm using the IBM 1.3 JDK: [root@linux-weave-1 OpenNMS]# /opt/IBMJava2-13/bin/java -version java version 1.3.0 Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0) Classic VM (build 1.3.0, J2RE 1.3.0 IBM build cx130-20010626 (JIT enabled: jitc)) Attached are some exported data from the OptimizIt run. Weave Allocation backtraces for class char[]. application org.jboss.Main -- Backtrace of code allocating char[] --- 19025 instances of char[] allocated. 80.64% java.lang.Thread.run() (Thread.java:498) 69.67% org.jboss.mq.il.oil.OILServerILService.run() (OILServerILService.java:213) 62.57% org.jboss.mq.SpyMessage.readMessage() (SpyMessage.java:600) 49.4% org.jboss.mq.SpyTextMessage.readExternal() (SpyTextMessage.java:65) 16.42% org.jboss.mq.SpyMessage.readExternal() (SpyMessage.java:691) 16.42% org.jboss.mq.SpyMessage.readString() (SpyMessage.java:683) 13.61% org.jboss.mq.SpyMessage.readExternal() (SpyMessage.java:712) 8.21% org.jboss.mq.SpyMessage.readExternal() (SpyMessage.java:707) 6.18% org.jboss.mq.SpyMessage.readExternal() (SpyMessage.java:738) 4.96% org.jboss.mq.SpyMessage.readExternal() (SpyMessage.java:687) 0.01% org.jboss.mq.SpyMessage.readExternal() (SpyMessage.java:702) 8.21% org.jboss.mq.SpyTextMessage.readExternal() (SpyTextMessage.java:76) 8.21% java.lang.StringBuffer.StringBuffer() (StringBuffer.java:122) 4.95% org.jboss.mq.SpyTextMessage.readExternal() (SpyTextMessage.java:78) 4.95% java.io.ObjectInputStream.readUTF() (ObjectInputStream.java:2112) 3.96% java.io.ObjectInputStream.readUTFBody() (ObjectInputStream.java:2204) 0.73% java.io.ObjectInputStream.readUTFBody() (ObjectInputStream.java:2201) 0.18% java.io.ObjectInputStream.readUTFBody() (ObjectInputStream.java:2155) 0.06% java.io.ObjectInputStream.readUTFBody() (ObjectInputStream.java:2127) 7.1% org.jboss.mq.server.JMSServer.addMessage() (JMSServer.java:381) 3.55% org.jboss.mq.il.oil.OILServerILService.run() (OILServerILService.java:209) 2.16% org.jboss.mq.il.oil.OILServerILService.run() (OILServerILService.java:255) 1.09% org.jboss.mq.il.oil.OILServerILService.run() (OILServerILService.java:254) 0.85% org.jboss.mq.il.oil.OILServerILService.run() (OILServerILService.java:284) 0.52% org.jboss.mq.il.oil.OILServerILService.run() (OILServerILService.java:204) 0.44% sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run() (TCPTransport.java:662) 0.42% org.jboss.mq.il.oil.OILServerILService.run() (OILServerILService.java:267) 0.42% org.jboss.deployment.AutoDeployer.run() (AutoDeployer.java:251) 0.39% org.jboss.mq.il.oil.OILServerILService.run() (OILServerILService.java:235) 0.26% org.jboss.mq.il.oil.OILServerILService.run() (OILServerILService.java:250) 0.25% org.jboss.mq.il.oil.OILServerILService.run() (OILServerILService.java:247) 0.19% org.jboss.mq.il.oil.OILServerILService.run() (OILServerILService.java:161) 0.13% org.jboss.mq.il.oil.OILServerILService.run() (OILServerILService.java:165) 0.03% org.jboss.mq.il.oil.OILServerILService.run() (OILServerILService.java:148) 0.03% org.jboss.mq.il.uil.UILServerILService.run() (UILServerILService.java:149) 0.03% sun.rmi.transport.tcp.TCPTransport.run() (TCPTransport.java:338) 0.02% org.jboss.mq.il.oil.OILServerILService.run() (OILServerILService.java:210) 0.02% sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run() (TCPTransport.java:658) 0.02% org.jboss.mq.il.oil.OILServerILService.run() (OILServerILService.java:238) 0.01% org.jboss.mq.il.oil.OILServerILService.run() (OILServerILService.java:258) 0.01% org.jboss.mq.il.oil.OILServerILService.run() (OILServerILService.java:222) 0.01%
[JBoss-dev] CVS update: jbossmq/src/main/org/jboss/mq SpyTextMessage.java
User: weave Date: 01/11/02 15:06:47 Modified:src/main/org/jboss/mq SpyTextMessage.java Log: Modified the readExternl() method to check the number of available chunks. If there is only one chuck available then the initial capacity of the StringBuffer is set to the number of available bytes. This was necessary to avoid small messages from allocating large buffers. In addition when testing with the IBM JDK the toString() method of the StringBuffer class appeared to implement a copy-on-write char[] sharing. This meant that if a large buffer was allocate it would not be reduced to the message size since the StringBuffer was not modified after the toString() call. I'm still concerned that if the last chunk is realitively small then there may be a fair amount of wasted space. This would become a smaller precent as the number of chunks grow. Revision ChangesPath 1.5 +5 -2 jbossmq/src/main/org/jboss/mq/SpyTextMessage.java Index: SpyTextMessage.java === RCS file: /cvsroot/jboss/jbossmq/src/main/org/jboss/mq/SpyTextMessage.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- SpyTextMessage.java 2001/10/28 04:07:34 1.4 +++ SpyTextMessage.java 2001/11/02 23:06:46 1.5 @@ -18,7 +18,7 @@ * * @author Norbert Lataille ([EMAIL PROTECTED]) * @createdAugust 16, 2001 - * @version$Revision: 1.4 $ + * @version$Revision: 1.5 $ */ public class SpyTextMessage extends SpyMessage @@ -73,7 +73,10 @@ // a StringBuffer that can hold all chunks, read the chunks // into the buffer and set 'content' accordingly int chunksToRead = in.readInt(); - StringBuffer sb = new StringBuffer(chunkSize * chunksToRead); + int bufferSize = chunkSize * chunksToRead; + if(chunksToRead = 1) +bufferSize = Math.min(in.available(), bufferSize); + StringBuffer sb = new StringBuffer(bufferSize); for (int i = 0; i chunksToRead; i++) { sb.append( in.readUTF() ); } ___ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development