facebook

Multiple Spring context files and HQL Editor

  1. MyEclipse Archived
  2.  > 
  3. Database Tools (DB Explorer, Hibernate, etc.)
Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #260483 Reply

    daltons
    Member

    Hi there,

    I want to use the HQL Editor with my multi-spring-config-files, which are named /icope/WebRoot/WEB-INF/ICOPE-*.xml.

    If I open the HQL editor, it pops an error and tell the reason is ” “.

    ie. Reason :

    Funny heh ? The session factory bean has the right name and is in the specified file in the configs.

    Here’s my .springBeans file :

    
    <?xml version="1.0" encoding="UTF-8"?>
    <beansProjectDescription>
        <configExtensions>
            <configExtension>xml</configExtension>
        </configExtensions>
        <configs>
            <config>WebRoot/WEB-INF/ICOPE-servlet.xml</config>
            <config>WebRoot/WEB-INF/ICOPE-data.xml</config>
            <config>WebRoot/WEB-INF/ICOPE-service.xml</config>
            <config>WebRoot/WEB-INF/ICOPE-application.xml</config>
            <config>WebRoot/WEB-INF/ICOPE-security.xml</config>
        </configs>
        <configSets>
        </configSets>
    </beansProjectDescription>
    

    Here’s my .myhibernatedata file :

    #
    #Mon Oct 16 11:54:44 EDT 2006
    genBasicCompId=false
    sessionFactoryName=org.springframework.orm.hibernate3.LocalSessionFactoryBean
    profile=
    daoSFId=
    version=3.2
    jndiPath=
    springDaoFile=
    useJavaTypes=true
    keyGenerator=
    libInstallFolder=
    addLibs2Project=false
    genVersionTag=false
    sessionFactoryId=icope.sessionFactory
    basePersistenceClass=
    reSettingsFile=
    configFile=/icope/WebRoot/WEB-INF/ICOPE-data.xml
    createConfigFile=false
    addLibs2Classpath=false
    baseDaoClass=
    #260487

    Riyad Kalla
    Member

    I’ve asked someone from the hibernate team to have a look. In the mean time check your log flie (<workspace dir>\.metadata\.log) for any exceptions that might shed some light on this for us.

    #260508

    daltons
    Member

    Here’s the error message :

    
    !SESSION 2006-10-16 13:52:47.281 -----------------------------------------------
    eclipse.buildId=M20060629-1905
    java.version=1.5.0_03
    java.vendor=Sun Microsystems Inc.
    BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_CA
    Framework arguments:  -product com.genuitec.myeclipse.product.ide
    Command-line arguments:  -os win32 -ws win32 -arch x86 -clean -product com.genuitec.myeclipse.product.ide
    
    !ENTRY com.genuitec.org.hibernate.eclipse.console 4 4 2006-10-16 13:54:55.609
    !MESSAGE 
    !STACK 0
    java.lang.NullPointerException
        at org.springframework.beans.factory.config.BeanDefinitionVisitor.visitBeanDefinition(BeanDefinitionVisitor.java:57)
        at org.springframework.beans.factory.config.BeanDefinitionVisitor.resolveValue(BeanDefinitionVisitor.java:106)
        at org.springframework.beans.factory.config.BeanDefinitionVisitor.visitPropertyValues(BeanDefinitionVisitor.java:72)
        at org.springframework.beans.factory.config.BeanDefinitionVisitor.visitBeanDefinition(BeanDefinitionVisitor.java:59)
        at org.springframework.beans.factory.config.PropertyPlaceholderConfigurer.processProperties(PropertyPlaceholderConfigurer.java:241)
        at org.springframework.beans.factory.config.PropertyResourceConfigurer.postProcessBeanFactory(PropertyResourceConfigurer.java:75)
        at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:373)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:295)
        at com.genuitec.eclipse.hibernate.tool.MEFileSystemXmlApplicationContext.<init>(MEFileSystemXmlApplicationContext.java:33)
        at com.genuitec.eclipse.hibernate.wizards.MEConsoleConfiguration$1.execute(MEConsoleConfiguration.java:149)
        at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:35)
        at com.genuitec.eclipse.hibernate.wizards.MEConsoleConfiguration.buildWith(MEConsoleConfiguration.java:145)
        at org.hibernate.console.ConsoleConfiguration.build(ConsoleConfiguration.java:100)
        at com.genuitec.eclipse.hibernate.action.MERefreshCCAction$1.run(MERefreshCCAction.java:90)
        at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:113)
    !SUBENTRY 1 com.genuitec.org.hibernate.eclipse.console 4 150 2006-10-16 13:54:55.609
    !MESSAGE <No message>
    
    !ENTRY com.genuitec.org.hibernate.eclipse.console 1 0 2006-10-16 13:54:55.640
    !MESSAGE Could not refresh Hibernate project context com.genuitec.eclipse.hibernate.action.MERefreshCCAction$InProgressException
     
    

    And here’s the sessionFactory Bean :

    
     <bean id="icope.sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
            <property name="dataSource">
                <ref local="icope.dataSource.jdbc" />
            </property>
            <property name="entityInterceptor">
                <bean class="ca.uquebec.icope.data.dao.hibernate.HibernateInterceptor" />
            </property>
            <property name="hibernateProperties">
                <props>
                    <prop key="hibernate.dialect">${hibernate.dialect}</prop>
                    <prop key="hibernate.show_sql">${hibernate.showsql}</prop>
                    <prop key="hibernate.hbm2ddl.auto">${hibernate.hbm2ddl}</prop>
                    <prop key="hibernate.query.substitutions">${hibernate.query.substitutions}</prop>
                    <prop key="hibernate.cache.use_query_cache">${hibernate.cache.use_query_cache}</prop>
                    <prop key="hibernate.default_schema">${hibernate.default_schema}</prop>
                    <prop key="hibernate.cache.use_second_level_cache">${hibernate.cache.use_second_level_cache}</prop>
                    <prop key="hibernate.cache.provider_class">${hibernate.cache.provider_class}</prop>
                    <prop key="hibernate.cache.provider_configuration_file_resource_path">${hibernate.cache.provider_configuration_file_resource_path}</prop>
                    <prop key="hibernate.jdbc.batch_size">${hibernate.jdbc.batch_size}</prop>
                    <prop key="hibernate.max_fetch_depth">${hibernate.max_fetch_depth}</prop>
                    <prop key="hibernate.jdbc.fetch_size">${hibernate.jdbc.fetch_size}</prop>
                    <prop key="hibernate.bytecode.use_reflection_optimizer">${hibernate.bytecode.use_reflection_optimizer}</prop>
                </props>
            </property>
            <property name="mappingDirectoryLocations">
                <list>
                    <value>classpath:/ca/uquebec/icope/data/model</value>
                </list>
            </property>
        </bean>
    
    #260509

    daltons
    Member

    Also, we’re using Spring 2.0. The line numbers in the log don’t fit with the projects’s included jars. Maybe that’s part of the problem…

    #260516

    Haris Peco
    Member

    daltons,

    Please, check with spring 1.2.x.We haven’t tested with spring 2.0, but if your proejct is fine with 1.2.x we can test spring 2.0

    Thanks
    Peco

    #260548

    lucboudreau
    Member

    It doesn’t work with Spring 1.2.8 either. I’ve switched my project libraries AND those of MyEclipse in the Project Capabilities preference pane.

    Log :

    !ENTRY com.genuitec.org.hibernate.eclipse.console 4 4 2006-10-17 09:33:47.343
    !MESSAGE 
    !STACK 0
    java.lang.NullPointerException
        at org.springframework.beans.factory.config.BeanDefinitionVisitor.visitBeanDefinition(BeanDefinitionVisitor.java:57)
        at org.springframework.beans.factory.config.BeanDefinitionVisitor.resolveValue(BeanDefinitionVisitor.java:106)
        at org.springframework.beans.factory.config.BeanDefinitionVisitor.visitPropertyValues(BeanDefinitionVisitor.java:72)
        at org.springframework.beans.factory.config.BeanDefinitionVisitor.visitBeanDefinition(BeanDefinitionVisitor.java:59)
        at org.springframework.beans.factory.config.PropertyPlaceholderConfigurer.processProperties(PropertyPlaceholderConfigurer.java:241)
        at org.springframework.beans.factory.config.PropertyResourceConfigurer.postProcessBeanFactory(PropertyResourceConfigurer.java:75)
        at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:373)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:295)
        at com.genuitec.eclipse.hibernate.tool.MEFileSystemXmlApplicationContext.<init>(MEFileSystemXmlApplicationContext.java:33)
        at com.genuitec.eclipse.hibernate.wizards.MEConsoleConfiguration$1.execute(MEConsoleConfiguration.java:149)
        at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:35)
        at com.genuitec.eclipse.hibernate.wizards.MEConsoleConfiguration.buildWith(MEConsoleConfiguration.java:145)
        at org.hibernate.console.ConsoleConfiguration.build(ConsoleConfiguration.java:100)
        at com.genuitec.eclipse.hibernate.action.MERefreshCCAction$1.run(MERefreshCCAction.java:90)
        at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:113)
    !SUBENTRY 1 com.genuitec.org.hibernate.eclipse.console 4 150 2006-10-17 09:33:47.343
    !MESSAGE <No message>
    
    #260549

    lucboudreau
    Member

    In Spring 1.2.8, the NullPointerException (on line 57) happens the this finction is executed :

    
    /**
         * Traverse the given BeanDefinition object and the MutablePropertyValues
         * and ConstructorArgumentValues contained in them.
         * @param beanDefinition the BeanDefinition object to traverse
         * @see #resolveStringValue(String)
         */
        public void visitBeanDefinition(BeanDefinition beanDefinition) {
            MutablePropertyValues pvs = beanDefinition.getPropertyValues(); //*** RIGHT HERE
            if (pvs != null) {
                visitPropertyValues(pvs);
            }
            ConstructorArgumentValues cas = beanDefinition.getConstructorArgumentValues();
            if (cas != null) {
                visitIndexedArgumentValues(cas.getIndexedArgumentValues());
                visitGenericArgumentValues(cas.getGenericArgumentValues());
            }
        }
    
    #260552

    Haris Peco
    Member

    Hi,

    Please, send me your MyEclipse and eclipse version and if it is possible your project on support@genuitec.com with subject ATTN: snpe

    Thanks,
    Peco

    PS
    is daltons and lucboudreau same user ?

    #260576

    lucboudreau
    Member

    Yes, it’s the same user.

    The project is 15 MB big, is it too much ?

    #260663

    Haris Peco
    Member

    No, it is not too big, but you can remove libraries.

    Thanks
    Peco

Viewing 10 posts - 1 through 10 (of 10 total)
Reply To: Multiple Spring context files and HQL Editor

You must be logged in to post in the forum log in