cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Willerding <awillerd...@itsurcom.com>
Subject Re: Cayenne runtime error with DI
Date Wed, 11 Oct 2017 18:59:28 GMT
Sorry to bug the list but I seemed to have got around the DI issue by 
deleting the Maven references to cayenne and reinstalling them but now 
I'm getting another exception.  I'm sure I have the correct versions of 
Cayenne v4.0.B1 server, java8 and removed di. Am I still missing some 
dependent library?


Exception in thread "Thread-2" 
org.apache.cayenne.CayenneRuntimeException: [v.4.0.B1 Jun 02 2017 
15:11:18] Query exception.
     at 
org.apache.cayenne.access.DataDomainQueryAction.nextQueryException(DataDomainQueryAction.java:614)
     at org.apache.cayenne.access.DataNode.performQueries(DataNode.java:299)
     at 
org.apache.cayenne.access.DataDomainQueryAction.runQuery(DataDomainQueryAction.java:471)
     at 
org.apache.cayenne.access.DataDomainQueryAction.access$000(DataDomainQueryAction.java:72)
     at 
org.apache.cayenne.access.DataDomainQueryAction$2.perform(DataDomainQueryAction.java:446)
     at 
org.apache.cayenne.tx.DefaultTransactionManager.performInTransaction(DefaultTransactionManager.java:87)
     at 
org.apache.cayenne.tx.DefaultTransactionManager.performInLocalTransaction(DefaultTransactionManager.java:59)
     at 
org.apache.cayenne.tx.DefaultTransactionManager.performInTransaction(DefaultTransactionManager.java:52)
     at 
org.apache.cayenne.tx.DefaultTransactionManager.performInTransaction(DefaultTransactionManager.java:40)
     at 
org.apache.cayenne.access.DataDomainQueryAction.runQueryInTransaction(DataDomainQueryAction.java:443)
     at 
org.apache.cayenne.access.DataDomainQueryAction.execute(DataDomainQueryAction.java:122)
     at 
org.apache.cayenne.access.DataDomain.onQueryNoFilters(DataDomain.java:564)
     at 
org.apache.cayenne.access.DataDomain$DataDomainQueryFilterChain.onQuery(DataDomain.java:748)
     at 
org.apache.cayenne.tx.TransactionFilter.onQuery(TransactionFilter.java:49)
     at 
org.apache.cayenne.access.DataDomain$DataDomainQueryFilterChain.onQuery(DataDomain.java:748)
     at org.apache.cayenne.access.DataDomain.onQuery(DataDomain.java:556)
     at 
org.apache.cayenne.util.ObjectContextQueryAction.runQuery(ObjectContextQueryAction.java:382)
     at 
org.apache.cayenne.util.ObjectContextQueryAction.executePostCache(ObjectContextQueryAction.java:107)
     at 
org.apache.cayenne.util.ObjectContextQueryAction.execute(ObjectContextQueryAction.java:94)
     at org.apache.cayenne.access.DataContext.onQuery(DataContext.java:965)
     at 
org.apache.cayenne.access.DataContext.performQuery(DataContext.java:954)
     at org.apache.cayenne.BaseContext.select(BaseContext.java:307)
     at org.apache.cayenne.query.FluentSelect.select(FluentSelect.java:157)
     at 
com.callistacti.quest.crsolstasv2.ImportThread.run(ImportThread.java:202)
     at java.lang.Thread.run(Thread.java:748)
Caused by: java.io.StreamCorruptedException: invalid stream header: 32303137
     at 
java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:857)
     at java.io.ObjectInputStream.<init>(ObjectInputStream.java:349)
     at 
org.apache.cayenne.access.types.SerializableTypeFactory$SerializableType.toJavaObject(SerializableTypeFactory.java:106)
     at 
org.apache.cayenne.access.types.SerializableTypeFactory$SerializableType.toJavaObject(SerializableTypeFactory.java:70)
     at 
org.apache.cayenne.access.types.ExtendedTypeDecorator.materializeObject(ExtendedTypeDecorator.java:53)
     at 
org.apache.cayenne.access.jdbc.reader.FullRowReader.readRow(FullRowReader.java:52)
     at 
org.apache.cayenne.access.jdbc.reader.FullRowReader.readRow(FullRowReader.java:32)
     at 
org.apache.cayenne.access.jdbc.JDBCResultIterator.nextRow(JDBCResultIterator.java:104)
     at 
org.apache.cayenne.access.jdbc.JDBCResultIterator.allRows(JDBCResultIterator.java:80)
     at 
org.apache.cayenne.access.jdbc.SelectAction.performAction(SelectAction.java:138)
     at 
org.apache.cayenne.access.DataNodeQueryAction.runQuery(DataNodeQueryAction.java:97)
     at org.apache.cayenne.access.DataNode.performQueries(DataNode.java:293)


On 11/10/17 07:16 AM, Andrew Willerding wrote:
> Hi,
>
> I'm not sure what I'm missing when I try to run my application jar 
> file.  The intention is to load the cayenne configuration file from 
> the subdirectory etc.
>
> I'm getting the following error
>
> Exception in thread "main" org.apache.cayenne.di.DIRuntimeException: 
> DI container has no binding for key <BindingKey: 
> org.apache.cayenne.configuration.ObjectContextFactory>
>     at 
> org.apache.cayenne.di.spi.DefaultInjector.getProvider(DefaultInjector.java:158)
>     at 
> org.apache.cayenne.di.spi.DefaultInjector.getProvider(DefaultInjector.java:144)
>     at 
> org.apache.cayenne.di.spi.DefaultInjector.getInstance(DefaultInjector.java:134)
>     at 
> org.apache.cayenne.configuration.CayenneRuntime.newContext(CayenneRuntime.java:124)
>     at 
> com.callistacti.quest.crsolstasv2.CRSolstas.main(CRSolstas.java:114)
>
> after executing the following code...
>
>     public static final String DB_FILE = "cayenne-CRSolstas.xml";
>
>         Module myModule = (Binder binder) -> {
>             binder.bind(ResourceLocator.class).toInstance(new 
> FilesystemResourceLocator(new File("etc")));
> ServerModule.contributeProperties(binder).put(Constants.SERVER_CONTEXTS_SYNC_PROPERTY,

> "false");
>         };
>
>         ServerRuntime cayenneRuntime = 
> ServerRuntime.builder().addConfig(DB_FILE)
>                 .addModule(myModule)
>                 .build();
>         ObjectContext test = cayenneRuntime.newContext();
>         test.commitChanges();
>
> When I run my code within my IDE (Netbeans) I do not get this error so 
> I'm missing something from my jar package but I'm not sure what.
>
> Thanks,
>
> Andrew
>


Mime
View raw message