12 Replies Latest reply on Nov 9, 2009 10:10 PM by Yong Hao Gao

    Problem with VERSION in default package

    David Hosier Newbie

      We have a NetBeans client application which involves some JMS client code. We just migrated to JBoss 5.1 (with JBoss Messaging 1.4.3), and now we get JMS failures because NetBeans does not allow access to things in the default package. You can see from the following stack trace the JBM code does in fact load version information from a file named VERSION at the root of the jboss-messaging-client.jar. Sorry...the guy who pasted this to me didn't drag over far enough in the Windows console window, so some of the text is truncated on the right side.

      [exec] java.lang.IllegalStateException: You are trying to access file: VERSION from the default package. Please see http
      /www.netbeans.org/download/dev/javadoc/org-openide-modules/org/openide/modules/doc-files/classpath.html#default_package
       [exec] at org.netbeans.ProxyClassLoader.printDefaultPackageWarning(ProxyClassLoader.java:539)
       [exec] at org.netbeans.ProxyClassLoader.getResource(ProxyClassLoader.java:312)
       [exec] at java.lang.ClassLoader.getResourceAsStream(ClassLoader.java:1168)
       [exec] at org.jboss.messaging.util.Version.load(Version.java:130)
       [exec] at org.jboss.messaging.util.Version.<init>(Version.java:56)
       [exec] at org.jboss.messaging.util.Version.instance(Version.java:69)
       [exec] at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate.getVersionToUse(ClientConnectionFactoryDeleg
      e.java:91)
       [exec] at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate.org$jboss$jms$client$delegate$ClientConnecti
      FactoryDelegate$getClientAOPStack$aop(ClientConnectionFactoryDelegate.java:220)
       [exec] at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate.getClientAOPStack(ClientConnectionFactoryDel
      ate.java)
       [exec] at org.jboss.jms.client.ClientAOPStackLoader.load(ClientAOPStackLoader.java:75)
       [exec] at org.jboss.jms.client.JBossConnectionFactory.createConnectionInternal(JBossConnectionFactory.java:192)
       [exec] at org.jboss.jms.client.JBossConnectionFactory.createTopicConnection(JBossConnectionFactory.java:115)
       [exec] at org.jboss.jms.client.JBossConnectionFactory.createTopicConnection(JBossConnectionFactory.java:109)
       [exec] at com.osi.solutions.framework.services.logging.client.LogTopicPublisher.initConnectionStuff(LogTopicPublishe
      java:85)
       [exec] at com.osi.solutions.framework.services.logging.client.LogTopicPublisher.init(LogTopicPublisher.java:59)
       [exec] at com.osi.solutions.framework.services.logging.client.LogPublisherFactory.getPublisher(LogPublisherFactory.j
      a:56)
       [exec] at com.osi.solutions.framework.services.logging.client.JMSLogAppender.append(JMSLogAppender.java:64)
       [exec] at org.apache.log4j.AppenderSkeleton.doAppend(AppenderSkeleton.java:230)
       [exec] at org.apache.log4j.helpers.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:65)
       [exec] at org.apache.log4j.Category.callAppenders(Category.java:203)
       [exec] at org.apache.log4j.Category.forcedLog(Category.java:388)
       [exec] at org.apache.log4j.Category.info(Category.java:663)
       [exec] at com.osi.solutions.framework.services.logging.common.RemoteLoggerFactory.logInfoMessage(RemoteLoggerFactory
      ava:45)
       [exec] at com.osi.solutions.platform.main.login.Installer.initLogger(Installer.java:432)
       [exec] at com.osi.solutions.platform.main.login.Installer.restored(Installer.java:127)
       [exec] at org.netbeans.core.startup.NbInstaller.loadCode(NbInstaller.java:419)
       [exec] at org.netbeans.core.startup.NbInstaller.load(NbInstaller.java:340)
       [exec] at org.netbeans.ModuleManager.enable(ModuleManager.java:906)
       [exec] at org.netbeans.core.startup.ModuleList.installNew(ModuleList.java:428)
       [exec] at org.netbeans.core.startup.ModuleList.trigger(ModuleList.java:364)
       [exec] at org.netbeans.core.startup.ModuleSystem.restore(ModuleSystem.java:276)
       [exec] at org.netbeans.core.startup.Main.getModuleSystem(Main.java:165)
       [exec] at org.netbeans.core.startup.Main.start(Main.java:312)
       [exec] at org.netbeans.core.startup.TopThreadGroup.run(TopThreadGroup.java:110)
       [exec] at java.lang.Thread.run(Thread.java:619)
      


      We subsequently attempt to send JMS messages and that code fails with the following exception:

      [exec] Caused by: java.lang.RuntimeException: org.jboss.aop.advice.org.jboss.jms.client.container.SessionAspect_z_handle
      edeliver_22700073: frozen class (cannot edit)
       [exec] at javassist.ClassPool.checkNotFrozen(ClassPool.java:568)
       [exec] at javassist.ClassPool.makeClass(ClassPool.java:746)
       [exec] at javassist.ClassPool.makeClass(ClassPool.java:731)
       [exec] at org.jboss.aop.instrument.TransformerCommon.makeClass(TransformerCommon.java:239)
       [exec] at org.jboss.aop.advice.PerVmAdvice.generateInterceptor(PerVmAdvice.java:145)
       [exec] at org.jboss.aop.advice.PerVmAdvice.generateOptimized(PerVmAdvice.java:56)
       [exec] at org.jboss.aop.advice.AdviceFactory.create(AdviceFactory.java:106)
       [exec] at org.jboss.aop.Advisor.createInterceptorChain(Advisor.java:1323)
       [exec] at org.jboss.aop.Advisor.pointcutResolved(Advisor.java:1937)
       [exec] at org.jboss.aop.MethodMatchInfo.applyBinding(MethodMatchInfo.java:152)
       [exec] at org.jboss.aop.MethodMatchInfo.simplePopulateBindings(MethodMatchInfo.java:113)
       [exec] at org.jboss.aop.MethodMatchInfo.populateBindings(MethodMatchInfo.java:96)
       [exec] at org.jboss.aop.Advisor.finalizeMethodChain(Advisor.java:1548)
       [exec] at org.jboss.aop.ClassAdvisor.finalizeChains(ClassAdvisor.java:741)
       [exec] at org.jboss.aop.ClassAdvisor.createInterceptorChains(ClassAdvisor.java:609)
       [exec] at org.jboss.aop.ClassAdvisor$1.run(ClassAdvisor.java:306)
       [exec] at java.security.AccessController.doPrivileged(Native Method)
       [exec] at org.jboss.aop.ClassAdvisor.attachClass(ClassAdvisor.java:276)
       [exec] at org.jboss.aop.AspectManager.initialiseClassAdvisor(AspectManager.java:748)
       [exec] at org.jboss.aop.AspectManager.getAdvisor(AspectManager.java:729)
       [exec] at org.jboss.jms.client.delegate.ClientSessionDelegate.<clinit>(ClientSessionDelegate.java)
       [exec] ... 55 more
      


      I suspect the two are related, but I'm still tracing through the code to see if I can tell for sure. I guess I'm looking for any suggestions on how to get around this issue. It seems like the ideal solution is to move the VERSION file into a package in the jar, but maybe there's something I don't understand. As far as I can tell from looking at the code, rebuilding the jar with the VERSION file in a package will not work. I think I would need to also change the Version.instance() line 69 to include that package
      singleton = new Version("VERSION");


      Hopefully someone will have some helpful suggestions. Thanks.