Announcement Announcement Module
Collapse
No announcement yet.
Apache's Geronimo Spring module Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Apache's Geronimo Spring module

    I found that there is a module named "Geronimo :: Spring" in Apache's Geronimo(http://geronimo.apache.org/modules/spring/index.html). Just curious is it our "spring"?

  • #2
    Yes
    Here are some more materials:
    blog entry
    Developer mailing list

    Enjoy!!

    Comment


    • #3
      geronimo spring modules

      I'm working around to find out how to deploy a simple spring application on geronimo. I take a look on geronimo modules spring-geronimo and geronimo-spring-builder, read something on forum and I try start to create a simple springappl.spr( a jar + manifest with classpath + spring.xml) running on Geronimo-1.0-M4 from Eclipse start a minimal geronimo configuration and start the module SpringDeployer..seeems to work if I use class from archive but when I build archive springjms-0.1.spr in which i put :

      META-INF/

      META-INF/MANIFEST.MF
      Code:
      (
      Class-Path:  geronimo-spec-jms-1.1-rc4.jar geronimo-kernel-1.0-M4.jar 
       geronimo-transaction-1.0-M4.jar commons-logging-1.0.4.jar concurrent-
       1.3.4.jar mx4j-3.0.1.jar cglib-nodep-2.1.jar spring-1.1.3.jar activem
       q-core-3.1-M5.jar
      )
      META-INF/bootstrap.properties
      Code:
      (
      jms.connectionFactoryName=ConnectionFactory
      jms.jndiProviderUrl=tcp://localhost:61616
      jms.jndiContextFactory=org.activemq.jndi.ActiveMQInitialContextFactory
      jms.weatherTopic=weatherTopic
      jms.weatherRequestsTopic=weatherRequestsTopic
      )
      META-INF/spring.xml
      Code:
      (
      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http&#58;//www.springframework.org/dtd/spring-beans.dtd">
      
      <beans>
      
              <bean id="placeholderConfig"
                      class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
                      <property name="location">
                              <value>classpath&#58;/bootstrap.properties</value>
                      </property>
              </bean>
      
              <bean id="jndiTemplate"
                      class="org.springframework.jndi.JndiTemplate">
                      <property name="environment">
                              <props>
                                      <prop key="java.naming.factory.initial">
                                              $&#123;jms.jndiContextFactory&#125;
                                      </prop>
      
                                      <!-- Specific to ActiveMQ -->
      
                                      <!-- the address of the ActiveMQ broker -->
                                      <prop key="brokerURL">$&#123;jms.jndiProviderUrl&#125;</prop>
                                      <!-- Some Topics Registration, since we are using a fake JNDI implementation 
                                      <prop key="topic.$&#123;jms.weatherTopic&#125;">
                                              $&#123;jms.weatherTopic&#125;
                                      </prop>
                                      <prop key="topic.$&#123;jms.weatherRequestsTopic&#125;">
                                              $&#123;jms.weatherRequestsTopic&#125;
                                      </prop>-->
                              </props>
                      </property>
              </bean>
      </beans>
      &#41;
      SpringJmsTemplate.class
      Code:
      import org.apache.geronimo.gbean.GBeanInfo;
      import org.apache.geronimo.gbean.GBeanInfoBuilder;
      import org.springframework.jms.core.JmsTemplate;
      
      public class SpringJmsTemplate implements Runnable&#123;
      
      	private JmsTemplate jmsTemplate;
      	
          public SpringJmsTemplate&#40;&#41; &#123;
          &#125;
      
          public void run&#40;&#41; &#123;
          	boolean loop=true;
          	while&#40;loop&#41;&#123;
          		try &#123;
              		jmsTemplate.receive&#40;&#41;;
      			&#125; catch &#40;Exception e&#41; &#123;
      				e.printStackTrace&#40;&#41;;
      				loop = false;
      			&#125;
          	&#125;
          	
          &#125;
          public static final GBeanInfo GBEAN_INFO;
      
          static &#123;
              GBeanInfoBuilder infoFactory = new   GBeanInfoBuilder&#40;SpringJmsTemplate.class, "SpringJmsTemplate"&#41;;
      
              //        infoFactory.addAttribute&#40;"kernel", Kernel.class, false&#41;;
              //        infoFactory.addAttribute&#40;"objectName", String.class, false&#41;;
      
              infoFactory.setConstructor&#40;new String&#91;&#93;&#123;&#125;&#41;;
      
              GBEAN_INFO = infoFactory.getBeanInfo&#40;&#41;;
          &#125;
      
          public static GBeanInfo getGBeanInfo&#40;&#41; &#123;
              return GBEAN_INFO;
          &#125;
      
      	public JmsTemplate getJmsTemplate&#40;&#41; &#123;
      		return jmsTemplate;
      	&#125;
      
      	public void setJmsTemplate&#40;JmsTemplate jmsTemplate&#41; &#123;
      		this.jmsTemplate = jmsTemplate;
      	&#125;
      &#125;
      spring-jms-plan.xml
      Code:
      <?xml version="1.0" encoding="UTF-8"?>
      
      <configuration
          xmlns="http&#58;//geronimo.apache.org/xml/ns/deployment"
          configId="deployment/SpringJmsTemplate"
          >
      
              <dependency>
              <!--  
                  <groupId>geronimo-spec</groupId>
                  <artifactId>geronimo-spec-jms</artifactId>
                  <version>1.1-rc4</version>
                      -->            
                  <uri>geronimo-spec/jars/geronimo-spec-jms-1.1-rc4.jar</uri>
              </dependency>
      
              <dependency>
              <!-- 
                  <groupId>geronimo</groupId>
                  <artifactId>geronimo-kernel</artifactId>
                  <version>1.0-M4</version>
                   -->
                  <uri>geronimo/jars/geronimo-kernel-1.0-M4.jar</uri>
              </dependency>
      
              <dependency>
      <!--  
                  <groupId>geronimo</groupId>
                  <artifactId>geronimo-transaction</artifactId>
                  <version>1.0-M4</version>
      -->            
                  <uri>geronimo/jars/geronimo-transaction-1.0-M4.jar</uri>
              </dependency>
      
              <!-- Thirdparty Dependencies -->
              <dependency>
      <!--          
                  <groupId>commons-logging</groupId>
                  <artifactId>commons-logging</artifactId>
                  <version>1.0.3</version>
      -->            
                  <uri>commons-logging/jars/commons-logging-1.0.3.jar</uri>
              </dependency>
      
              <dependency>
      <!--         
                  <groupId>concurrent</groupId>
                  <artifactId>concurrent</artifactId>
                  <version>1.3.4</version>
       -->            
                  <uri>concurrent/jars/concurrent-1.3.4.jar</uri>
              </dependency>
      
              <dependency>
      <!--          
                  <groupId>mx4j</groupId>
                  <artifactId>mx4j</artifactId>
                  <version>3.0.1</version>
      -->            
                  <uri>mx4j/jars/mx4j-3.0.1.jar</uri>
              </dependency>
      
              <dependency>
      <!--          
                  <groupId>cglib</groupId>
                  <artifactId>cglib-nodep</artifactId>
                  <version>2.1</version>
      -->            
                  <uri>cglib/jars/cglib-nodep-2.1.jar</uri>
              </dependency>
      
            <dependency>
      <!--       
              <id>springframework</id>
              <artifactId>spring</artifactId>
              <version>1.1.3</version>
      -->        
                  <uri>springframework/jars/spring-1.1.3.jar</uri>
            </dependency>
      <!--  
            <dependency>
              <id>activemq</id>
              <artifactId>activemq-gbean</artifactId>
              <version>3.1-M5</version>
            </dependency>
       -->     
            <dependency>
      <!--
              <id>activemq</id>
              <artifactId>activemq-core</artifactId>
              <version>3.1-M5</version>
      -->              
               <uri>activemq/jars/activemq-core-3.1-M5.jar</uri>
            </dependency>
      
          <gbean name="SpringJmsTemplate" 
                 class="SpringJmsTemplate" >
             </gbean>    
      </configuration>
      error from console

      11:09:29,701 INFO [SPRConfigBuilder] Planning: c:\temp\deployer6526.tmpdir\springjms-0.1.spr
      11:09:29,701 INFO [SPRConfigBuilder] getDeploymentPlan : planFile -> C:\geronimo-1.0-M4\modules\assembly\target\geronimo-1.0-M4\spring-jms-plan.xml sprFilec:\temp\deployer6526.tmpdir\springjms-0.1.spr
      11:09:29,701 INFO [SPRConfigBuilder] Building: c:\temp\deployer6526.tmpdir\springjms-0.1.spr
      11:09:29,826 INFO [LocalConfigStore:config-store] Installed configuration file:c:%5Ctemp%5Cdeployer6526.tmpdir%5Cspringjms-0.1.spr in location 20
      11:09:29,873 INFO [LocalConfigStore:config-store] Loaded Configuration geronimo.config:name="file:c:%5Ctemp%5Cdeployer652 6.tmpdir%5Cspringjms-0.1.spr"
      11:09:29,888 DEBUG [GBeanInstanceState] GBeanInstanceState for: geronimo.config:name="file:c:%5Ctemp%5Cdeployer652 6.tmpdir%5Cspringjms-0.1.spr" State changed from stopped to starting
      11:09:29,888 DEBUG [Configuration] ClassPath for file:c:%5Ctemp%5Cdeployer6526.tmpdir%5Cspringjms-0.1.spr resolved to []
      11:09:29,888 INFO [Configuration] Started configuration file:c:%5Ctemp%5Cdeployer6526.tmpdir%5Cspringjms-0.1.spr
      11:09:29,888 DEBUG [GBeanInstanceState] GBeanInstanceState for: geronimo.config:name="file:c:%5Ctemp%5Cdeployer652 6.tmpdir%5Cspringjms-0.1.spr" State changed from starting to running
      11:09:29,951 INFO [PersistentConfigurationList] Saved running configuration list
      11:09:29,951 DEBUG [GBeanInstanceState] GBeanInstanceState for: geronimo.config:name=spring-jms-plan.xml State changed from stopped to starting
      11:09:29,951 DEBUG [GBeanInstanceState] GBeanInstanceState for: geronimo.config:name=spring-jms-plan.xml State changed from starting to running
      11:09:30,013 INFO [PersistentConfigurationList] Saved running configuration list
      11:09:30,013 DEBUG [GBeanInstanceState] GBeanInstanceState for: geronimo.server:name=spring-jms-plan.xml,J2EEServer=geronimo,J2EEApplication=null, j2eeType=SpringModule State changed from stopped to starting
      11:09:30,013 INFO [SpringGBean] _classPath[0]: file:/C:/geronimo-1.0-M4/modules/assembly/target/geronimo-1.0-M4/config-store/20/
      11:09:30,076 INFO [XmlBeanDefinitionReader] Loading XML bean definitions from class path resource [META-INF/spring.xml]
      11:09:30,076 DEBUG [XmlBeanDefinitionReader] Using JAXP implementation [org.apache.xerces.jaxp.DocumentBuilderFactoryImpl@ 15bd8f]
      11:09:30,732 DEBUG [BeansDtdResolver] Trying to resolve XML entity with public ID [-//SPRING//DTD BEAN//EN] and system ID [http://www.springframework.org/dtd/spring-beans.dtd]
      11:09:30,732 DEBUG [BeansDtdResolver] Trying to locate [spring-beans.dtd] under [/org/springframework/beans/factory/xml/]
      11:09:30,732 DEBUG [BeansDtdResolver] Found beans DTD [http://www.springframework.org/dtd/spring-beans.dtd] in classpath
      11:09:30,795 DEBUG [DefaultXmlBeanDefinitionParser] Loading bean definitions
      11:09:30,810 DEBUG [DefaultXmlBeanDefinitionParser] Default lazy init 'false'
      11:09:30,810 DEBUG [DefaultXmlBeanDefinitionParser] Default dependency check 'none'
      11:09:30,810 DEBUG [DefaultXmlBeanDefinitionParser] Default autowire 'no'
      11:09:30,857 DEBUG [DefaultXmlBeanDefinitionParser] Found 2 <bean> elements defining beans
      11:09:30,857 INFO [SpringGBean$GeronimoBeanFactory] Creating shared instance of singleton bean 'jndiTemplate'
      11:09:30,857 DEBUG [SpringGBean$GeronimoBeanFactory] Creating instance of bean 'jndiTemplate' with merged definition [Root bean with class [org.springframework.jndi.JndiTemplate] defined in class path resource [META-INF/spring.xml]]
      11:09:30,920 DEBUG [CachedIntrospectionResults] Getting BeanInfo for class [org.springframework.jndi.JndiTemplate]
      11:09:30,920 DEBUG [CachedIntrospectionResults] Caching PropertyDescriptors for class [org.springframework.jndi.JndiTemplate]
      11:09:30,920 DEBUG [CachedIntrospectionResults] Found property 'class' of type [java.lang.Class]
      11:09:30,920 DEBUG [CachedIntrospectionResults] Found property 'environment' of type [java.util.Properties]
      11:09:30,920 DEBUG [CachedIntrospectionResults] Class [org.springframework.jndi.JndiTemplate] is cache-safe
      11:09:30,920 DEBUG [BeanWrapperImpl] About to invoke write method [public void org.springframework.jndi.JndiTemplate.setEnvironme nt(java.util.Properties)] on object of class [org.springframework.jndi.JndiTemplate]
      11:09:30,920 DEBUG [BeanWrapperImpl] Invoked write method [public void org.springframework.jndi.JndiTemplate.setEnvironme nt(java.util.Properties)] with value of type [java.util.Properties]
      11:09:30,920 DEBUG [SpringGBean$GeronimoBeanFactory] Invoking BeanPostProcessors before initialization of bean 'jndiTemplate'
      11:09:30,920 DEBUG [SpringGBean$GeronimoBeanFactory] Invoking BeanPostProcessors after initialization of bean 'jndiTemplate'
      11:09:30,951 INFO [SpringGBean$GeronimoBeanFactory] Destroying singletons in factory {org.apache.geronimo.spring.SpringGBean$GeronimoBe anFactory defining beans [placeholderConfig,jndiTemplate]; root of BeanFactory hierarchy}
      11:09:30,951 INFO [SpringGBean$GeronimoBeanFactory] Destroying inner beans in factory {org.apache.geronimo.spring.SpringGBean$GeronimoBe anFactory defining beans [placeholderConfig,jndiTemplate]; root of BeanFactory hierarchy}
      11:09:30,951 ERROR [GBeanInstanceState] Error while starting; GBean is now in the FAILED state: objectName="geronimo.server:name=spring-jms-plan.xml,J2EEServer=geronimo,J2EEApplication=null, j2eeType=SpringModule"
      org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'jndiTemplate' defined in class path resource [META-INF/spring.xml]: Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: org/springframework/jndi/JndiCallback
      java.lang.NoClassDefFoundError: org/springframework/jndi/JndiCallback
      at java.lang.Class.getDeclaredMethods0(Native Method)
      at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
      at java.lang.Class.privateGetPublicMethods(Unknown Source)
      at java.lang.Class.getMethods(Unknown Source)
      at sun.misc.ProxyGenerator.generateClassFile(Unknown Source)
      at sun.misc.ProxyGenerator.generateProxyClass(Unknown Source)
      at java.lang.reflect.Proxy.getProxyClass(Unknown Source)
      at org.apache.geronimo.spring.SpringGBean.createProxy Class(SpringGBean.java:373)
      at org.apache.geronimo.spring.SpringGBean.createPOJOG BeanData(SpringGBean.java:322)
      at org.apache.geronimo.spring.SpringGBean.afterInitia lization(SpringGBean.java:258)
      at org.apache.geronimo.spring.SpringGBean$1.postProce ssAfterInitialization(SpringGBean.java:160)
      at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.applyBeanPostProcessors AfterInitialization(AbstractAutowireCapableBeanFac tory.java:202)
      at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:306)
      at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:223)
      at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:236)
      at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:159)
      at org.apache.geronimo.spring.SpringGBean.doStart(Spr ingGBean.java:168)
      at org.apache.geronimo.gbean.runtime.GBeanInstance.cr eateInstance(GBeanInstance.java:850)
      at org.apache.geronimo.gbean.runtime.GBeanInstanceSta te.attemptFullStart(GBeanInstanceState.java:328)
      at org.apache.geronimo.gbean.runtime.GBeanInstanceSta te.start(GBeanInstanceState.java:111)
      at org.apache.geronimo.gbean.runtime.GBeanInstanceSta te.startRecursive(GBeanInstanceState.java:133)
      at org.apache.geronimo.gbean.runtime.GBeanInstance.st artRecursive(GBeanInstance.java:503)
      at org.apache.geronimo.kernel.basic.BasicKernel.start RecursiveGBean(BasicKernel.java:205)
      at org.apache.geronimo.gbean.runtime.GBeanInstanceSta te.startRecursive(GBeanInstanceState.java:141)
      at org.apache.geronimo.gbean.runtime.GBeanInstance.st artRecursive(GBeanInstance.java:503)
      at org.apache.geronimo.kernel.basic.BasicKernel.start RecursiveGBean(BasicKernel.java:205)
      at org.apache.geronimo.kernel.KernelGBean.startRecurs iveGBean(KernelGBean.java:72)
      at org.apache.geronimo.kernel.KernelGBean$$FastClassB yCGLIB$$1cccefc9.invoke(<generated>)
      at net.sf.cglib.reflect.FastMethod.invoke(FastMethod. java:53)
      at org.apache.geronimo.gbean.runtime.FastMethodInvoke r.invoke(FastMethodInvoker.java:38)
      at org.apache.geronimo.gbean.runtime.GBeanOperation.i nvoke(GBeanOperation.java:118)
      at org.apache.geronimo.gbean.runtime.GBeanInstance.in voke(GBeanInstance.java:754)
      at org.apache.geronimo.kernel.basic.BasicKernel.invok e(BasicKernel.java:175)
      at org.apache.geronimo.kernel.jmx.MBeanServerDelegate .invoke(MBeanServerDelegate.java:117)
      at javax.management.remote.rmi.RMIConnectionImpl.doOp eration(Unknown Source)
      at javax.management.remote.rmi.RMIConnectionImpl.acce ss$100(Unknown Source)
      at javax.management.remote.rmi.RMIConnectionImpl$Priv ilegedOperation.run(Unknown Source)
      at java.security.AccessController.doPrivileged(Native Method)
      at javax.management.remote.rmi.RMIConnectionImpl.doPr ivilegedOperation(Unknown Source)
      at javax.management.remote.rmi.RMIConnectionImpl.invo ke(Unknown Source)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknow n Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Un known Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
      at sun.rmi.transport.Transport$1.run(Unknown Source)
      at java.security.AccessController.doPrivileged(Native Method)
      at sun.rmi.transport.Transport.serviceCall(Unknown Source)
      at sun.rmi.transport.tcp.TCPTransport.handleMessages( Unknown Source)
      at sun.rmi.transport.tcp.TCPTransport$ConnectionHandl er.run(Unknown Source)
      at java.lang.Thread.run(Unknown Source)
      11:09:30,951 DEBUG [GBeanInstanceState] GBeanInstanceState for: geronimo.server:name=spring-jms-plan.xml,J2EEServer=geronimo,J2EEApplication=null, j2eeType=SpringModule State changed from starting to failed
      11:12:57,680 DEBUG [JDBCPersistenceAdapter] Cleaning up old messages.
      11:12:57,680 DEBUG [JDBCPersistenceAdapter] Cleanup done.
      11:12:58,242 DEBUG [JournalPersistenceAdapter] Checkpoint started.
      11:12:58,242 DEBUG [JournalPersistenceAdapter] Checkpoint done.

      [/code]

      Any idea?

      Comment


      • #4
        java.lang.NoClassDefFoundError: org/springframework/jndi/JndiCallback
        Obviously there is a configuration issue - try to get more help on the geronimo lists.

        Comment


        • #5
          Thanks. I already wrote on geronimo forums but the only think I understand is that SpringGBean.getProxyClass is not passing a ClassLoader with access to the Spring library to the Proxy factory.
          I'm not totally sure what's happening in the SpringGBean code and whether there's something you can configure to work around this. I guess we need to look at that class in more detail. Does anyone know more about it?

          Comment

          Working...
          X