Announcement Announcement Module
Collapse
No announcement yet.
integration problem with hibernate Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    Include catalina-ant.jar file will solve the following exception

    Include catalina-ant.jar file will solve the following exception
    Originally posted by united4life View Post
    I changed my approch and i decided to use transaction with aop and advices but i have a new problem i have a 503 error.here is my context:
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xmlns:p="http://www.springframework.org/schema/p"
           xmlns:aop="http://www.springframework.org/schema/aop"
           xmlns:tx="http://www.springframework.org/schema/tx"
           xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
           http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
           http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">
    
        <!--bean id="propertyConfigurer"
              class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"
              p:location="/WEB-INF/jdbc.properties" />
    
        <bean id="dataSource"
              class="org.springframework.jdbc.datasource.DriverManagerDataSource"
              p:driverClassName="${jdbc.driverClassName}"
              p:url="${jdbc.url}"
              p:username="${jdbc.username}"
              p:password="${jdbc.password}" /-->
    
        <!-- ADD PERSISTENCE SUPPORT HERE (jpa, hibernate, etc) -->
        <bean id="implementationProduit" class="akatsuki.domain.service.implProduit">
            <property name="productDao" ref="produitDaoHibernate"/>
        </bean>
    
        <bean id="produitDaoHibernate" class="akatsuki.domain.repositryimpl.ProduitDaoHibernate" >
            <property name="sessionFactory" ref="SessionFactory"/>
        </bean>
    
    
        <bean id="SessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
            <property name="hibernateProperties">
                <props>
                    <prop key="hibernate.connection.driver_class">com.mysql.jdbc.Driver</prop>
                    <prop key="hibernate.connection.url">jdbc:mysql://localhost:3306/achat</prop>
                    <prop key="hibernate.connection.username">root</prop>
                    <prop key="hibernate.connection.password">bankai</prop>
                    <prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
                </props>
            </property>
    
        </bean>
    
    
        <bean id="TransactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
            <property name="sessionFactory"><ref local="SessionFactory"/></property>
        </bean>
    
        <tx:advice id="adviceCRUD" transaction-manager="TransactionManager">
            <tx:attributes>
                <tx:method name="*" propagation="REQUIRED"/>
            </tx:attributes>
        </tx:advice>
    
        <aop:config>
            <aop:pointcut id="pointCutProduit" expression="execution(* akatsuki.domain.service.*(..))"/>
            <aop:advisor advice-ref="adviceCRUD" pointcut-ref="pointCutProduit"/>
        </aop:config>
    
    </beans>
    Code:
    INFO: Created virtual server server
    INFO: Created virtual server __asadmin
    INFO: Started bundle org.glassfish.deployment.dol [8]
    INFO: Started bundle org.glassfish.web.web-core [123]
    INFO: Dual registration of jndi stream handler: factory already defined
    INFO: Unknown loader 106.0 class org.apache.felix.framework.searchpolicy.ContentClassLoader
    INFO: Started bundle org.glassfish.web.jstl-connector [112]
    INFO: Started bundle org.glassfish.web.jsf-connector [118]
    INFO: Using com.sun.enterprise.transaction.JavaEETransactionManagerSimplifiedDelegate as the delegate
    INFO: Started bundle org.glassfish.connectors.work-management [34]
    INFO: Started bundle org.glassfish.common.glassfish-ee-api [46]
    INFO: Started bundle org.glassfish.connectors.connectors-internal-api [104]
    INFO: policy.loading
    INFO: Started bundle org.glassfish.web.war-util [114]
    INFO: Started bundle org.glassfish.security.websecurity [108]
    INFO: Unknown loader org.glassfish.internal.api.DelegatingClassLoader@1b14530 class org.glassfish.internal.api.DelegatingClassLoader
    INFO: PWC1412: WebModule[/WebApplication1] ServletContext.log():Initializing Spring root WebApplicationContext
    INFO: Root WebApplicationContext: initialization started
    INFO: Refreshing [email protected]13c66d8: display name [Root WebApplicationContext]; startup date [Tue Sep 29 02:26:24 CEST 2009]; root of context hierarchy
    INFO: Loading XML bean definitions from ServletContext resource [/WEB-INF/applicationContext.xml]
    GRAVE: Context initialization failed
    org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from ServletContext resource [/WEB-INF/applicationContext.xml]; nested exception is java.lang.NoClassDefFoundError: org/aspectj/weaver/reflect/ReflectionWorld$ReflectionWorldException
            at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:385)
            at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:313)
            at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:290)
            at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:142)
            at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:158)
            at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124)
            at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:92)
            at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:97)
            at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:411)
            at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:338)
            at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:251)
            at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:190)
            at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)
            at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4623)
            at org.apache.catalina.core.StandardContext.start(StandardContext.java:5323)
            at com.sun.enterprise.web.WebModule.start(WebModule.java:456)
            at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:922)
            at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:906)
            at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:696)
            at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:2205)
            at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1890)
            at com.sun.enterprise.web.WebApplication.start(WebApplication.java:85)
            at com.sun.enterprise.v3.server.ApplicationLifecycle.start(ApplicationLifecycle.java:560)
            at com.sun.enterprise.v3.server.ApplicationLifecycle.start(ApplicationLifecycle.java:547)
            at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:189)
            at com.sun.enterprise.v3.server.ApplicationLoaderService.processApplication(ApplicationLoaderService.java:260)
            at com.sun.enterprise.v3.server.ApplicationLoaderService.postConstruct(ApplicationLoaderService.java:97)
            at com.sun.enterprise.v3.server.ApplicationLoaderInjector.postConstruct(ApplicationLoaderInjector.java:61)
            at com.sun.hk2.component.AbstractWombImpl.inject(AbstractWombImpl.java:150)
            at com.sun.hk2.component.ConstructorWomb$1.run(ConstructorWomb.java:90)
            at java.security.AccessController.doPrivileged(Native Method)
            at com.sun.hk2.component.ConstructorWomb.initialize(ConstructorWomb.java:87)
            at com.sun.hk2.component.AbstractWombImpl.get(AbstractWombImpl.java:75)
            at com.sun.hk2.component.SingletonInhabitant.get(SingletonInhabitant.java:58)
            at com.sun.hk2.component.LazyInhabitant.get(LazyInhabitant.java:107)
            at com.sun.hk2.component.AbstractInhabitantImpl.get(AbstractInhabitantImpl.java:60)
            at com.sun.enterprise.v3.server.AppServerStartup.run(AppServerStartup.java:203)
            at com.sun.enterprise.v3.server.AppServerStartup$1.run(AppServerStartup.java:116)
    Caused by: java.lang.NoClassDefFoundError: org/aspectj/weaver/reflect/ReflectionWorld$ReflectionWorldException
            at java.lang.Class.forName0(Native Method)
            at java.lang.Class.forName(Class.java:169)
            at org.springframework.aop.config.ConfigBeanDefinitionParser.class$(ConfigBeanDefinitionParser.java:209)
            at org.springframework.aop.config.ConfigBeanDefinitionParser.createPointcutDefinition(ConfigBeanDefinitionParser.java:535)
            at org.springframework.aop.config.ConfigBeanDefinitionParser.parsePointcut(ConfigBeanDefinitionParser.java:472)
            at org.springframework.aop.config.ConfigBeanDefinitionParser.parse(ConfigBeanDefinitionParser.java:143)
            at org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(NamespaceHandlerSupport.java:69)
    when i remove the aop:config tag i dont have the 503 error.

    Comment

    Working...
    X