0 Replies Latest reply on Nov 14, 2011 8:17 AM by Piyush Bhatt

    JBoss 5.1.0 hangs while deploying

    Piyush Bhatt Newbie

      Hi,

       

      I have a war which uses the SimpleFramework api. During the start up I am reading an XML file as a resource stream and then doing a deserialization to get the object. While running the test the same code executes fine but while deploying it in JBoss it hangs during the startup. The sample code is as follows

       

      public static synchronized void init(String resourceName) {

        boolean loadedSuccessfully = loadFromResource(resourceName);

      }

       

       

      private static boolean loadFromResource(String theXMLResourceName) {

      String resourceName = "/" + theXMLResourceName;

                          InputStream resourceStream = IdFactory.class

                                              .getResourceAsStream(resourceName);

                          if (resourceStream != null) {

                                    init(resourceStream);

      }

       

      private static synchronized void init(InputStream theStream) {

                          org.simpleframework.xml.Serializer serializer = new org.simpleframework.xml.load.Persister();

                          try {

                                    logger.info("before serializer read");

                                    IdFactory factory = serializer.read(IdFactory.class, theStream);

                                    logger.info("after serializer read");

                          } catch (Exception e) {

                                    throw new RuntimeException(e);

                          }

                }

       

      Here IdFactory is my custom class. JBoss comes till the "before serializer read" log message and then waits and hangs. The initialization is done through the Listener in web.xml which call the init method

       

      The same thing gets deployed in 4.2.3 GA version without any problem

       

      Regards

      Piyush