You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ctakes.apache.org by "Pei Chen (JIRA)" <ji...@apache.org> on 2014/08/26 16:50:58 UTC

[jira] [Commented] (CTAKES-308) ytex unit tests fixes

    [ https://issues.apache.org/jira/browse/CTAKES-308?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14110774#comment-14110774 ] 

Pei Chen commented on CTAKES-308:
---------------------------------

DAOTest is just a warning.  The real error is coming from:
Hi
However, earlier in the ytex tests, I did get another error:
Running org.apache.ctakes.jdl.data.xml.ValidationTest
org.xml.sax.SAXParseException; schema_reference.4: Failed to read schema
document
'file:/C:/Users/oconnell/workspace/cTakes%20Projects/ctakes/ctakes-ytex/file:/C:/Users/oconnell/workspace/cTakes%2520Projects/ctakes/ctakes-ytex-res/target/ctakes-ytex-res-3.2.1-SNAPSHOT.jar!/org/apache/ctakes/jdl/xdl.xsd',
because 1) could not find the document; 2) the document could not be read;
3) the root element of the document is not <xsd:schema>.
at
com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:198)
...
Caused by: java.io.FileNotFoundException:
C:\Users\oconnell\workspace\cTakes
Projects\ctakes\ctakes-ytex\file:\C:\Users\oconnell\workspace\cTakes%20Projects\ctakes\ctakes-ytex-res\target\ctakes-ytex-res-3.2.1-SNAPSHOT.jar!\org\apache\ctakes\jdl\xdl.xsd
(The filename, directory name, or volume label syntax is incorrect)
...
Tests run: 3, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.624 sec
<<< FAILURE!
The test that is failing has nothing to do with the MRCONSO not found
warning.

ValidationTest failed because it couldn't find the XSD.

The XSD is in the ctakes-ytex-resources, but the corresponding maven
artifact is an empty jar.

I think it would be best to modify the resource jars to actually contain
resources.

I'm not too privy to the ytex config details, but yes you're right,
it's caused by the xdl.xsd being null.  However it looks like it
exists in ytex-res.jar but the call being made uses Class.getResource
which won't be able to read in from the jar as an InputStream.
1) We can make ytex read in resources directly from jars (as maven
central artifacts).   We can make AppJdl.class.getResourceAsStream()
instead of getResource().  However, are there any other local physical
File dependencies?
2) Alternatively, we can add a step to have maven unpack res.jar if required.
I think 1 would be nice, but not sure how involved it will be.

Caused by: java.io.FileNotFoundException:
/Users/pei/workspace/apache-ctakes/trunk/ctakes-ytex/file:/Users/pei/workspace/apache-ctakes/trunk/ctakes-ytex-res/target/ctakes-ytex-res-3.2.1-SNAPSHOT.jar!/org/apache/ctakes/jdl/xdl.xsd
(No such file or directory)

        at java.io.FileInputStream.open(Native Method)

        at java.io.FileInputStream.&lt;init&gt;(FileInputStream.java:146)

        at java.io.FileInputStream.&lt;init&gt;(FileInputStream.java:101)

      at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:90)

Anyhow- https://issues.apache.org/jira/browse/CTAKES-308 opened to track this

