Kodo.util.FatalDataStoreException: Wrong database file version
Hi,
I am using Kodo JDO 3.0.2 together with HSQLDB (non-cached, same process).
It
runs fine. However, after having used a SQL tool such as Aqua Data Studio
to
inspect the database my Java code complains with the message
"kodo.util.FatalDataStoreException: Wrong database file version". I have
to
rebuild the database and extend my classes again to get rid of this error.
Is there some information in the database script that does not survive the
inspection with the SQL tool? How can I work around this?
Thanks for your help
--Bruno
Marc,
It was indeed a version mismatch with my hsqldb libs. My SQL Tool used
version 1.7.2 whereas Kdo used 1.7.0. A quick update of the property file
of
Aqua Data Studio fixed the problem. Thanks for the hint.
--Bruno
Marc Prud'hommeaux wrote:
Bruno-
Without being at all familiar with "Aqua Data Studio", I'll make a
completely shot in the dark guess about what might be happening: you are
using version x of Hypersonic to access the database, and then "Aqua
Data Studio" is using version x+1. When the database is opened with HSQL
version x+1, some internal version identifier in the database file is
incremented, which disallows the previous version of HSQL (which is
being used by Kodo) from opening the file.
Again, this is a blind guess, but if it is the case, then the solution
would be to ensure that you are using the same version of HSQL in both
Kodo and "Aqua Data Studio".
Otherwise, can you post the stack trace of the exception? That might
give some more insight as to why this might be happening.
As an aside, note that Kodo doesn't store or verify any internal
"version" or anything like that, so I very much doubt that it is a
problem with Kodo itself.
In article <c1fihi$igu$[email protected]>, Bruno Schaeffer wrote:
Hi,
I am using Kodo JDO 3.0.2 together with HSQLDB (non-cached, same
process).
It
runs fine. However, after having used a SQL tool such as Aqua Data Studio
to
inspect the database my Java code complains with the message
"kodo.util.FatalDataStoreException: Wrong database file version". I have
to
rebuild the database and extend my classes again to get rid of thiserror.
Is there some information in the database script that does not survivethe
inspection with the SQL tool? How can I work around this?
Thanks for your help
--Bruno
Marc Prud'hommeaux [email protected]
SolarMetric Inc. http://www.solarmetric.com
Similar Messages
-
KODO JDO Exception - kodo.util.FatalDataStoreException
Using <b>Kodo Version - 3.3.4</b>, getting following exception when we try to <b>COMMIT</b>. Please let us know the reason for this kind of exception.
java.lang.NullPointerException>
kodo.util.FatalDataStoreException: java.lang.NullPointerException
at kodo.runtime.PersistenceManagerImpl.afterCompletion(PersistenceManagerImpl.java:1020)
at kodo.runtime.LocalManagedRuntime.commit(LocalManagedRuntime.java:86)
at kodo.runtime.PersistenceManagerImpl.commit(PersistenceManagerImpl.java:629)
at com.capgroup.isa.dal.LibrarySession.commit(LibrarySession.java:135)
NestedThrowablesStackTrace:
java.lang.NullPointerException
at kodo.jdbc.runtime.JDBCStoreManager.commit(JDBCStoreManager.java:140)
at kodo.runtime.DelegatingStoreManager.commit(DelegatingStoreManager.java:101)
at kodo.runtime.PersistenceManagerImpl.endTransaction(PersistenceManagerImpl.java:1317)
at kodo.runtime.PersistenceManagerImpl.afterCompletion(PersistenceManagerImpl.java:998)
at kodo.runtime.LocalManagedRuntime.commit(LocalManagedRuntime.java:86)
at kodo.runtime.PersistenceManagerImpl.commit(PersistenceManagerImpl.java:629)
at com.capgroup.isa.dal.LibrarySession.commit(LibrarySession.java:135)
Thanks,A NPE coming from Kodo's code is a defect. I suggest you try with 3.4.1 or a more recent version. Similar bugs have been fixed in them.
Laurent -
I am receiving the following exception in our app at what appears to be
random intervals.
There were multiple users logged into the system, each getting their own
persistence manager (by way of pmFactory.getPersistenceManager(), which
are then stored in the http session and re-used as long as that user is
logged in) and when they started accessing the system simultaneously
everything was fine for a while (ranged from 30min to 3 hours) then one
person would see the exception, then others would see the exception right
after. Then a few minutes later the problem would be gone again for a
while
I have the multithread option set to true in kodo.properties and am using
pessimistic transactions
Using kodo 3.3.3
I am just curious what might cause something like this, it seems as though
2 threads are trying to commit the same data with the same persistence
manager to me.
My next step in debugging this process is extending the persistence
manager object to add some logging and see if my theory is correct.
Any pointers to tracking this down would be greatly appreciated
kodo.util.FatalDataStoreException: java.util.NoSuchElementException
at
kodo.runtime.PersistenceManagerImpl.afterCompletion(PersistenceManagerImpl.java:1020)
at kodo.runtime.LocalManagedRuntime.commit(LocalManagedRuntime.java:86)
at
kodo.runtime.PersistenceManagerImpl.commit(PersistenceManagerImpl.java:629)
at
com.stchome.cdr.actions.SearchCriteriaWizardAction.searchQbe(SearchCriteriaWizardAction.java:345)
at sun.reflect.GeneratedMethodAccessor355.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at
org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:280)
at
org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:216)
at
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at
com.stchome.cdr.servlet.CdrActionServlet.process(CdrActionServlet.java:31)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at
com.stchome.cdr.servlet.filters.SessionManagerFilter.doFilter(SessionManagerFilter.java:41)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at
org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:300)
at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:374)
at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:743)
at
org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:675)
at org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:866)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
at java.lang.Thread.run(Thread.java:534)
NestedThrowablesStackTrace:
java.util.NoSuchElementException
at serp.util.LookaheadIterator.next(LookaheadIterator.java:57)
at
com.solarmetric.apache.commons.collections.iterators.IteratorChain.next(IteratorChain.java:264)
at kodo.util.CacheMap$EntryIterator.next(CacheMap.java:654)
at java.util.AbstractCollection.toArray(AbstractCollection.java:174)
at java.util.ArrayList.<init>(ArrayList.java:136)
at kodo.datacache.QueryCacheImpl.keySet(QueryCacheImpl.java:165)
at
kodo.datacache.AbstractQueryCache.classesChanged(AbstractQueryCache.java:60)
at
kodo.datacache.DataCacheStoreManager.updateCaches(DataCacheStoreManager.java:217)
at
kodo.datacache.DataCacheStoreManager.commit(DataCacheStoreManager.java:73)
at
kodo.runtime.PersistenceManagerImpl.endTransaction(PersistenceManagerImpl.java:1317)
at
kodo.runtime.PersistenceManagerImpl.afterCompletion(PersistenceManagerImpl.java:998)
at kodo.runtime.LocalManagedRuntime.commit(LocalManagedRuntime.java:86)
at
kodo.runtime.PersistenceManagerImpl.commit(PersistenceManagerImpl.java:629)
at
com.stchome.cdr.actions.SearchCriteriaWizardAction.searchQbe(SearchCriteriaWizardAction.java:345)
at sun.reflect.GeneratedMethodAccessor355.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at
org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:280)
at
org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:216)
at
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at
com.stchome.cdr.servlet.CdrActionServlet.process(CdrActionServlet.java:31)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at
com.stchome.cdr.servlet.filters.SessionManagerFilter.doFilter(SessionManagerFilter.java:41)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at
org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:300)
at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:374)
at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:743)
at
org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:675)
at org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:866)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
at java.lang.Thread.run(Thread.java:534)Thank you stephen, that reply is like music to my ears :)
Stephen Kim wrote:
I would upgrade to 3.3.4 or 3.4 as they have resolved that bug.
Damian Bradicich wrote:
I am receiving the following exception in our app at what appears to be
random intervals.
There were multiple users logged into the system, each getting their own
persistence manager (by way of pmFactory.getPersistenceManager(), which
are then stored in the http session and re-used as long as that user is
logged in) and when they started accessing the system simultaneously
everything was fine for a while (ranged from 30min to 3 hours) then one
person would see the exception, then others would see the exception right
after. Then a few minutes later the problem would be gone again for a
while
I have the multithread option set to true in kodo.properties and am using
pessimistic transactions
Using kodo 3.3.3
I am just curious what might cause something like this, it seems as though
2 threads are trying to commit the same data with the same persistence
manager to me.
My next step in debugging this process is extending the persistence
manager object to add some logging and see if my theory is correct.
Any pointers to tracking this down would be greatly appreciated
kodo.util.FatalDataStoreException: java.util.NoSuchElementException
at
kodo.runtime.PersistenceManagerImpl.afterCompletion(PersistenceManagerImpl.java:1020)
at kodo.runtime.LocalManagedRuntime.commit(LocalManagedRuntime.java:86)
at
kodo.runtime.PersistenceManagerImpl.commit(PersistenceManagerImpl.java:629)
at
com.stchome.cdr.actions.SearchCriteriaWizardAction.searchQbe(SearchCriteriaWizardAction.java:345)
at sun.reflect.GeneratedMethodAccessor355.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at
org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:280)
at
org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:216)
at
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at
com.stchome.cdr.servlet.CdrActionServlet.process(CdrActionServlet.java:31)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at
com.stchome.cdr.servlet.filters.SessionManagerFilter.doFilter(SessionManagerFilter.java:41)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at
org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:300)
at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:374)
at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:743)
at
org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:675)
at org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:866)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
at java.lang.Thread.run(Thread.java:534)
NestedThrowablesStackTrace:
java.util.NoSuchElementException
at serp.util.LookaheadIterator.next(LookaheadIterator.java:57)
at
com.solarmetric.apache.commons.collections.iterators.IteratorChain.next(IteratorChain.java:264)
at kodo.util.CacheMap$EntryIterator.next(CacheMap.java:654)
at java.util.AbstractCollection.toArray(AbstractCollection.java:174)
at java.util.ArrayList.<init>(ArrayList.java:136)
at kodo.datacache.QueryCacheImpl.keySet(QueryCacheImpl.java:165)
at
kodo.datacache.AbstractQueryCache.classesChanged(AbstractQueryCache.java:60)
at
kodo.datacache.DataCacheStoreManager.updateCaches(DataCacheStoreManager.java:217)
at
kodo.datacache.DataCacheStoreManager.commit(DataCacheStoreManager.java:73)
at
kodo.runtime.PersistenceManagerImpl.endTransaction(PersistenceManagerImpl.java:1317)
at
kodo.runtime.PersistenceManagerImpl.afterCompletion(PersistenceManagerImpl.java:998)
at kodo.runtime.LocalManagedRuntime.commit(LocalManagedRuntime.java:86)
at
kodo.runtime.PersistenceManagerImpl.commit(PersistenceManagerImpl.java:629)
at
com.stchome.cdr.actions.SearchCriteriaWizardAction.searchQbe(SearchCriteriaWizardAction.java:345)
at sun.reflect.GeneratedMethodAccessor355.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at
org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:280)
at
org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:216)
at
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at
com.stchome.cdr.servlet.CdrActionServlet.process(CdrActionServlet.java:31)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at
com.stchome.cdr.servlet.filters.SessionManagerFilter.doFilter(SessionManagerFilter.java:41)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at
org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:300)
at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:374)
at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:743)
at
org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:675)
at org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:866)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
at java.lang.Thread.run(Thread.java:534)
Steve Kim
[email protected]
SolarMetric Inc.
http://www.solarmetric.com -
Wrong CAP file version error message
I'm trying to write a loader application that will send a CAP file into JavaCard, and then install it automatically.
I have developed my JavaCard Applet by using Eclipse3.1.0 and JCOP30.
After running my JavaCard Applet by Eclipse, I got its CAP file in folder [b\bin\FVSCardPkg\javacard\[/b]
But when I run my loader application with this CAP file, the error message will display:
EX: msg Wrong CAP file version, class class com.ibm.jc.JCException
Wrong CAP file version
at com.ibm.jc.CapFile.parseHeader(Unknown Source)
at com.ibm.jc.CapFile.readCapFile(Unknown Source)
at com.ibm.jc.CapFile.<init>(Unknown Source)
at LoaderPkg.loader.load(loader.java:35)
at LoaderPkg.loader.main(loader.java:20)
This is my loader application source code:
import java.io.*;
import com.ibm.jc.*;
import com.ibm.jc.terminal.*;
* Sample /**
* Sample loader. Demonstrates how to use the offcard API to download
* a cap-file on a JCOP41V22 Engineering sample card and listing of applets loaded will
* follow.
public class loader{
private final static String termName = "pcsc:4"; // Real card
// private final static String termName = "Remote"; // Simulator
protected static final byte[] JCOP_CARD_MANAGER_AID = { (byte) 0xa0, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00};
protected static final byte defaultInstallParam[] = { -55, 0 };
static String[] capFileName={"D:/MyCardPkg.cap"};
public static void main(String[] args){
try{
loader l = new loader();
l.load();
}catch(Exception e){
System.err.println("EX: msg " + e.getMessage() + ", class " + e.getClass());
e.printStackTrace(System.err);
System.exit(0);
//Likewise for simulation, be patient the port takes time to close.
//Use command line "netstate" to check the disapperance of the port before
// activating JCShell command to read the simulated card.
private loader(){}
private void load() throws Exception{
CapFile capFile = new CapFile(capFileName[0], null);
System.out.println("Package name: " + capFile.pkg);
byte[][] applets = capFile.aids;
if ((applets == null) || (applets.length == 0)){
throw new RuntimeException("no applets in cap file");
// Get connection to terminal, take note that jcop.exe is required to be activated
// in simulation mode.
System.out.println("Open terminal ...");
//Make sure that the simulator jcop.exe is activated before unmarking this satement
//Remember to delete the downloaded applet before running otherwise error is
//expected if the simulator finds the existence of the applet with the
//same pakage name ID and AID
//Issue /close command at "cm" prompt if the card is in use,, ie it should
//have "-" prompt. Be patient that the port takes time to close. Use command line
//"netstate" to check the disapperance of the port before running.
// pcsc:4=Card Terminal Or Remote=LocalHost Terminal
JCTerminal term = JCTerminal.getInstance(termName, null);
//For real JCOP41V22 card, please unmark this statement and delete the downloaded
//applet before running. Error expected if the card finds the existence of the applet
//with the same pakage name ID and AID
//Issue /close command at "cm" prompt if the card is in use,, ie it should
//have "-" prompt.
term.open();
// Add in this statement for real card which requires some response time
term.waitForCard(5000);
// Create a logging terminal spitting out the APDUs on standard out
TraceJCTerminal _term = new TraceJCTerminal();
_term.setLog(new PrintWriter(System.out));
_term.init(term);
term = _term;
// Get JavaCard representative, passing NULL resets card and returns ATR
System.out.println("Get card ...");
JCard card = new JCard(term, null, 2000);
// Get the off-card representative for the card manager and use it to
// select the on-card CardManager
System.out.println("Select card manager ...");
CardManager cardManager = new CardManager(card, CardManager.daid);
cardManager.select();
// For downloading something, we have to be authenticated to card manager.
// For this, the keys must be set. The keys to use should of course
// be configurable as well.
byte[] dfltKey = c2b("404142434445464748494a4b4c4d4e4f");
cardManager.setKey(new OPKey(255, 1, OPKey.DES_ECB, dfltKey));
cardManager.setKey(new OPKey(255, 2, OPKey.DES_ECB, dfltKey));
cardManager.setKey(new OPKey(255, 3, OPKey.DES_ECB, dfltKey));
cardManager.setKey(new OPKey(1, 1, OPKey.DES_ECB, c2b("707172737475767778797a7b7c7d7e7f")));
cardManager.setKey(new OPKey(1, 2, OPKey.DES_ECB, c2b("606162636465666768696a6b6c6d6e6f")));
cardManager.setKey(new OPKey(1, 3, OPKey.DES_ECB, c2b("505152535455565758595a5b5c5d5e5f")));
System.out.println("init Update ...");
cardManager.initializeUpdate(255,0);
System.out.println("Authenticate to card manager ...");
cardManager.externalAuthenticate(OPApplet.APDU_CLR);
// And load the cap-file, do not forget to call installForLoad
System.out.println("Loading cap-file ...");
byte[] cardManagerAid = cardManager.getAID();
cardManager.installForLoad(capFile.pkgId,0, capFile.pkgId.length, cardManagerAid, 0, cardManagerAid.length, null, 0, null, 0, 0, null, 0);
cardManager.load(capFile, null, CardManager.LOAD_ALL, null, cardManager.getMaxBlockLen());
byte[] capaid = capFile.aids[0];
System.out.println("Finished loading !");
// Install applet, we try to install the first applet given in the
// cap file, and try to instantiate it under the same AID as given for its
// representation in the cap file. No installation data is passed.
System.out.println("Installing applet ...");
cardManager.installForInstallAndMakeSelectable(capFile.pkgId, 0, capFile.pkgId.length, capaid,0, capaid.length, capaid, 0, capaid.length, 0, defaultInstallParam, 0, defaultInstallParam.length, null, 0);
System.out.println("Install succeeded!");
// synchronize state with on-card card manager
System.out.println("Update!");
cardManager.update();
// Print information regarding card manager, applets and packages on-card
JCInfo info = JCInfo.INFO;
System.out.println("\nCardManager AID : " + JCInfo.dataToString(cardManager.getAID()));
System.out.println("CardManager state : " + info.toString("card.status", (byte) cardManager.getState()) + "\n");
//Echountered error 6A 86 with this statement:Object[] app = cardManager.getApplets(CardManager.GET_APPLETS,
//CardManager.CVM_FORMAT_HEX, true);
//Solved the bug by playing the integers in arg0 and arg1.
Object[] app = cardManager.getApplets(1, true);
if (app == null) {
System.out.println("No applets installed on-card");
} else {
System.out.println("Applets:");
for (int i = 0; i < app.length; i++) {
System.out.println(info.toString("applet.status", (byte) ((OPApplet) app).getState()) + " " + JCInfo.dataToString(((OPApplet) app[i]).getAID()));
// List packages on card
// Encountered error with this statement:Object[] lf = cardManager.getLoadFiles(CardManager.CVM_FORMAT_HEX, true);
// Solved the bug by setting arg0 = 0,
Object[] lf = cardManager.getLoadFiles(true);
if (lf == null) {
System.out.println("No packages installed on-card");
} else {
System.out.println("Packages:");
for (int i = 0; i < lf.length; i++) {
System.out.println(info.toString("loadfile.status", (byte)((LoadFile) lf[i]).getState()) + " " + JCInfo.dataToString(((LoadFile) lf[i]).getAID()));
term.close();
static String numbers = "0123456789abcdef";
private byte[] c2b(String s) {
if (s == null) return null;
if (s.length() % 2 != 0) throw new RuntimeException("invalid length");
byte[] result = new byte[s.length() / 2];
for (int i = 0; i < s.length(); i += 2) {
int i1 = numbers.indexOf(s.charAt(i));
if (i1 == -1) throw new RuntimeException("invalid number");
int i2 = numbers.indexOf(s.charAt(i + 1));
if (i2 == -1) throw new RuntimeException("invalid number");
result[i / 2] = (byte) ((i1 << 4) | i2);
return result;
How to solve this problem?
Thank you in advance.I'm not understanding if your cap file is in "b\bin\FVSCardPkg\javacard\", then why are you loading "D:/MyCardPkg.cap"?
The issue isn't with your off card application, but the cap file version. Look at the cap file components in JCVM specification. I believe it's the Header component. The major, minor should match your card but not greater. In other words, your can't load a 2.2 on a 2.1 card, but a 2.1 can load on a 2.2 -
How I can log Sequence File version number to database?
Hi,
As in the subject.
How I can log Sequence File version number to database?
There is nothing like that under Logging object.Do you need it in a separate field in the databse?
One option is to just add it as an additional result in a step in your sequence file.
RunState.SequenceFile.AsPropertyObjectFile.Version
Hope this helps,
jigg
CTA, CLA
teststandhelp.com
~Will work for kudos and/or BBQ~ -
Slapd database environment corrupt; wrong log files removed
When our OSX 10.4.10 server boots up, slapd crashes out with a fatal error, followed by an unsuccessful attempt to recover the database. This is from the log:
Sep 22 22:41:49 xyz123 slapd[428]: @(#) $OpenLDAP: slapd 2.2.19 $\n
Sep 22 22:41:49 xyz123 slapd[428]: bdbbackinitialize: Sleepycat Software: Berkeley DB 4.2.52: (December 3, 2003)\n
Sep 22 22:41:49 xyz123 slapd[428]: bdbdbinit: Initializing BDB database\n
Sep 22 22:41:49 xyz123 slapd[428]: bdb(dc=xyz123,dc=mydomain,dc=com): DBENV->logflush: LSN of 3/2806706 past current end-of-log of 1/2458\n
Sep 22 22:41:49 xyz123 slapd[428]: bdb(dc=xyz123,dc=mydomain,dc=com): Database environment corrupt; the wrong log files may have been removed or incompatible database files imported from another environment\n
Sep 22 22:41:49 xyz123 slapd[428]: bdb(dc=xyz123,dc=mydomain,dc=com): gidNumber.bdb: unable to flush page: 0\n
Sep 22 22:41:49 xyz123 slapd[428]: bdb(dc=xyz123,dc=mydomain,dc=com): txn_checkpoint: failed to flush the buffer cache Invalid argument\n
Sep 22 22:41:49 xyz123 slapd[428]: bdb(dc=xyz123,dc=mydomain,dc=com): PANIC: Invalid argument\n
Sep 22 22:41:50 xyz123 slapd[428]: bdbdbopen: dbenv_open failed: DB_RUNRECOVERY: Fatal error, run database recovery (-30978)\n
Sep 22 22:41:50 xyz123 slapd[428]: backend_startup: bidbopen failed! (-30978)\n
Sep 22 22:41:50 xyz123 slapd[428]: bdb(dc=xyz123,dc=mydomain,dc=com): DBENV->lockid interface requires an environment configured for the locking subsystem\n
Sep 22 22:41:50 xyz123 slapd[428]: bdb(dc=xyz123,dc=mydomain,dc=com): DBENV->lockid interface requires an environment configured for the locking subsystem\n
Sep 22 22:41:50 xyz123 slapd[428]: bdb(dc=xyz123,dc=mydomain,dc=com): DBENV->lockid interface requires an environment configured for the locking subsystem\n
Sep 22 22:41:50 xyz123 slapd[428]: bdb(dc=xyz123,dc=mydomain,dc=com): DBENV->lockid interface requires an environment configured for the locking subsystem\n
Sep 22 22:41:50 xyz123 slapd[428]: bdb(dc=xyz123,dc=mydomain,dc=com): DBENV->lock_idfree interface requires an environment configured for the locking subsystem\n
Sep 22 22:41:50 xyz123 slapd[428]: bdb(dc=xyz123,dc=mydomain,dc=com): txn_checkpoint interface requires an environment configured for the transaction subsystem\n
Sep 22 22:41:50 xyz123 slapd[428]: bdbdbdestroy: txn_checkpoint failed: Invalid argument (22)\n
Sep 22 22:41:50 xyz123 slapd[428]: slapd stopped.\n
We are able to get it running by deleting the log file at /var/db/openldap/openldap-data/log.0000000001 and then rebooting. Thereafter the slapd.log complains:
Sep 23 20:30:30 xyz123 slapd[58]: bdb(dc=xyz123,dc=dc=mydomain,dc=com): DBENV->logflush: LSN of 1/467990 past current end-of-log of 1/226654\n
Sep 23 20:30:30 xyz123 slapd[58]: bdb(dc=xyz123,dc=dc=mydomain,dc=com): Database environment corrupt; the wrong log files may have been removed or incompatible database files imported from another environment\n
Sep 23 20:30:30 xyz123 slapd[58]: bdb(dc=xyz123,dc=dc=mydomain,dc=com): sn.bdb: unable to flush page: 0\n
We've tried running db_recover -c but that hasn't worked, or at least, we perhaps didn't do it right. We don't have a backup database that predates the existence of this problem.
I'd appreciate if anyone has help or could point us to a resource explaining what to do to get our slapd working right.thank you for giving us a test program. This helped tremendously to fully understand what you are doing. In 5.3 we fixed a bug dealing with the way log files are archived in an HA environment. What you are running into is the consequences of that bug fix. In the test program you are using DB_INIT_REP. This is the key to use that you want an HA environment. With HA, there is a master and some number of read only clients. By default we treat the initiating database as the master. This is what is happening in our case. In an HA (replicated) environment, we cannot archive log files until we can be assured that the clients have applied the contents of that log file. Our belief is that you are not really running in an HA environment and you do not need the DB_INIT_REP flag. In our initial testing where we said it worked for us, this was because we did not use the DB_INIT_REP flag, as there was no mention of replication being needed in the post.
Recommendation: Please remove the use of the DB_INIT_REP flag or properly set up an HA environment (details in our docs).
thanks
mike -
I'm trying to use CSOM to get info about old versions of list items. But while I can retrieve the FileVersionCollection (File.Versions) fine, the only info it gives me for each version is the ID/Label/Created/CreatedBy/Url. It doesn't give me any other field
values.
I know I can get this info using lists.asmx/GetVersionCollection, but that API only returns the specified field value, Modified and ModifiedBy for each version.
That would be OK if the Modified timestamp matched the Created timestamp returned in the FileVersionCollection, but it doesn't, and in fact, the Created field of FileVersion seems to be simply incorrect in many cases. For instance, when I look at the
version history page for one item I see:
2.0
1/15/2015 4:35 PM Edit
Administrator < 1 KB
1.0
1/12/2015 4:30 PM Edit
Administrator < 1 KB
But File.Versions has:
3.0 1/15/2015 5:33:49 AM
2.0 1/12/2015 5:18:11 AM
1.0 1/12/2015 5:18:11 AM
Obviously the latter is in the UTC, but even converted to local time, the timestamps don't correspond at all. Nor do I understand why there are three entries (I assume 3.0 is the 'latest' version that the version history screen doesn't show, but it's reported
'Created' date is before the date of version 2).
GetVersionCollection in comparison returns:
<Version Departments=";#Sales;#Development;#" Modified="2015-01-15T05:35:48Z" Editor="1;#Administrator,#i:0#.w|sp2013dev\administrator,#,#,#Administrator" />
<Version Departments=";#Development;#Sales;#" Modified="2015-01-15T03:55:07Z" Editor="1;#Administrator,#i:0#.w|sp2013dev\administrator,#,#,#Administrator" />
<Version Departments=";#Development;#Sales;#" Modified="2015-01-12T05:30:06Z" Editor="1;#Administrator,#i:0#.w|sp2013dev\administrator,#,#,#Administrator" />
Where the 3rd entry would seem to be version 1.0 (512), and the first entry the latest version, but the middle entry has a completely different date that doesn't correspond to anything else!
And yes I'm absolutely sure these are all for the same item.
BTW if I specify "Created" as the field for GetVersionCollection, I just get the same Created date for all 3:
1/12/2015 5:15:48 AM - a completely new date that doesn't correspond to anything else at all!
For kicks I just tried it with the "Version" field, and now I get:
<Version Version="4.0" Modified="2015-01-15T05:35:48Z" Editor="1;#Administrator,#i:0#.w|sp2013dev\administrator,#,#,#Administrator" />
<Version Version="3.0" Modified="2015-01-15T05:33:49Z" Editor="1;#Administrator,#i:0#.w|sp2013dev\administrator,#,#,#Administrator" />
<Version Version="2.0" Modified="2015-01-15T03:55:07Z" Editor="1;#Administrator,#i:0#.w|sp2013dev\administrator,#,#,#Administrator" />
<Version Version="1.0" Modified="2015-01-12T05:30:06Z" Editor="1;#Administrator,#i:0#.w|sp2013dev\administrator,#,#,#Administrator" />
Well I suppose technically that now gives me enough info to locate the right version, but talk about convoluted...then I still have to figure out how to parse the field value (which in this case is a multi-choice field, but I need to support all field types).Hi,
Please check the code as below, it working fine in my test environment.
public DataTable GetDoucmentHistory(string listName, int id)
using (ClientContext ctx = GetClientContext())
var file = ctx.Web.Lists.GetByTitle(listName).GetItemById(id).File;
var versions = file.Versions;
ctx.Load(file);
ctx.Load(versions);
ctx.Load(versions, vs => vs.Include(v => v.CreatedBy));
ctx.ExecuteQuery();
var ds = CreatHistoryDataSet();
foreach (FileVersion fileVersion in versions)
var row = ds.Tables[0].NewRow();
row["CreatedBy"] = fileVersion.CreatedBy.Title;
row["Comments"] = fileVersion.CheckInComment;
fileVersion.Created.ToUniversalTime();
row["Created"] = fileVersion.Created.AddHours(-8).ToShortDateString() + " " +
fileVersion.Created.AddHours(-8).ToShortTimeString();
row["Title"] = file.Title;
row["VersionLabel"] = fileVersion.VersionLabel;
row["IsCurrentVersion"] = fileVersion.IsCurrentVersion;
ds.Tables[0].Rows.Add(row);
DataView view = ds.Tables[0].DefaultView;
view.Sort = "VersionLabel DESC";
DataTable sortedTable = view.ToTable();
return sortedTable;
private static System.Data.DataSet CreatHistoryDataSet()
DataSet ds = new DataSet();
DataTable table = new DataTable();
table.Columns.Add("Title");
table.Columns.Add("Created");
table.Columns.Add("CreatedBy");
table.Columns.Add("EncodedAbsUrl");
table.Columns.Add("VersionLabel");
table.Columns.Add("Comments");
table.Columns.Add("IsCurrentVersion");
ds.Tables.Add(table);
return ds;
To get all versions of version field you just need to call GetVersionCollection method on version field by passing it's internal name
_UIVersionString
Simple code snippet:
ListProxy.Lists lists = new Lists();
lists.UseDefaultCredentials = true;
XmlNode versions = lists.GetVersionCollection("{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx}",
"n", "_UIVersionString");
foreach(XmlNode version in versions.ChildNodes)
Console.WriteLine(version.Attributes["_UIVersionString"].Value);
More information is here:
http://sharepoint.stackexchange.com/questions/27346/how-to-programmatically-retrieve-item-version-history-from-client
Thanks,
Dennis Guo
TechNet Community Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
[email protected].
Dennis Guo
TechNet Community Support -
Kodo.util.*Identity not working in 3.3.2?
Hi, I have been trying to use one of the kodo identity classes for
application identity:
<class name="Person"
identity-type="application"
objectid-class="kodo.util.LongIdentity"
unfortunately the enhancer fails on a missing constructor??
[jdoc] kodo.util.FatalUserException: The objectid-class specified
by type "class kodo.Person" does not have public a no-args constructor.
2nd related question: I developed my own LongIdentity that has the missing
constructor and was planning to use it for most of my object model. on
some occasions, kodo seems to get confused about using the same
object-id-class for more than 1 persistent class:
<class name="Person"
identity-type="application"
objectid-class="kodo.AddressId" <!-- similar to
kodo.util.LongIdentity, used as well by persistent class Address -->
trying to load by id a Person:
Person person = (Person) ((KodoPersistenceManager)
pm).getObjectById(Person.class, ""+2000); // select
6750 TRACE [main] kodo.jdbc.SQL - <t 31737213, conn 19287723> [0 ms]
executing prepstmnt 26665270 SELECT t0.CITY, t0.STREET FROM ADDRESS t0
WHERE t0.ID = ? [params=(long) 2000] [reused=0]
kodo.util.ObjectNotFoundException: The instance "2000 [kodo.AddressId]"
does not exist in the data store.[2000 [kodo.AddressId]]
at
kodo.runtime.PersistenceManagerImpl.getObjectById(PersistenceManagerImpl.java:2090)
at
kodo.runtime.PersistenceManagerImpl.getObjectById(PersistenceManagerImpl.java:2005)
at
kodo.runtime.PersistenceManagerImpl.getObjectById(PersistenceManagerImpl.java:2285)
the problem is that a select on the address table gets executed??
note: if I make a copy/paste of my AddressId and rename it PersonId, then
this works fine.
if all pk are of type long, are we expected to subclass
kodo.util.LongIdentity and add the default constructor for each persistent
class?
thanks for the help,
v.here you go:
<?xml version="1.0" encoding="UTF-8"?>
<jdo>
<package name="kodo">
<class name="Address" identity-type="application">
<extension vendor-name="kodo" key="jdbc-class-map"
value="base"></extension>
<extension vendor-name="kodo" key="jdbc-class-map/table"
value="ADDRESS"></extension>
<extension vendor-name="kodo" key="jdbc-version-ind"
value="none"></extension>
<extension vendor-name="kodo" key="jdbc-class-ind-name"
value="none"></extension>
<extension vendor-name="kodo" key="detachable"
value="serialize"></extension>
<field name="id" primary-key="true">
<extension vendor-name="kodo" key="sequence-assigned"
value="true"></extension>
<extension vendor-name="kodo" key="jdbc-field-map"
value="value"></extension>
<extension vendor-name="kodo" key="jdbc-field-map/column"
value="ID"></extension>
</field>
<field name="city">
<extension vendor-name="kodo" key="jdbc-field-map"
value="value"></extension>
<extension vendor-name="kodo" key="jdbc-field-map/column"
value="CITY"></extension>
</field>
<field name="street">
<extension vendor-name="kodo" key="jdbc-field-map"
value="value"></extension>
<extension vendor-name="kodo" key="jdbc-field-map/column"
value="STREET"></extension>
</field>
</class>
<class name="Person" identity-type="application">
<extension vendor-name="kodo" key="jdbc-class-map"
value="base"></extension>
<extension vendor-name="kodo" key="jdbc-class-map/table"
value="PERSON"></extension>
<extension vendor-name="kodo" key="jdbc-version-ind"
value="none"></extension>
<extension vendor-name="kodo" key="jdbc-class-ind-name"
value="none"></extension>
<extension vendor-name="kodo" key="detachable"
value="serialize"></extension>
<field name="addresses" default-fetch-group="true">
<collection element-type="kodo.Address">
</collection>
<extension vendor-name="kodo" key="jdbc-field-map"
value="one-many"></extension>
<extension vendor-name="kodo" key="jdbc-field-map/ref-column.ID"
value="P_ID"></extension>
<extension vendor-name="kodo" key="jdbc-field-map/table"
value="ADDRESS"></extension>
</field>
<field name="firstname">
<extension vendor-name="kodo" key="jdbc-field-map"
value="value"></extension>
<extension vendor-name="kodo" key="jdbc-field-map/column"
value="FIRSTNAME"></extension>
</field>
<field name="id" primary-key="true">
<extension vendor-name="kodo" key="sequence-assigned"
value="true"></extension>
<extension vendor-name="kodo" key="jdbc-field-map"
value="value"></extension>
<extension vendor-name="kodo" key="jdbc-field-map/column"
value="ID"></extension>
</field>
<field name="lastname">
<extension vendor-name="kodo" key="jdbc-field-map"
value="value"></extension>
<extension vendor-name="kodo" key="jdbc-field-map/column"
value="LASTNAME"></extension>
</field>
</class>
</package>
<!--
To use additional vendor extensions, create a vendor-extensions.xml file
that
contains the additional extensions (in extension tags) and place it in
your
projects merge dir.
-->
</jdo>
Patrick Linskey wrote:
Hi Vincent,
Can you post the .jdo file that XDoclet is creating please?
-Patrick
Vincent Sevel wrote:
I tried that but run into another exception:
* @jdo.persistence-capable identity-type="application"
* @jdo.class-vendor-extension vendor-name="kodo" key="jdbc-class-map"
value="base"
* @jdo.class-vendor-extension vendor-name="kodo"
key="jdbc-class-map/table" value="PERSON"
* @jdo.class-vendor-extension vendor-name="kodo" key="jdbc-version-ind"
value="none"
* @jdo.class-vendor-extension vendor-name="kodo"
key="jdbc-class-ind-name" value="none"
* @jdo.class-vendor-extension vendor-name="kodo" key="detachable"
value="serialize"
public class Person implements Serializable {
* @jdo.field primary-key="true"
* @jdo.field-vendor-extension vendor-name="kodo"
key="sequence-assigned" value="true"
* @jdo.field-vendor-extension vendor-name="kodo" key="jdbc-field-map"
value="value"
* @jdo.field-vendor-extension vendor-name="kodo"
key="jdbc-field-map/column" value="ID"
private Long id;
javax.jdo.JDOFatalInternalException
at kodo.Person.jdoNewObjectIdInstance(Person.java)
at kodo.util.ApplicationIds.create(ApplicationIds.java:280)
at
kodo.runtime.PersistenceManagerImpl.makePersistent(PersistenceManagerImpl.java:2424)
at
kodo.runtime.PersistenceManagerImpl.makePersistent(PersistenceManagerImpl.java:2371)
>>
Person p1 = new Person();
p1.setFirstname("vince");
p1.setLastname("sevel");
Address adr1 = new Address();
adr1.setStreet("1er mai");
adr1.setCity("geneve");
p1.getAddresses().add(adr1);
pm.makePersistent(p1);
I must be missing a flag or property somewhere??
thanks,
v.
Abe White wrote:
When using single field identity in JDO, you don't list an objectid-class
at
>>
all
in your metadata. Just set identity-type to "application". -
hi;
I'm totally new to the oracle databases field...am trying to startup the database using the parameter file init.ora by using the command
startup pfile='/u01/app/oracle/product/10.2.0/db_1/dbs/init.ora'
But its giving me the following error:
ORA-00201: control file version 10.2.0.1.0 incompatible with ORACLE version
10.2.0.0.0
ORA-00202: control file:
'/u01/app/oracle/product/10.2.0/db_1/dbs/control01.ctl'
Can anyone help me with this error?
Thanks!startup pfile='/u01/app/oracle/product/10.2.0/db_1/dbs/init.ora'You are most likely using the wrong init.ora file. Get a list of files at /u01/app/oracle/product/10.2.0/db_1/dbs/
For the database ORACLE_SID that you are attempting to startup, there would be an initSID.ora or spfileSID.ora
e.g. if the ORACLE_SID is PROD, the file would be initPROD.ora or spfilePROD.ora
The spfileSID.ora is a binary file and should not be accessed by a text-editor.
Hemant K Chitale -
How to find database files location (from system flat files)
Hi all,
Is there anyone who could help me to understand the Oracle database starting mechanism. I'm looking the doc for a few days, but it lacks some details...
I'm currently using Oracle 10g on RedHat, and my database has been created using DBCA. While the installation process, DBCA allows to use a customized location for "*all the database files*". I've chosen */data*.
Now, when I'm looking in my /etc/oratab file, I can see: mydb:$ORACLE_HOME:N
I guess the startup process of Oracle reads /etc/oratab (or I didn't understand its utility...) and then goes to $ORACLE_HOME to find the database infos. In this directory, I can see a directory named hostname_mydb/ and dbs/
The dbs/ directory contains my pfile (initmydb.ora) which contains some parameters such as control files, but nothing about the parent directory of my database files, ie:
control_files= /data/oradata/mydb/control01.ctl,....*
but no DB_CREATE_FILE_DEST as I could expect if the db was created through OMF.
The hostname_mydb/ contains nothing but a sysman directory.
I wonder how Oracle process knows where are the .dbf files or the "parent directory of database files" ? Does anyone have a clue?
I know it is possible to ask through sqlplus for .dbf location but I don't think it's the way used for the startup process (or at least, I hope there is another way)
Thanks! (and sorry if the question seems obvious or stupid...)907899 wrote:
Thank you very much CPKT for all these details. It helps me to see clearer!
You are right, I have configure an Oracle Enterprise Manager and I didn't notice this directory was related to it...
And as I first thought, many data are in the binary control file. I just thought Oracle was a more simple system :)
You mention an Architecture Guide for DBA, is it the Database Concepts manual mentioned in the first reply or is it another manual (I can't find it, but obviously I have to improve my searching technique...)
Thanks!=================================================
Learning how to look things up in the documentation is time well spent investing in your career. To that end, you should drop everything else you are doing and do the following:
Go to tahiti.oracle.com.
Drill down to your product and version.
<b><i><u>BOOKMARK THAT LOCATION</u></i></b>
Spend a few minutes just getting familiar with what is available here. Take special note of the "books" and "search" tabs. Under the "books" tab you will find the complete documentation library.
Spend a few minutes just getting familiar with what <b><i><u>kind</u></i></b> of documentation is available there by simply browsing the titles under the "Books" tab.
Open the Reference Manual and spend a few minutes looking through the table of contents to get familiar with what <b><i><u>kind</u></i></b> of information is available there.
Do the same with the SQL Reference Manual.
Do the same with the Utilities manual.
You don't have to read the above in depth. They are <b><i><u>reference</b></i></u> manuals. Just get familiar with <b><i><u>what</b></i></u> is there to <b><i><u>be</b></i></u> referenced. Ninety percent of the questions asked on this forum can be answered in less than 5 minutes by simply searching one of the above manuals.
Then set yourself a plan to dig deeper.
- Read a chapter a day from the Concepts Manual.
- Take a look in your alert log. One of the first things listed at startup is the initialization parms with non-default values. Read up on each one of them (listed in your alert log) in the Reference Manual.
- Take a look at your listener.ora, tnsnames.ora, and sqlnet.ora files. Go to the Network Administrators manual and read up on everything you see in those files.
- When you have finished reading the Concepts Manual, do it again.
Give a man a fish and he eats for a day. Teach a man to fish and he eats for a lifetime.
================================= -
Hi,
I'm having a serious issue with your brend new Cisco Prime Network Control System (NCS) and i would appreciate if someone could give me good answers.
After a background backup task failure, the database was entirelly corrupted and the oracle server no longuer wanted to start. And because of that the NCS web server is unusable, since no one can log in.
We tryed to restore to last known backup obtained after a former suucessful backup. But we get this error:
"ERROR: invalid backup file version. Exception: Error while unzipping invalid wcs 7.x export file"
All the lost data was previously migrated from the former WCS 7.x server. Before this issue everything was working fine.
So we think that the appliance is seeing the backup file from NCS as a WCS backup.
We need to find rapidly a solution. Here is our configuration:
We formerly had WCS 7.0.172.0 hosted on Microsoft Windows Server 2003 SP2 with the above caracteristics:
Intel(R)Xeon(R) CPU 5120 @ 1.86Ghz 1.87Ghz 16GB of RAM.
We now have NCS Version 1.1.1.24 running under Cisco Application Deployment Engine
OS Release: 2.0
ADE-OS Build Version: 2.0.1.038
ADE-OS System Architecture: x86_64I was getting this error too. TL;DR: When you transfer the wcs.zip file to your FTP server, make sure you are using BINARY mode... which is often NOT the default FTP mode.
Long Version:
TO GET THIS ERROR, what I had done was use the Windows CLI FTP command to transfer my "wcs.zip" to the NCS FTP server.
-----BEGIN WRONG STEPS-----
C:\ftp
ftp> open x.x.x.x
Connected to x.x.x.x.
220 Service ready for new user
User (x.x.x.x:(none)): ftp-user
331 User name okay, need password for ftp-user
Password:
230 User logged in, proceed
ftp> put wcs.zip
200 Command PORT okay
150 File status okay; about to open data connection
226 Closing data connection
ftp: 526768949 bytes sent blah blah etc
-----END WRONG STEPS-----
I would then run "ncs stop" and "ncs migrate" and get the "ERROR: invalid backup file version. Exception: Error while unzipping invalid wcs 7.x export file".
I remembered something from my misspent youth: Windows, for no good reason, likes to transfer files in ASCII mode. UNIX (which LINUX comes from) prefers BINARY, and the two do not like to negotiate.
TO FIX THIS, I had to just FTP in Binary mode.
-----BEGIN RIGHT STEPS-----
C:\ftp
ftp> open x.x.x.x
Connected to x.x.x.x.
220 Service ready for new user
User (x.x.x.x:(none)): ftp-user
331 User name okay, need password for ftp-user
Password:
230 User logged in, proceed
ftp> binary
200 Command TYPE okay
ftp> put wcs.zip
200 Command PORT okay
150 File status okay; about to open data connection
226 Closing data connection
ftp: 526768949 bytes sent blah blah etc
-----END RIGHT STEPS-----
NOW when I enter "ncs stop" (actually... had to restart them... then stop them... x.x) and then the proper "ncs migrate" commands, I get a happy output and don't have to go home late troubleshooting this.
" Stage 1 of 5: Decompressing backup ...
-- complete.
Stage 2 of 5: Restoring Support Files ...
: Restoring the Domain Maps ...
: -- complete.
: Restoring the License files ...
: -- complete.
-- complete.
Stage 3 of 5: Restoring Data ...
I hope this helps anyone banging their head against the WCS->PI1.3 install wall.
(Note, WCS needs to be migrated to NCS 1.1.1.24 (NOT NCS 1.1.3!!!!!) before you can migrate to Prime Infrastructure 1.2 or 1.3, because for no readily apparent reason the "ncs migrate" command was removed from PI 1.2 and up. Also note, there is no "Prime Infrastructure 1.1;" they just renamed NCS to Prime Infrastructure after NCS 1.1 because. Yes, the sentence ends there. Great products, all 3, just... agonizing to migrate.) -
I have what I think is a large DB file - 68gig. I feel like I'm probably not utilizing things the best way. I'd like to either put the database file on an external drive or at least split the file up - so I can have some of the databases reside on an external drive that I don't use as much.
Any suggestions? Again, I have EVERYTHING in one DB file right now - and I'm curious if there is a better practice in file management - that can help me use space more wisely.
Thanks,
VicAnd your statement is one of the reasons why I consider going back to managed instead of referenced.
Together with a lot of photographers, I was influenced by the hype from a lot of users in version 1.x of Aperture about not being able to have referenced files instead of managed. There were a lot of factors in favor for a referenced library, and lack of disk space one of the most important.
As it turns out, disks are getting larger and more inexpensive all the time so I really see no problem in using a managed library on a stationary mac. Having a small library on a laptop and then export the project into the main library is IMHO also a good solution.
Using a managed library also protects the masters from being messed up by accident.
However, the possibility to span the managed library over different disks would be appreciated.
Regards
Paul K -
Class kodo.util.ObjectNotFoundException
Hi,
I'm getting this exception when running my application
class kodo.util.ObjectNotFoundException
The instance of type "com.jario.server.entitymodel.EntityLocation" with oid
"com.jario.server.entitymodel.EntityLocation-753" no longer exists in the
data store. This may mean that you deleted the instance in a separate
persistence manager, but this persistence manager still has a cached
version.
kodo.runtime.StateManagerImpl.loadFields(StateManagerImpl.java:2667)
kodo.runtime.StateManagerImpl.loadField(StateManagerImpl.java:2744)
kodo.runtime.StateManagerImpl.isLoaded(StateManagerImpl.java:1116)
com.jario.server.entitymodel.EntityLocation.jdoGetfileStorageType(EntityLoca
tion.java)
But the object is the in database with JDOID 753.
When I restart the instance It finds it no bother.
I'm running Kodo 3.0.1 Ent. (Licenced)
Why is this happening?
Kind Regards
Graham CruickshanksKodo 3.0.2 seems to have fixed this issue.
Cheers
Graham Cruickshanks
"Graham Cruickshanks" <[email protected]> wrote in message
news:buqr0f$7qk$[email protected]..
>
"Abe White" <[email protected]> wrote in message
news:buq0t4$kg9$[email protected]..
Are you using the data cache?No, Kodo.properties are as follows
javax.jdo.PersistenceManagerFactoryClass:
kodo.jdbc.runtime.JDBCPersistenceManagerFactory
kodo.LicenseKey: <REMOVED>
kodo.PersistenceManagerImpl: CloseOnManagedCommit=true
kodo.jdbc.SequenceFactory: PrimaryKeyColumn=PKX, SequenceColumn=SEQUENCEX,
TableName=JDO_SEQUENCEX
kodo.FlushBeforeQueries: true
javax.jdo.option.IgnoreCache: false
javax.jdo.option.ConnectionDriverName: com.mysql.jdbc.Driver
javax.jdo.option.ConnectionPassword:
javax.jdo.option.ConnectionURL:
jdbc:mysql://localhost/JarioServer?autoReconnect=true
javax.jdo.option.ConnectionUserName: JarioServer
kodo.jdbc.DBDictionary: mysql(StoreCharsAsNumbers=false, TableType=InnoDB)
Have you possibly deleted the object and flushed within the same
transaction?I have no delete actions this part of my application, so this is an
impossablity
If you enable SQL logging, you can see the last SELECT statement that is
failing. What happens if you run this against your DB directly?I'm experiencing other problems than just the listed error. I'mexperiencing
sporadic null pointer exceptions on call's that should return values from
the database.
The SQL trace shows the 'Select' query has been done, and if I try running
this with direct SQL to database it returns results. The results in the
tables where this happens have not be written too since applicationstartup.
so i can't be a flushing/datacache error.
The database & driver has not changed from KODO 2.x which worked fine.
Details
Database: 4.10.13-nt
Driver: mysql-connector-java-3.0.9-stable-bin.jar (Tried 3.0.10 as well,
same issue)
Java version: 1.4.2_01-b06
Kodo: 3.0.1 -
Kodo.util.InternalException: null
Hello,
I'm trying new persistence EJB3 implementation from SolarMetric:
kodo-4.0.0EA3
I have constructed a simple test app. And when I try to run it I get:
Exception in thread "main" <1|true|4.0.0EA3> kodo.util.InternalException:
null
at
kodo.synthetic.com.dalitest.ClientKodoSyntheticSubclassProxy.kodoNewObjectIdInstance(Unknown
Source)
at kodo.util.ApplicationIds.create(ApplicationIds.java:246)
at kodo.kernel.BrokerImpl.persist(BrokerImpl.java:2433)
at kodo.kernel.BrokerImpl.persistSafe(BrokerImpl.java:2379)
at kodo.kernel.BrokerImpl.persist(BrokerImpl.java:2366)
at kodo.kernel.DelegatingBroker.persist(DelegatingBroker.java:1275)
at kodo.persistence.EntityManagerImpl.persist(EntityManagerImpl.java:519)
at com.dalitest.Test.main(Test.java:21)
Do you know what is going on?
Here is my code:
package com.dalitest;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.EntityTransaction;
import javax.persistence.Persistence;
public class Test
public static void main(String[] args)
EntityManagerFactory factory =
Persistence.createEntityManagerFactory("kodo");
EntityManager em = factory.createEntityManager();
Client c1 = new Client();
c1.setName("John Doe");
EntityTransaction t = em.getTransaction();
t.begin();
em.persist(c1);
t.commit();
and Client.java:
package com.dalitest;
import javax.persistence.AccessType;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Id;
import javax.persistence.Column;
@Entity(access = AccessType.PROPERTY)
@Table(name="DALI_CLIENTS")
public class Client
private String id;
private String name;
public void setName(String name)
this.name = name;
@Column(name="NAME")
public String getName()
return name;
public void setId(String id)
this.id = id;
@Id
@Column(name="ID")
public String getId()
return id;
and my persistence.xml:
<?xml version="1.0"?>
<entity-manager>
<name>kodo</name>
<provider>kodo.persistence.PersistenceProviderImpl</provider>
<class>com.dalitest.Client</class>
<properties>
<property name="kodo.LicenseKey"
value="XXX" />
<property name="kodo.ConnectionURL"
value="XXX" />
<property name="kodo.ConnectionDriverName"
value="oracle.jdbc.driver.OracleDriver" />
<property name="kodo.ConnectionUserName" value="XXX" />
<property name="kodo.ConnectionPassword" value="XXX" />
<property name="kodo.Log" value="DefaultLevel=WARN, Tool=INFO" />
</properties>
</entity-manager>
Where I have masked some values with XXX for this post.
Thanks in advance,
RuslanAlso I tried to enable DEBUG mode
<property name="kodo.Log" value="DefaultLevel=WARN, Tool=INFO" />
And got the following output before this exception:
15 INFO [main] kodo.Runtime - Starting Kodo 4.0.0EA3
62 DEBUG [main] kodo.Runtime - License capabilities: "Kodo Standard
Edition,Kodo Community Edition,Kodo Evaluation Edition,Datacache
Plug-in,Custom Result Object Providers,Custom Mappings,Enterprise
Databases,Query Extensions,Performance Pack,Statement Batching,Kodo
Enterprise Edition,Managed Environment,Developer Tools,Custom
DBDictionaries" Expiration: "2/25/06 7:00 PM" Maintenance expiration:
"2/25/06 7:00 PM"
187 INFO [main] kodo.jdbc.JDBC - Using dictionary class
"kodo.jdbc.sql.OracleDictionary".
343 INFO [main] kodo.MetaData - Found 1 classes with metadata in 0
milliseconds.
422 INFO [main] kodo.MetaData - parse-class
422 INFO [main] kodo.MetaData - parse-package
Exception in thread "main" <1|true|4.0.0EA3> kodo.util.InternalException:
null
at
kodo.synthetic.com.dalitest.ClientKodoSyntheticSubclassProxy.kodoNewObjectIdInstance(Unknown
Source)
at kodo.util.ApplicationIds.create(ApplicationIds.java:246)
at kodo.kernel.BrokerImpl.persist(BrokerImpl.java:2433)
at kodo.kernel.BrokerImpl.persistSafe(BrokerImpl.java:2379)
at kodo.kernel.BrokerImpl.persist(BrokerImpl.java:2366)
at kodo.kernel.DelegatingBroker.persist(DelegatingBroker.java:1275)
at kodo.persistence.EntityManagerImpl.persist(EntityManagerImpl.java:519)
at com.dalitest.Test.main(Test.java:21) -
Exception thrown kodo.util.OptimisticVerficationException
I am working with Kodo Jdo,
I trying to set the properties of a user objt and set it in the session
object to work with it in the different pages.
I have a UI form to modify the User properties and then call the
respective action update method.
public ActionForward update(ActionMapping mapping, ActionForm form,
HttpServletRequest request,
HttpServletResponse response) throws NoUserSessionException {
ActionMessages messages = new ActionMessages();
PersistenceManager pm =
Utils.getPersistenceManagerFactory().getPersistenceManager();
User user = sessionUtils.getUser(pm, request); // get user from
the session object
if (validateFields(form, user, messages)) {
Transaction tx = pm.currentTransaction();
tx.begin();
form2model(form, user, pm); // move the values from form
to the user object
refreshUserSession(request, user); // update the session
with the user values.
tx.commit();
messages.add("success", new
ActionMessage("userPreferencesForm.message.operation.successfully"));
saveMessages(request, messages);
model2form(pm, user, form,request);
pm.close();
return mapping.findForward("form");
it work fine a couple of times , but once in the while when i try to get
the user in the session from the other pages I get a Exception when it
reach the excecution between the tx.begin and tx.commit of the update
method (above).
kodo.util.PtimisticVerificationException : There was 1 optimistic locking
error when flushing to the data store. This indicates that an object was
concurrently modified in another transaction. the exception in the nested
throwables array contains a failed object representing a concurrently
modified object.
can someone could tell me what can I do to solve the problem...
thanks in advance.Hi Marc,
I wasnt able to enable trace-level for SQL and JDBC
I added to jdo.properties the following:
# kodo.Log: SQL=TRACE, JDBC=TRACE
#kodo.Log: DefaultLevel=WARN, Runtime=INFO, Tool=INFO, SQL=TRACE
#kodo.Log: /tmp/kodo.log , DefaultLevel=WARN, Runtime=INFO, Tool=INFO,
#SQL=TRACE
kodo.Log: SQL=TRACE
also I tried using log4J by adding to jdo.properties
kodo.Log: log4j
and adding a log4j.properties file with the following:
log4j.rootCategory=WARN, console
log4j.category.kodo.jdbc.SQL=TRACE
log4j.category.kodo.jdbc.JDBC=TRACE
log4j.appender.console=org.apache.log4j.ConsoleAppender
could you advice me.
Marc Prud'hommeaux wrote:
Emmanuel-
An OptimisticVerficationException means that you are trying to update an
instance in the database, but that instance has been changed in between
the time when your instance was first obtained and the time at which you
try to commit the changes.
In order to track down why this is happening, you will usually do the
following:
1. Determine the failed object by calling
OptimisticVerficationException.getFailedObject. Printing this object out
in a debugging statement helps identify which instance has failed.
2. Enable TRACE-level SQL and JDBC logging and watch for other processes
that update that instance in the database.
3. Examine the SQL log for the last failed statement that was executed:
this will usually contain the lock column (e.g. "JDOVERSION") that is
being validated.
If you would like our assistance in determing exactly where the problem
is, please post the log with SQL and JDBC channels set to "TRACE", as
well as the complete stack trace from the exception.
In article <[email protected]>, Emmanuel wrote:
I am working with Kodo Jdo,
I trying to set the properties of a user objt and set it in the session
object to work with it in the different pages.
I have a UI form to modify the User properties and then call the
respective action update method.
public ActionForward update(ActionMapping mapping, ActionForm form,
HttpServletRequest request,
HttpServletResponse response) throws NoUserSessionException {
ActionMessages messages = new ActionMessages();
PersistenceManager pm =
Utils.getPersistenceManagerFactory().getPersistenceManager();
User user = sessionUtils.getUser(pm, request); // get user from
the session object
if (validateFields(form, user, messages)) {
Transaction tx = pm.currentTransaction();
tx.begin();
form2model(form, user, pm); // move the values from form
to the user object
refreshUserSession(request, user); // update the session
with the user values.
tx.commit();
messages.add("success", new
ActionMessage("userPreferencesForm.message.operation.successfully"));
saveMessages(request, messages);
model2form(pm, user, form,request);
pm.close();
return mapping.findForward("form");
it work fine a couple of times , but once in the while when i try to get
the user in the session from the other pages I get a Exception when it
reach the excecution between the tx.begin and tx.commit of the update
method (above).
kodo.util.PtimisticVerificationException : There was 1 optimistic locking
error when flushing to the data store. This indicates that an object was
concurrently modified in another transaction. the exception in the nested
throwables array contains a failed object representing a concurrently
modified object.
can someone could tell me what can I do to solve the problem...
thanks in advance.
Marc Prud'hommeaux
SolarMetric Inc.
Maybe you are looking for
-
When I download a cd it loads as separate songs and not a single album
When I download one particular CD to I Tunes on my Mac Book Pro it loads as separate songs and not a single a single album.
-
Cannot deactivate old computer of Acrobat Pro
I purchased a new computer and successfully installed Acrobat 9 Pro. I went to use it today, but I get an error message Nancy Pommerening: "You cannot use this product at this time. You must repair the problem by uninstalling and then reinsatalling t
-
Squidoo not saving on ONE Mac only
Hello, I've started a couple of lens's on Squidoo.com. The problem is that I cannot edit and save my lens on my primary computer - an eMac running OS X 10.4.9 - using Safari, Firefox, Shirra or any other browser. However, I can edit and save it on my
-
Hi Folks, I use the wizard to generate my sql query with parameters ( select, update, insert and delete) I can get data from database in my datagrid but if I want update my data from datagrid to database, I get the following error: An unhandled excep
-
Displaying AVI Files through web server
I am using Labview & Vision assistant to analyze an avi file The file is compressed and is 207KB and 5 secs long When using web publishing wizard and running the web server i cannot see the video footage on a remote machine over the internet, other d