Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    TestNG Problem loading builtinTypes.xml

    I am running SmartGWTPower Nightly and gwt 2.3. I am unit testing my classes with TestNG and I am getting the following error:
    Code:
    [TestNG] Running:
      /tmp/testng-eclipse-1449633325/testng-customsuite.xml
    
    ISC: Configuring log4j from: file:/my/directory/my/application/war/WEB-INF/classes/log4j.isc.config.xml
    === 2012-01-02 17:25:09,864 [main] INFO  ISCInit - Isomorphic SmartClient Framework - Initializing
    === 2012-01-02 17:25:09,869 [main] INFO  ConfigLoader - Attempting to load framework.properties from CLASSPATH
    === 2012-01-02 17:25:09,945 [main] INFO  ConfigLoader - Successfully loaded framework.properties from CLASSPATH at location: jar:file:/my/directory/my/application/war/WEB-INF/lib/isomorphic_core_rpc.jar!/framework.properties
    === 2012-01-02 17:25:09,945 [main] INFO  ConfigLoader - Attempting to load project.properties from CLASSPATH
    === 2012-01-02 17:25:09,946 [main] INFO  ConfigLoader - Unable to locate project.properties in CLASSPATH
    === 2012-01-02 17:25:09,948 [main] INFO  ConfigLoader - Successfully loaded isc_interfaces.properties from CLASSPATH at location: jar:file:/my/directory/my/application/war/WEB-INF/lib/isomorphic_core_rpc.jar!/isc_interfaces.properties
    === 2012-01-02 17:25:09,948 [main] INFO  ConfigLoader - Attempting to load server.properties from CLASSPATH
    === 2012-01-02 17:25:09,952 [main] INFO  ConfigLoader - Successfully loaded server.properties from CLASSPATH at location: file:/my/directory/my/application/war/WEB-INF/classes/server.properties
    === 2012-01-02 17:25:09,955 [main] INFO  Logger - Logging system started.
    === 2012-01-02 17:25:09,956 [main] INFO  ISCInit - Isomorphic SmartClient Framework (SC_SNAPSHOT-2011-08-02/PowerEdition Deployment 2011-08-02) - Initialization Complete
    === 2012-01-02 17:25:09,957 [main] INFO  ISCInit - No ServletContext available yet - using container IO for now
    === 2012-01-02 17:25:09,965 [main] INFO  PoolManager - SmartClient pooling disabled for 'BubblyDataSource' objects
    Problem loading builtinTypes.xml
    Exception when loading from __USE_CONTAINER__/myappname/sc/system/schema/builtinTypes.xml:
    java.io.IOException: Configured for containerIO, but servletContext not available!  You need to install the Init servlet
    	at com.isomorphic.io.ISCFile.<init>(ISCFile.java:139)
    	at com.isomorphic.store.ProcessedFileCache.getObjectFromFile(ProcessedFileCache.java:138)
    	at com.isomorphic.xml.XML.getXMLDocument(XML.java:254)
    	at com.isomorphic.xml.XML.toDSRecords(XML.java:262)
    	at com.isomorphic.xml.XML.toDSRecords(XML.java:265)
    	at com.isomorphic.datasource.DataSource.<clinit>(DataSource.java:544)
    	at com.isomorphic.datasource.PoolableDataSourceFactory.makeUnpooledObject(PoolableDataSourceFactory.java:95)
    	at com.isomorphic.datasource.PoolableDataSourceFactory.makeObject(PoolableDataSourceFactory.java:102)
    	at com.isomorphic.pool.PoolManager.borrowObject(PoolManager.java:82)
    	at com.isomorphic.datasource.DataSourceManager.getDataSource(DataSourceManager.java:81)
    	at my.package.structure.MyClass.createTarget(MyClass.java:182)
    	at my.package.structure.MyClass_WBTest.createTarget(MyClass_WBTest.java:141)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    	at java.lang.reflect.Method.invoke(Method.java:597)
    	at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:80)
    	at org.testng.internal.MethodInvocationHelper$1.runTestMethod(MethodInvocationHelper.java:169)
    	at org.springframework.test.context.testng.AbstractTestNGSpringContextTests.run(AbstractTestNGSpringContextTests.java:158)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    	at java.lang.reflect.Method.invoke(Method.java:597)
    	at org.testng.internal.MethodInvocationHelper.invokeHookable(MethodInvocationHelper.java:181)
    	at org.testng.internal.Invoker.invokeMethod(Invoker.java:684)
    	at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:883)
    	at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1208)
    	at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
    	at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
    	at org.testng.TestRunner.privateRun(TestRunner.java:753)
    	at org.testng.TestRunner.run(TestRunner.java:613)
    	at org.testng.SuiteRunner.runTest(SuiteRunner.java:335)
    	at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:330)
    	at org.testng.SuiteRunner.privateRun(SuiteRunner.java:292)
    	at org.testng.SuiteRunner.run(SuiteRunner.java:241)
    	at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
    	at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
    	at org.testng.TestNG.runSuitesSequentially(TestNG.java:1169)
    	at org.testng.TestNG.runSuitesLocally(TestNG.java:1094)
    	at org.testng.TestNG.run(TestNG.java:1006)
    	at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:107)
    	at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:199)
    	at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:170)
    I don't know if this has anything to do with the error but I have this line of code in my Before Class method
    Code:
    theMockServletContext = new MockServletContext(new FileSystemResourceLoader());

    #2
    If this is running without a servlet engine, see the notes about webroot in this overview.

    Comment


      #3
      I explicitly specified the webroot as the link suggested. However, now I get the following error:
      Code:
      [TestNG] Running:
        /tmp/testng-eclipse--1900618205/testng-customsuite.xml
      
      ISC: Configuring log4j from: file:my/folder/structure/MyWebApp/MyWebApp/war/WEB-INF/classes/log4j.isc.config.xml
      === 2012-01-03 18:23:10,463 [main] INFO  ISCInit - Isomorphic SmartClient Framework - Initializing
      === 2012-01-03 18:23:10,467 [main] INFO  ConfigLoader - Attempting to load framework.properties from CLASSPATH
      === 2012-01-03 18:23:10,543 [main] INFO  ConfigLoader - Successfully loaded framework.properties from CLASSPATH at location: jar:file:my/folder/structure/MyWebApp/MyWebApp/war/WEB-INF/lib/isomorphic_core_rpc.jar!/framework.properties
      === 2012-01-03 18:23:10,544 [main] INFO  ConfigLoader - Attempting to load project.properties from CLASSPATH
      === 2012-01-03 18:23:10,544 [main] INFO  ConfigLoader - Unable to locate project.properties in CLASSPATH
      === 2012-01-03 18:23:10,547 [main] INFO  ConfigLoader - Successfully loaded isc_interfaces.properties from CLASSPATH at location: jar:file:my/folder/structure/MyWebApp/MyWebApp/war/WEB-INF/lib/isomorphic_core_rpc.jar!/isc_interfaces.properties
      === 2012-01-03 18:23:10,547 [main] INFO  ConfigLoader - Attempting to load server.properties from CLASSPATH
      === 2012-01-03 18:23:10,550 [main] INFO  ConfigLoader - Successfully loaded server.properties from CLASSPATH at location: file:my/folder/structure/MyWebApp/MyWebApp/war/WEB-INF/classes/server.properties
      === 2012-01-03 18:23:10,554 [main] INFO  Logger - Logging system started.
      === 2012-01-03 18:23:10,555 [main] INFO  ISCInit - Isomorphic SmartClient Framework (SC_SNAPSHOT-2011-08-02/PowerEdition Deployment 2011-08-02) - Initialization Complete
      === 2012-01-03 18:23:10,556 [main] INFO  ISCInit - Using Configured webRoot: my/folder/structure/MyWebApp/MyWebApp/war
      === 2012-01-03 18:23:10,565 [main] INFO  PoolManager - SmartClient pooling disabled for 'MyCustomDataSource' objects
      === 2012-01-03 18:23:10,583 [main] DEBUG XML - Parsed XML from my/folder/structure/MyWebApp/MyWebApp/war/MyWebApp/sc/system/schema/builtinTypes.xml: 3ms
      === 2012-01-03 18:23:10,629 [main] DEBUG XML - Parsed XML from my/folder/structure/MyWebApp/MyWebApp/war/ds/MyCustomDataSource.ds.xml: 2ms
      === 2012-01-03 18:23:10,633 [main] DEBUG XML - Parsed XML from my/folder/structure/MyWebApp/MyWebApp/war/MyWebApp/sc/system/schema/DataSource.ds.xml: 3ms
      === 2012-01-03 18:23:10,673 [main] DEBUG XML - Parsed XML from my/folder/structure/MyWebApp/MyWebApp/war/MyWebApp/sc/system/schema/DataSourceField.ds.xml: 2ms
      === 2012-01-03 18:23:10,693 [main] DEBUG XML - Parsed XML from my/folder/structure/MyWebApp/MyWebApp/war/MyWebApp/sc/system/schema/OperationBinding.ds.xml: 1ms
      === 2012-01-03 18:23:10,712 [main] WARN  BasicDataSource - Couldn't create DataSource MyCustomDataSource by looking up Spring bean 'MyCustomDSDataSource', creating as a normal DataSource.  The Spring lookup failed as follows: java.lang.IllegalArgumentException: ServletContext must not be null
      	at org.springframework.util.Assert.notNull(Assert.java:112)
      	at org.springframework.web.context.support.WebApplicationContextUtils.getWebApplicationContext(WebApplicationContextUtils.java:109)
      	at org.springframework.web.context.support.WebApplicationContextUtils.getWebApplicationContext(WebApplicationContextUtils.java:99)
      	at org.springframework.web.context.support.WebApplicationContextUtils.getRequiredWebApplicationContext(WebApplicationContextUtils.java:82)
      	at com.isomorphic.spring.SpringBeanFactory.getBeanFactory(SpringBeanFactory.java:45)
      	at com.isomorphic.spring.SpringBeanFactory.getBean(SpringBeanFactory.java:51)
      	at com.isomorphic.datasource.BasicDataSource.fromConfig(BasicDataSource.java:116)
      	at com.isomorphic.datasource.DataSource.fromConfig(DataSource.java:348)
      	at com.isomorphic.datasource.FileSystemDSRepo.loadDS(FileSystemDSRepo.java:110)
      	at com.isomorphic.datasource.DataSource.forName(DataSource.java:167)
      	at com.isomorphic.datasource.DataSource.forName(DataSource.java:159)
      	at com.isomorphic.datasource.DataSource.forName(DataSource.java:154)
      	at com.isomorphic.datasource.PoolableDataSourceFactory.makeUnpooledObject(PoolableDataSourceFactory.java:95)
      	at com.isomorphic.datasource.PoolableDataSourceFactory.makeObject(PoolableDataSourceFactory.java:102)
      	at com.isomorphic.pool.PoolManager.borrowObject(PoolManager.java:82)
      	at com.isomorphic.datasource.DataSourceManager.getDataSource(DataSourceManager.java:81)
      	at my.package.structure.Generator.createAndGenerate(Generator.java:182)
      	at my.package.structure.Generator_WBTest.createAndGenerate(Generator_WBTest.java:141)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      	at java.lang.reflect.Method.invoke(Method.java:597)
      	at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:80)
      	at org.testng.internal.MethodInvocationHelper$1.runTestMethod(MethodInvocationHelper.java:169)
      	at org.springframework.test.context.testng.AbstractTestNGSpringContextTests.run(AbstractTestNGSpringContextTests.java:158)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      	at java.lang.reflect.Method.invoke(Method.java:597)
      	at org.testng.internal.MethodInvocationHelper.invokeHookable(MethodInvocationHelper.java:181)
      	at org.testng.internal.Invoker.invokeMethod(Invoker.java:684)
      	at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:883)
      	at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1208)
      	at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
      	at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
      	at org.testng.TestRunner.privateRun(TestRunner.java:753)
      	at org.testng.TestRunner.run(TestRunner.java:613)
      	at org.testng.SuiteRunner.runTest(SuiteRunner.java:335)
      	at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:330)
      	at org.testng.SuiteRunner.privateRun(SuiteRunner.java:292)
      	at org.testng.SuiteRunner.run(SuiteRunner.java:241)
      	at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
      	at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
      	at org.testng.TestNG.runSuitesSequentially(TestNG.java:1169)
      	at org.testng.TestNG.runSuitesLocally(TestNG.java:1094)
      	at org.testng.TestNG.run(TestNG.java:1006)
      	at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:107)
      	at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:199)
      	at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:170)
      The ds.xml file looks like this:
      Code:
      <DataSource ID="MyCustomDataSource" 
      			dataFormat="iscServer" 
      			serverType="sql" 
      			serverConstructor="spring:MyCustomDSDataSource"
      			dataSourceVersion="1" 
      			dbName="Oracle" 
      			tableName="MyTable">
      The spring file looks as follows:
      Code:
      <bean id="MyCustomDSDataSource" class="my.package.structure.CustomDataSource" lazy-init="true">
            <property name="logger" ref="MyDataSourceLogger"/>
         </bean>
      Any help is much appreciated.

      Comment


        #4
        We're looking into this, please bear with us

        Comment


          #5
          A fix for this problem has been committed today, and will be present in tomorrow's nightly build (the "latest patched release" build). We have added automatic direct loading of the Spring applicationContext file if we detect that there is no servletContext. By default we look in the same place as the web application would look (WEB-INF/applicationContext.xml), but you can override this by specifying the property "standalone.spring.applicationContext" in your server.properties file. This is now documented in the "standaloneDataSourceUsage" section of the client-side documentation.

          Although the mechanism we have implemented ought to be flexible enough for most needs, we are considering also adding a fallback of looking for a file called "applicationContext.xml" on the classpath. Since you are an Enterprise Support customer, we would like to invite your opinion on whether this would be useful, or if there are any other common loading schemes for Spring config that you would like to see us supporting.

          Comment


            #6
            I'm having the same issue running TestNG but my project doesn't use Spring at all. Is there another resolution, or do I need to have all my test classes extend AbstractTestNGSpringContextTests?

            Code:
            Buildfile: /foobar/ServiceManagementInterface/build.xml
                 [echo] ||| test.build.classpath ||| 
                 [echo] /fooapps/gwt-2.3.0/gwt-dev.jar
                 [echo] /fooapps/gwt-2.3.0/gwt-user.jar
                 [echo] /fooapps/gwt-2.3.0/validation-api-1.0.0.GA-sources.jar
                 [echo] /fooapps/gwt-2.3.0/validation-api-1.0.0.GA.jar
                 [echo] /fooapps/slf4j-1.6.1/slf4j-api-1.6.1.jar
                 [echo] /foobar/ServiceManagementInterface/war/WEB-INF/lib/ResourceManagementPersistence.jar
                 [echo] /foobar/ServiceManagementInterface/war/WEB-INF/lib/activation.jar
                 [echo] /foobar/ServiceManagementInterface/war/WEB-INF/lib/analytics.jar
                 [echo] /foobar/ServiceManagementInterface/war/WEB-INF/lib/antlr-2.7.6.jar
                 [echo] /foobar/ServiceManagementInterface/war/WEB-INF/lib/asm-3.1.jar
                 [echo] /foobar/ServiceManagementInterface/war/WEB-INF/lib/asm-attrs.jar
                 [echo] /foobar/ServiceManagementInterface/war/WEB-INF/lib/cglib-2.2.jar
                 [echo] /foobar/ServiceManagementInterface/war/WEB-INF/lib/coherence.jar
                 [echo] /foobar/ServiceManagementInterface/war/WEB-INF/lib/commons-beanutils-1.0.jar
                 [echo] /foobar/ServiceManagementInterface/war/WEB-INF/lib/commons-cli-1.1.jar
                 [echo] /foobar/ServiceManagementInterface/war/WEB-INF/lib/commons-codec-1.3.jar
                 [echo] /foobar/ServiceManagementInterface/war/WEB-INF/lib/commons-collections-3.2.1.jar
                 [echo] /foobar/ServiceManagementInterface/war/WEB-INF/lib/commons-dbcp-1.2.2.jar
                 [echo] /foobar/ServiceManagementInterface/war/WEB-INF/lib/commons-digester-1.0.jar
                 [echo] /foobar/ServiceManagementInterface/war/WEB-INF/lib/commons-discovery-0.2.jar
                 [echo] /foobar/ServiceManagementInterface/war/WEB-INF/lib/commons-fileupload-1.2.1.jar
                 [echo] /foobar/ServiceManagementInterface/war/WEB-INF/lib/commons-httpclient-3.1.jar
                 [echo] /foobar/ServiceManagementInterface/war/WEB-INF/lib/commons-jxpath-1.3.jar
                 [echo] /foobar/ServiceManagementInterface/war/WEB-INF/lib/commons-lang-2.4.jar
                 [echo] /foobar/ServiceManagementInterface/war/WEB-INF/lib/commons-logging-1.1.1.jar
                 [echo] /foobar/ServiceManagementInterface/war/WEB-INF/lib/commons-pool-1.4.jar
                 [echo] /foobar/ServiceManagementInterface/war/WEB-INF/lib/commons-validator-1.0.jar
                 [echo] /foobar/ServiceManagementInterface/war/WEB-INF/lib/core-renderer.jar
                 [echo] /foobar/ServiceManagementInterface/war/WEB-INF/lib/datafabric.jar
                 [echo] /foobar/ServiceManagementInterface/war/WEB-INF/lib/dom4j-1.6.1.jar
                 [echo] /foobar/ServiceManagementInterface/war/WEB-INF/lib/gwt-servlet.jar
                 [echo] /foobar/ServiceManagementInterface/war/WEB-INF/lib/iText-2.0.8.jar
                 [echo] /foobar/ServiceManagementInterface/war/WEB-INF/lib/isc-jakarta-oro-2.0.6.jar
                 [echo] /foobar/ServiceManagementInterface/war/WEB-INF/lib/isomorphic_assembly.jar
                 [echo] /foobar/ServiceManagementInterface/war/WEB-INF/lib/isomorphic_compression.jar
                 [echo] /foobar/ServiceManagementInterface/war/WEB-INF/lib/isomorphic_contentexport.jar
                 [echo] /foobar/ServiceManagementInterface/war/WEB-INF/lib/isomorphic_core_rpc.jar
                 [echo] /foobar/ServiceManagementInterface/war/WEB-INF/lib/isomorphic_js_parser.jar
                 [echo] /foobar/ServiceManagementInterface/war/WEB-INF/lib/isomorphic_spring.jar
                 [echo] /foobar/ServiceManagementInterface/war/WEB-INF/lib/isomorphic_sql.jar
                 [echo] /foobar/ServiceManagementInterface/war/WEB-INF/lib/isomorphic_struts.jar
                 [echo] /foobar/ServiceManagementInterface/war/WEB-INF/lib/isomorphic_tools.jar
                 [echo] /foobar/ServiceManagementInterface/war/WEB-INF/lib/isomorphic_web_services.jar
                 [echo] /foobar/ServiceManagementInterface/war/WEB-INF/lib/javassist-3.4.GA.jar
                 [echo] /foobar/ServiceManagementInterface/war/WEB-INF/lib/jdbc2_0-stdext.jar
                 [echo] /foobar/ServiceManagementInterface/war/WEB-INF/lib/jetty-naming-6.1.26.jar
                 [echo] /foobar/ServiceManagementInterface/war/WEB-INF/lib/jetty-plus-6.1.26.jar
                 [echo] /foobar/ServiceManagementInterface/war/WEB-INF/lib/jta-1.1.jar
                 [echo] /foobar/ServiceManagementInterface/war/WEB-INF/lib/jtidy-r938.jar
                 [echo] /foobar/ServiceManagementInterface/war/WEB-INF/lib/log4j-1.2.15.jar
                 [echo] /foobar/ServiceManagementInterface/war/WEB-INF/lib/log4pg.jar
                 [echo] /foobar/ServiceManagementInterface/war/WEB-INF/lib/poi-3.6-20091214.jar
                 [echo] /foobar/ServiceManagementInterface/war/WEB-INF/lib/poi-ooxml-3.6-20091214.jar
                 [echo] /foobar/ServiceManagementInterface/war/WEB-INF/lib/poi-ooxml-schemas-3.6-20091214.jar
                 [echo] /foobar/ServiceManagementInterface/war/WEB-INF/lib/resource-manager-client.jar
                 [echo] /foobar/ServiceManagementInterface/war/WEB-INF/lib/slf4j-api-1.6.1.jar
                 [echo] /foobar/ServiceManagementInterface/war/WEB-INF/lib/smartgwt-skins.jar
                 [echo] /foobar/ServiceManagementInterface/war/WEB-INF/lib/smartgwt.jar
                 [echo] /foobar/ServiceManagementInterface/war/WEB-INF/lib/smartgwtee.jar
                 [echo] /foobar/ServiceManagementInterface/war/WEB-INF/lib/spring-2.0.8.jar
                 [echo] /foobar/ServiceManagementInterface/war/WEB-INF/lib/validation-api-1.0.0.GA.jar
                 [echo] /foobar/ServiceManagementInterface/war/WEB-INF/lib/velocity-1.6.1.jar
                 [echo] /foobar/ServiceManagementInterface/war/WEB-INF/lib/xbean.jar
                 [echo] /fooapps/emma-2.0.5312/lib/emma.jar
                 [echo] /fooapps/emma-2.0.5312/lib/emma_ant.jar
                 [echo] /fooapps/eclipse_3.7.1/plugins/org.eclipse.persistence.jpa_2.1.2.v20101206-r8635.jar
                 [echo] /fooapps/eclipse_3.7.1/plugins/javax.persistence_2.0.3.v201010191057.jar
                 [echo] /foobar/ServiceManagementInterface/target/classes
                 [echo] /foobar/ServiceManagementInterface/target/test-classes
                 [echo] /fooapps/testNG/testng-5.14.1/testng-5.14.1.jar
                 [echo] /foobar/lib/build-tools.jar
                 [echo] /foobar/ServiceManagementInterface/war/WEB-INF/classes
                 [echo] /fooapps/hamcrest-1.2/hamcrest-core-1.2.jar
                 [echo] /fooapps/hamcrest-1.2/hamcrest-library-1.2.jar
                 [echo] /fooapps/jmock-2.5.1/jmock-2.5.1.jar
                 [echo] /fooapps/jmock-2.5.1/bsh-core-2.0b4.jar
                 [echo] /fooapps/jmock-2.5.1/cglib-2.1.3-src.jar
                 [echo] /fooapps/jmock-2.5.1/cglib-nodep-2.1_3.jar
                 [echo] /fooapps/jmock-2.5.1/jmock-junit3-2.5.1.jar
                 [echo] /fooapps/jmock-2.5.1/jmock-junit4-2.5.1.jar
                 [echo] /fooapps/jmock-2.5.1/jmock-legacy-2.5.1.jar
                 [echo] /fooapps/jmock-2.5.1/jmock-script-2.5.1.jar
                 [echo] /fooapps/jmock-2.5.1/objenesis-1.0.jar
                 [echo] /fooapps/Apache_Commons/commons-collections-3.2.1/commons-collections-3.2.1.jar
                 [echo] /fooapps/Apache_Commons/commons-logging-1.1.1/commons-logging-1.1.1.jar
                 [echo] /fooapps/spring-framework-3.0.5/spring-framework-3.0.5.RELEASE/dist/org.springframework.asm-3.0.5.RELEASE.jar
                 [echo] /fooapps/spring-framework-3.0.5/spring-framework-3.0.5.RELEASE/dist/org.springframework.expression-3.0.5.RELEASE.jar
            init-test:
                [mkdir] Created dir: /foobar/ServiceManagementInterface/target/test-classes
                [mkdir] Created dir: /foobar/ServiceManagementInterface/target/test-reports
            compile-test:
                [javac] Compiling 9 source files to /foobar/ServiceManagementInterface/target/test-classes
            dist-test:
                 [echo] Creating test test jar by spemble
                  [jar] Building jar: /foobar/lib/smi-swit-test-logging.jar
            -pre-run-tests:
            -default-run-tests:
                 [echo] Excluding groups: 
               [testng] ISC: Configuring log4j from: file:/foobar/ServiceManagementInterface/target/classes/log4j.isc.config.xml
               [testng] === 2012-06-14 19:53:06,022 [main] INFO  ISCInit - Isomorphic SmartClient Framework - Initializing
               [testng] === 2012-06-14 19:53:06,027 [main] INFO  ConfigLoader - Attempting to load framework.properties from CLASSPATH
               [testng] === 2012-06-14 19:53:06,109 [main] INFO  ConfigLoader - Successfully loaded framework.properties from CLASSPATH at location: jar:file:/foobar/ServiceManagementInterface/war/WEB-INF/lib/isomorphic_core_rpc.jar!/framework.properties
               [testng] === 2012-06-14 19:53:06,109 [main] INFO  ConfigLoader - Attempting to load project.properties from CLASSPATH
               [testng] === 2012-06-14 19:53:06,110 [main] INFO  ConfigLoader - Unable to locate project.properties in CLASSPATH
               [testng] === 2012-06-14 19:53:06,114 [main] INFO  ConfigLoader - Successfully loaded isc_interfaces.properties from CLASSPATH at location: jar:file:/foobar/ServiceManagementInterface/war/WEB-INF/lib/isomorphic_core_rpc.jar!/isc_interfaces.properties
               [testng] === 2012-06-14 19:53:06,115 [main] INFO  ConfigLoader - Attempting to load server.properties from CLASSPATH
               [testng] === 2012-06-14 19:53:06,117 [main] INFO  ConfigLoader - Successfully loaded server.properties from CLASSPATH at location: file:/foobar/ServiceManagementInterface/target/classes/server.properties
               [testng] === 2012-06-14 19:53:06,121 [main] INFO  Logger - Logging system started.
               [testng] === 2012-06-14 19:53:06,122 [main] INFO  ISCInit - Isomorphic SmartClient Framework (v8.2p_2012-05-14/EVAL Deployment 2012-05-14) - Initialization Complete
               [testng] === 2012-06-14 19:53:06,124 [main] INFO  ISCInit - Using Configured webRoot: /foobar/ServiceManagementInterface/war
               [testng] === 2012-06-14 19:53:06,154 [main] INFO  PoolManager - SmartClient pooling disabled for 'simpleTypes' objects
               [testng] === 2012-06-14 19:53:06,274 [main] WARN  Validation - No such type 'string', not processing field value at /DataSource[@ID=function]/ID
               [testng] === 2012-06-14 19:53:06,274 [main] WARN  Validation - No such type 'string', not processing field value at /DataSource[@ID=function]/dataFormat
               [testng] === 2012-06-14 19:53:06,274 [main] WARN  Validation - No such type 'number', not processing field value at /DataSource[@ID=function]/dataSourceVersion
               [testng] === 2012-06-14 19:53:06,274 [main] WARN  Validation - No such type 'string', not processing field value at /DataSource[@ID=function]/dbName
               [testng] === 2012-06-14 19:53:06,274 [main] WARN  Validation - No such type 'string', not processing field value at /DataSource[@ID=function]/serverType
               [testng] === 2012-06-14 19:53:06,274 [main] WARN  Validation - No such type 'string', not processing field value at /DataSource[@ID=function]/tableName
               [testng] Problem loading builtinTypes.xml
               [testng] Exception when loading from /foobar/ServiceManagementInterface/war/servicemanagementinterface/sc/system/schema/builtinTypes.xml:
               [testng] java.lang.NullPointerException
               [testng] 	at com.isomorphic.datasource.BasicDataSource.toRecords(BasicDataSource.java:969)
               [testng] 	at com.isomorphic.datasource.BasicDataSource.toRecords(BasicDataSource.java:940)
               [testng] 	at com.isomorphic.datasource.DataSource.create(DataSource.java:1130)
               [testng] 	at com.isomorphic.datasource.BasicDataSource.validateFieldValue(BasicDataSource.java:1446)
               [testng] 	at com.isomorphic.datasource.BasicDataSource.validateFieldValue(BasicDataSource.java:1393)
               [testng] 	at com.isomorphic.datasource.BasicDataSource.elementAsRecord(BasicDataSource.java:1239)
               [testng] 	at com.isomorphic.datasource.BasicDataSource.toRecord(BasicDataSource.java:995)
               [testng] 	at com.isomorphic.datasource.BasicDataSource.toRecords(BasicDataSource.java:954)
               [testng] 	at com.isomorphic.datasource.DataSource.recordsFromXML(DataSource.java:1088)
               [testng] 	at com.isomorphic.xml.XML.toDSRecords(XML.java:299)
               [testng] 	at com.isomorphic.xml.XML.toDSRecords(XML.java:290)
               [testng] 	at com.isomorphic.xml.XML.toDSRecords(XML.java:282)
               [testng] 	at com.isomorphic.xml.XML$RecordsFromXMLCache.loadObjectFromFile(XML.java:377)
               [testng] 	at com.isomorphic.store.ProcessedFileCache.getObjectFromFile(ProcessedFileCache.java:132)
               [testng] 	at com.isomorphic.xml.XML.loadCacheableDSRecords(XML.java:388)
               [testng] 	at com.isomorphic.store.DataStructCache.loadInstance(DataStructCache.java:179)
               [testng] 	at com.isomorphic.datasource.FileSystemDSRepo.loadDS(FileSystemDSRepo.java:65)
               [testng] 	at com.isomorphic.datasource.DataSource.forName(DataSource.java:178)
               [testng] 	at com.isomorphic.datasource.DataSource.forName(DataSource.java:170)
               [testng] 	at com.isomorphic.datasource.DataSource.forName(DataSource.java:165)
               [testng] 	at com.isomorphic.datasource.PoolableDataSourceFactory.makeUnpooledObject(PoolableDataSourceFactory.java:95)
               [testng] 	at com.isomorphic.datasource.PoolableDataSourceFactory.makeObject(PoolableDataSourceFactory.java:102)
               [testng] 	at com.isomorphic.pool.PoolManager.borrowObject(PoolManager.java:82)
               [testng] 	at com.isomorphic.datasource.DataSourceManager.getDataSource(DataSourceManager.java:87)
               [testng] 	at com.isomorphic.datasource.ValidationContext.getType(ValidationContext.java:278)
               [testng] 	at com.isomorphic.datasource.BasicDataSource.findDataSource(BasicDataSource.java:1986)
               [testng] 	at com.isomorphic.datasource.BasicDataSource.getType(BasicDataSource.java:1880)
               [testng] 	at com.isomorphic.datasource.BasicDataSource.findElementType(BasicDataSource.java:1630)
               [testng] 	at com.isomorphic.datasource.BasicDataSource.elementAsRecord(BasicDataSource.java:1083)
               [testng] 	at com.isomorphic.datasource.BasicDataSource.toRecord(BasicDataSource.java:995)
               [testng] 	at com.isomorphic.datasource.BasicDataSource.handleExtraElementValue(BasicDataSource.java:1372)
               [testng] 	at com.isomorphic.datasource.BasicDataSource.elementAsRecord(BasicDataSource.java:1300)
               [testng] 	at com.isomorphic.datasource.BasicDataSource.toRecord(BasicDataSource.java:995)
               [testng] 	at com.isomorphic.datasource.BasicDataSource.toRecords(BasicDataSource.java:954)
               [testng] 	at com.isomorphic.datasource.DataSource.recordsFromXML(DataSource.java:1088)
               [testng] 	at com.isomorphic.xml.XML.toDSRecords(XML.java:299)
               [testng] 	at com.isomorphic.xml.XML.toDSRecords(XML.java:263)
               [testng] 	at com.isomorphic.xml.XML.toDSRecords(XML.java:266)
               [testng] 	at com.isomorphic.datasource.DataSource.<clinit>(DataSource.java:555)
               [testng] 	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
               [testng] 	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
               [testng] 	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
               [testng] 	at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
               [testng] 	at org.testng.internal.ObjectFactoryImpl.newInstance(ObjectFactoryImpl.java:22)
               [testng] 	at org.testng.internal.ClassHelper.createInstance(ClassHelper.java:331)
               [testng] 	at org.testng.internal.ClassImpl.getDefaultInstance(ClassImpl.java:88)
               [testng] 	at org.testng.internal.ClassImpl.getInstances(ClassImpl.java:106)
               [testng] 	at org.testng.internal.TestNGClassFinder.<init>(TestNGClassFinder.java:119)
               [testng] 	at org.testng.TestRunner.initMethods(TestRunner.java:396)
               [testng] 	at org.testng.TestRunner.init(TestRunner.java:234)
               [testng] 	at org.testng.TestRunner.init(TestRunner.java:204)
               [testng] 	at org.testng.TestRunner.<init>(TestRunner.java:146)
               [testng] 	at org.testng.SuiteRunner$DefaultTestRunnerFactory.newTestRunner(SuiteRunner.java:499)
               [testng] 	at org.testng.SuiteRunner.init(SuiteRunner.java:140)
               [testng] 	at org.testng.SuiteRunner.<init>(SuiteRunner.java:104)
               [testng] 	at org.testng.TestNG.createSuiteRunner(TestNG.java:1120)
               [testng] 	at org.testng.TestNG.createSuiteRunners(TestNG.java:1106)
               [testng] 	at org.testng.TestNG.runSuitesLocally(TestNG.java:952)
               [testng] 	at org.testng.TestNG.run(TestNG.java:896)
               [testng] 	at org.testng.TestNG.privateMain(TestNG.java:1193)
               [testng] 	at org.testng.TestNG.main(TestNG.java:1153)
               [testng] org.testng.TestNGException: 
               [testng] An error occurred while instantiating class foo.sm.webapp.server.TestPersistenceManager: null
               [testng] 	at org.testng.internal.ClassHelper.createInstance(ClassHelper.java:343)
               [testng] 	at org.testng.internal.ClassImpl.getDefaultInstance(ClassImpl.java:88)
               [testng] 	at org.testng.internal.ClassImpl.getInstances(ClassImpl.java:106)
               [testng] 	at org.testng.internal.TestNGClassFinder.<init>(TestNGClassFinder.java:119)
               [testng] 	at org.testng.TestRunner.initMethods(TestRunner.java:396)
               [testng] 	at org.testng.TestRunner.init(TestRunner.java:234)
               [testng] 	at org.testng.TestRunner.init(TestRunner.java:204)
               [testng] 	at org.testng.TestRunner.<init>(TestRunner.java:146)
               [testng] 	at org.testng.SuiteRunner$DefaultTestRunnerFactory.newTestRunner(SuiteRunner.java:499)
               [testng] 	at org.testng.SuiteRunner.init(SuiteRunner.java:140)
               [testng] 	at org.testng.SuiteRunner.<init>(SuiteRunner.java:104)
               [testng] 	at org.testng.TestNG.createSuiteRunner(TestNG.java:1120)
               [testng] 	at org.testng.TestNG.createSuiteRunners(TestNG.java:1106)
               [testng] 	at org.testng.TestNG.runSuitesLocally(TestNG.java:952)
               [testng] 	at org.testng.TestNG.run(TestNG.java:896)
               [testng] 	at org.testng.TestNG.privateMain(TestNG.java:1193)
               [testng] 	at org.testng.TestNG.main(TestNG.java:1153)
               [testng] Caused by: java.lang.ExceptionInInitializerError
               [testng] 	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
               [testng] 	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
               [testng] 	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
               [testng] 	at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
               [testng] 	at org.testng.internal.ObjectFactoryImpl.newInstance(ObjectFactoryImpl.java:22)
               [testng] 	at org.testng.internal.ClassHelper.createInstance(ClassHelper.java:331)
               [testng] 	... 16 more
               [testng] Caused by: javax.persistence.PersistenceException: No Persistence provider for EntityManager named ServiceManagementPU
               [testng] 	at javax.persistence.Persistence.createEntityManagerFactory(Unknown Source)
               [testng] 	at javax.persistence.Persistence.createEntityManagerFactory(Unknown Source)
               [testng] 	at goesr.gs.pg.sm.webapp.server.TestPersistenceManager.<clinit>(TestPersistenceManager.java:50)
               [testng] 	... 22 more
               [testng] The tests failed.
            -post-run-tests:
            run-tests:
            test:
            BUILD SUCCESSFUL
            Total time: 13 seconds
            Code:
            <?xml version="1.0" encoding="UTF-8"?>
            <persistence version="2.0"
            	xmlns="http://java.sun.com/xml/ns/persistence" 
            	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            	xsi:schemaLocation="http://java.sun.com/xml/ns/persistence 
            						http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
            	<persistence-unit name="ServiceManagementPU" transaction-type="RESOURCE_LOCAL">
            Code:
            webRoot: /fooapps/ServiceManagementInterface/war
            gwtModuleName: servicemanagementinterface
            isomorphicPathRootRelative: $gwtModuleName/sc
            
            jpa.persistenceUnitName: ServiceManagementPU
            jpa.ServiceManagement.emfProvider: com.isomorphic.jpa.EMFProviderLMT
            jpa.ServiceManagement.persistenceUnitName: ServiceManagementPU
            
            sql.ServiceManagement.database.type: oracle
            sql.ServiceManagement.driver.name: /jdbc/ServiceManagement
            sql.ServiceManagement.interface.type: jndi
            sql.ServiceManagement.pool.enabled: true
            sql.ServiceManagement.pool.maxActive: -1
            
            project.datasources: $webRoot/shared/ds
            project.apps: $webRoot/shared/app
            Code:
            <web-app xmlns="http://java.sun.com/xml/ns/javaee" 
                     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            	     xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
                                         http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
            	     version="3.0">
            	
            	<!-- ============= -->
            	<!-- JNDI DEV MODE -->
            <!-- 	<resource-ref>  -->
            <!-- 		<res-ref-name>jdbc/ServiceManagement</res-ref-name> -->
            <!-- 		<res-type>javax.sql.DataSource</res-type> -->
            <!-- 		<res-auth>Container</res-auth> -->
            <!-- 	</resource-ref> -->
            	<!-- ============= -->
            	
            	<!-- Dynamic Compression -->
            	<filter>
            		<filter-name>CompressionFilter</filter-name>
            		<filter-class>com.isomorphic.servlet.CompressionFilter</filter-class>
            	</filter>
            	
            	<!-- CompressionFilter for dynamic compression -->
            	<filter-mapping>
            		<filter-name>CompressionFilter</filter-name>
            		<url-pattern>/*</url-pattern>
            	</filter-mapping>
            
            	<!-- The IDACall servlet handles all Built-in DataSource operations -->
            	<servlet>
            		<servlet-name>IDACall</servlet-name>
            		<servlet-class>com.isomorphic.servlet.IDACall</servlet-class>
            	</servlet>
            
            	<servlet>
            		<servlet-name>DataSourceLoader</servlet-name>
            		<servlet-class>com.isomorphic.servlet.DataSourceLoader</servlet-class>
            	</servlet>
            
            	<!-- The FileDownload servlet downloads static files, like a webserver -->
            	<servlet>
            		<servlet-name>FileDownload</servlet-name>
            		<servlet-class>com.isomorphic.servlet.FileDownload</servlet-class>
            	</servlet>
            
            	<!-- ISC init: initializes ISC framework -->
            	<servlet>
            		<servlet-name>Init</servlet-name>
            		<servlet-class>com.isomorphic.base.Init</servlet-class>
            		<load-on-startup>1</load-on-startup>
            	</servlet>
            
            	<servlet>
            		<servlet-name>HttpProxy</servlet-name>
            		<servlet-class>com.isomorphic.servlet.HttpProxyServlet</servlet-class>
            	</servlet>
            
            	<!-- The PreCache servlet initializes when the servlet engine starts up 
            		and pre-loads data need for all client requests. This is optional, and improves 
            		performance of the first few page requests. PreCache cannot be invoked by 
            		a browser, because there is no "servlet-mapping" defined for it. -->
            	<servlet>
            		<servlet-name>PreCache</servlet-name>
            		<servlet-class>com.isomorphic.servlet.PreCache</servlet-class>
            		<load-on-startup>2</load-on-startup>
            	</servlet>
            
            	<!-- RPCManager uses this URL by default for Built-in DataSource operations -->
            	<servlet-mapping>
            		<servlet-name>IDACall</servlet-name>
            		<url-pattern>/servicemanagementinterface/sc/IDACall</url-pattern>
            	</servlet-mapping>
            
            	<!-- DataSourceLoader requests -->
            	<servlet-mapping>
            		<servlet-name>DataSourceLoader</servlet-name>
            		<url-pattern>/servicemanagementinterface/sc/DataSourceLoader</url-pattern>
            	</servlet-mapping>
            
            	<servlet-mapping>
            		<servlet-name>HttpProxy</servlet-name>
            		<url-pattern>/servicemanagementinterface/sc/HttpProxy/*</url-pattern>
            	</servlet-mapping>
            
            	<!-- Use FileDownload servlet to download all static content that's part 
            		of the skin, such as image files, so we can set Expires headers and other 
            		cache control directives. In a production deployment, you'd want to use a 
            		webserver such as Apache to do this. -->
            	<servlet-mapping>
            		<servlet-name>FileDownload</servlet-name>
            		<url-pattern>/servicemanagementinterface/sc/skins/*</url-pattern>
            	</servlet-mapping>
            
            	<!-- serve ISC modules compressed, with expires headers -->
            	<servlet-mapping>
            		<servlet-name>FileDownload</servlet-name>
            		<url-pattern>/servicemanagementinterface/sc/system/modules/*</url-pattern>
            	</servlet-mapping>
            
            	<!-- serve ISC development modules compressed, with expires headers -->
            	<servlet-mapping>
            		<servlet-name>FileDownload</servlet-name>
            		<url-pattern>/servicemanagementinterface/sc/system/development/*</url-pattern>
            	</servlet-mapping>
            
            	<!-- server skin assets with expires headers -->
            	<servlet-mapping>
            		<servlet-name>FileDownload</servlet-name>
            		<url-pattern>/servicemanagementinterface/sc/system/reference/skin/*</url-pattern>
            	</servlet-mapping>
            
            	<!-- General config -->
            	<session-config>
            		<session-timeout>30</session-timeout>
            	</session-config>
            
            	<jsp-config>
            		<!-- Isomorphic JSP tags -->
            		<taglib>
            			<taglib-uri>isomorphic</taglib-uri>
            			<taglib-location>/WEB-INF/iscTaglib.xml</taglib-location>
            		</taglib>
            	</jsp-config>
              
              <!-- Default page to serve -->
              <welcome-file-list>
                <welcome-file>ServiceManagementInterface.html</welcome-file>
              </welcome-file-list>
            
            </web-app>
            Thanks for your help!
            Last edited by susanpemble; 18 Jun 2012, 04:30.

            Comment


              #7
              Your problem is different - note the stack trace does not involve Spring. You seem to be just missing all the files that are expected to be under 'webroot'. The directory structure that is produced under the "war" directory, specifically sc/system etc, needs to be present when running standalone too.

              Comment


                #8
                Of course you're exactly right; I needed to specify the correct dependencies for my test target. It's just that our project needs to document the dependencies built into in our build system.

                Thanks!
                Last edited by susanpemble; 18 Jun 2012, 04:31.

                Comment

                Working...
                X