> ytex unit tests fixes
> ---------------------
>
>                 Key: CTAKES-308
>                 URL: https://issues.apache.org/jira/browse/CTAKES-308
>             Project: cTAKES
>          Issue Type: Bug
>          Components: ctakes-ytex
>            Reporter: Pei Chen
>            Priority: Minor
>
> 2014-08-25 13:33:50,830 WARN  net.sf.ehcache.CacheManager  - Creating a new instance of CacheManager using the diskStorePath "/var/folders/qc/d7xd4zzs0_xcybv88skt5_7m0000gn/T/" which is already used by an existing CacheManager.
> The source of the configuration was
> net.sf.ehcache.config.generator.ConfigurationSource$InputStreamConfigurationSource@7433a719.
> The diskStore path for this CacheManager will be set to /var/folders/qc/d7xd4zzs0_xcybv88skt5_7m0000gn/T//ehcache_auto_created_1408988030830.
> To avoid this warning consider using the CacheManager factory methods to create a singleton CacheManager or specifying a separate ehcache configuration (ehcache.xml) for each CacheManager instance.
> 2014-08-25 13:33:51,082 WARN
> org.hibernate.engine.jdbc.spi.SqlExceptionHelper  - SQL Error: 62,
> SQLState: S0010
> 2014-08-25 13:33:51,082 ERROR
> org.hibernate.engine.jdbc.spi.SqlExceptionHelper  - Unknown JDBC escape sequence: {{db.schema}.MRCONSO mrconso0_ where mrconso0_.aui>?
> and length(mrconso0_.aui)>0 and length(mrconso0_.str)<200 and mrconso0_.lat='ENG' order by mrconso0_.aui
> 2014-08-25 13:33:51,085 WARN
> org.apache.ctakes.ytex.umls.dao.UMLSDaoTest  - sql exception - mrconso probably doesn't exist, check error
> org.hibernate.exception.SQLGrammarException: could not prepare statement
> at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:123)
> at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:49)
> at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:125)
> at org.hibernate.engine.jdbc.internal.StatementPreparerImpl$StatementPreparationTemplate.prepareStatement(StatementPreparerImpl.java:188)
> at org.hibernate.engine.jdbc.internal.StatementPreparerImpl.prepareQueryStatement(StatementPreparerImpl.java:159)
> at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1859)
> at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1836)
> at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1816)
> at org.hibernate.loader.Loader.doQuery(Loader.java:900)
> at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:342)
> at org.hibernate.loader.Loader.doList(Loader.java:2526)
> at org.hibernate.loader.Loader.doList(Loader.java:2512)
> at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2342)
> at org.hibernate.loader.Loader.list(Loader.java:2337)
> at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:495)
> at org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:357)
> at org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:195)
> at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1269)
> at org.hibernate.internal.QueryImpl.list(QueryImpl.java:101)
> at org.apache.ctakes.ytex.umls.dao.UMLSDaoImpl.getAllAuiStr(UMLSDaoImpl.java:106)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:606)
> at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:319)
> at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
> at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
> at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
> at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
> at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:90)
> at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
> at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
> at com.sun.proxy.$Proxy11.getAllAuiStr(Unknown Source)
> at org.apache.ctakes.ytex.umls.dao.UMLSDaoTest.testGetAllAuiStr(UMLSDaoTest.java:53)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:606)
> at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
> at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
> at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
> at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
> at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
> at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
> at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
> at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
> at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
> at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
> at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
> at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
> at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
> at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
> at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:249)
> at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:142)
> at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:113)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:606)
> at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
> at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
> at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
> at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:104)
> at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
> Caused by: java.sql.SQLException: Unknown JDBC escape sequence:
> {{db.schema}.MRCONSO mrconso0_ where mrconso0_.aui>? and
> length(mrconso0_.aui)>0 and length(mrconso0_.str)<200 and mrconso0_.lat='ENG' order by mrconso0_.aui
> at org.hsqldb.jdbc.jdbcConnection.onStartEscapeSequence(Unknown Source)
> at org.hsqldb.jdbc.jdbcConnection.nativeSQL(Unknown Source)
> at org.hsqldb.jdbc.jdbcPreparedStatement.<init>(Unknown Source)
> at org.hsqldb.jdbc.jdbcConnection.prepareStatement(Unknown Source)
> at org.apache.commons.dbcp.DelegatingConnection.prepareStatement(DelegatingConnection.java:281)
> at org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.prepareStatement(PoolingDataSource.java:313)
> at org.hibernate.engine.jdbc.internal.StatementPreparerImpl$5.doPrepare(StatementPreparerImpl.java:161)
> at org.hibernate.engine.jdbc.internal.StatementPreparerImpl$StatementPreparationTemplate.prepareStatement(StatementPreparerImpl.java:182)
> ... 60 more
> Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 3.202 sec
> Results :
> Tests in error:
>   setSchema(org.apache.ctakes.jdl.data.xml.ValidationTest)



--
This message was sent by Atlassian JIRA
(v6.2#6252)