Problem using secondary database, sequence (and custom tuple binding)

I get an exception when I try to open a Sequence to a database that has a custom tuple binding and a secondary database. I have a guess what the issue is (below), but it boils down to my custom tuple-binding being invoked when opening the sequence. Here is the exception:
java.lang.IndexOutOfBoundsException
at com.sleepycat.bind.tuple.TupleInput.readUnsignedInt(TupleInput.java:4
14)
at com.sleepycat.bind.tuple.TupleInput.readInt(TupleInput.java:233)
at COM.shopsidekick.db.community.Shop_URLTupleBinding.entryToObject(Shop
_URLTupleBinding.java:72)
at com.sleepycat.bind.tuple.TupleBinding.entryToObject(TupleBinding.java
:73)
at COM.tagster.db.community.SecondaryURLKeyCreator.createSecondaryKey(Se
condaryURLKeyCreator.java:38)
at com.sleepycat.je.SecondaryDatabase.updateSecondary(SecondaryDatabase.
java:546)
at com.sleepycat.je.SecondaryTrigger.databaseUpdated(SecondaryTrigger.ja
va:42)
at com.sleepycat.je.Database.notifyTriggers(Database.java:1343)
at com.sleepycat.je.Cursor.putInternal(Cursor.java:770)
at com.sleepycat.je.Cursor.putNoOverwrite(Cursor.java:352)
at com.sleepycat.je.Sequence.<init>(Sequence.java:139)
at com.sleepycat.je.Database.openSequence(Database.java:332)
Here is my code:
// URL ID DB
DatabaseConfig urlDBConfig = new DatabaseConfig();
urlDBConfig.setAllowCreate(true);
urlDBConfig.setReadOnly(false);
urlDBConfig.setTransactional(true);
urlDBConfig.setSortedDuplicates(false); // No sorted duplicates (can't have them with a secondary DB)
mURLDatabase = mDBEnv.openDatabase(txn, "URLDatabase", urlDBConfig);
// Reverse URL lookup DB table
SecondaryConfig secondaryURLDBConfig = new SecondaryConfig();
secondaryURLDBConfig.setAllowCreate(true);
secondaryURLDBConfig.setReadOnly(false);
secondaryURLDBConfig.setTransactional(true);
TupleBinding urlTupleBinding = DataHelper.instance().createURLTupleBinding();
SecondaryURLKeyCreator secondaryURLKeyCreator = new SecondaryURLKeyCreator(urlTupleBinding);
secondaryURLDBConfig.setKeyCreator(secondaryURLKeyCreator);
mReverseLookpupURLDatabase = mDBEnv.openSecondaryDatabase(txn, "SecondaryURLDatabase", mURLDatabase, secondaryURLDBConfig);
// Open the URL ID sequence
SequenceConfig urlIDSequenceConfig = new SequenceConfig();
urlIDSequenceConfig.setAllowCreate(true);
urlIDSequenceConfig.setInitialValue(1);
mURLSequence = mURLDatabase.openSequence(txn, new DatabaseEntry(URLID_SEQUENCE_NAME.getBytes("UTF-8")), urlIDSequenceConfig);
My secondary key creator class looks like this:
public class SecondaryURLKeyCreator implements SecondaryKeyCreator {
// Member variables
private TupleBinding mTupleBinding; // The tuple binding
* Constructor.
public SecondaryURLKeyCreator(TupleBinding iTupleBinding) {
mTupleBinding = iTupleBinding;
* Create the secondary key.
public boolean createSecondaryKey(SecondaryDatabase iSecDB, DatabaseEntry iKeyEntry, DatabaseEntry iDataEntry, DatabaseEntry oResultEntry) {
try {
URLData urlData = (URLData)mTupleBinding.entryToObject(iDataEntry);
String URL = urlData.getURL();
oResultEntry.setData(URL.getBytes("UTF-8"));
catch (IOException willNeverOccur) {
// Success
return(true);
I think I understand what is going on, and I only noticed it now because I added more fields to my custom data (and tuple binding):
com.sleepycat.je.Sequence.java line 139 (version 3.2.44) does this:
status = cursor.putNoOverwrite(key, makeData());
makeData creates a byte array of size MAX_DATA_SIZE (50 bytes) -- which has nothing to do with my custom data.
The trigger causes an call to SecondaryDatable.updateSecondary(...) to the secondary DB.
updateSecondary calls createSecondaryKey in my SecondaryKeyCreator, which calls entityToObject() in my tuple-binding, which calls TupleInput.readString(), etc to match my custom data. Since what is being read goes for more than the byte array of size 50, I get the exception.
I didn't notice before because my custom tuple binding used to read fewer that 50 bytes.
I think the problem is that my tuple binding is being invoked at all at this point -- opening a sequence -- since there is no data on which it can act.

Hi,
It looks like you're making a common mistake with sequences which is to store the sequence itself in a database that is also used for application data. The sequence should normally be stored in separate database to prevent configuration conflicts and actual data conflicts between the sequence record and the application records.
I suggest that you create another database whose only purpose is to hold the sequence record. This database will contain only a single record -- the sequence. If you have more than one sequence, storing all sequences in the same database makes sense and is safe.
The database used for storing sequences should not normally have any associated secondary databases and should not be configured for duplicates.
--mark                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Similar Messages

  • Hi. I am just about to move from the UK to Kuwait. Will I have any problems using my iPhone 4 and able to join a local carrier using this device please?

    Hi. I am just about to move from the UK to Kuwait. Will I have any problems using my iPhone 4 and able to join a local carrier using this device please?

    If your phone is locked to a particular carrier, you must contact them to request they unlock it. Once they've taken care of that and you've followed the instructions to complete the unlock process, you will be able to use the phone elsewhere.
    ~Lyssa

  • Any Problems using SSL with Safari and the move with Internet explorer to require only TLS encryption.

    Any Problems using SSL with Safari and the move with Internet explorer to require only TLS encryption.

    Hi .
    Apple no longer supports Safari for Windows if that's what you are asking >  Apple apparently kills Windows PC support in Safari 6.0
    Microsoft has not written IE for Safari for many years.

  • Does anyone have problems using the  highlights, shadows and sharpness edits in iphoto? Since I uploaded Mountain Lion, those editing tabs do not work!

    Does anyone have problems using the highlights, shadows and sharpness controls in iphoto 11? Since I uploaded Mountain Lion on my
    mac mini, those editing features no longer work!!!!

    Sorry, I booted into 10.8 just to test this, but I only have iPhoto 08.

  • Problems using RMI between linux and windows.

    I have problems using RMI between linux and windows.
    This is my scenario:
    - Server running on linux pc
    - Clients running on linux and windows PCs
    When a linux client disconnect, first time that server try to call a method of this client, a rmi.ConnectException is generated so server can catch it, mark the client as disconnected and won't communicate with it anymore.
    When a windows client (tested on XP and Vista) disconnect, no exceptions are generated (I tryed to catch all the rmi exception), so server cannot know that client is disconnected and hangs trying to communicate with the windows client.
    Any ideas?
    Thanks in advance.
    cambieri

    Thanks for your reply.
    Yes, we are implementing a sort of callback using Publisher (remote Observable) and Subscribers (remote Observer). The pattern and relative code is very well described at this link: http://www2.sys-con.com/ITSG/virtualcd/java/archives/0210/schwell/index.html (look at the notifySubscribers(Object pub, Object code) function).
    Everything works great, the only problem is this: when a Publisher that reside on a Linux server try to notify something to a "dead" Subscriber that reside on a Windows PC it does't receive the usual ConnectException and so tends to hang.
    As a workaround we have solved now starting a new Thread for each update (notification), so only that Thread is blocked (until the timeout i guess) and not the entire "notifySubscribers" function (that contact all the Subscribers).
    Beside this, using the Thread seem to give us better performance.
    Is that missed ConnectException a bug? Or we are just making some mistake?
    We are using java 6 and when both client and server are Linux or Windows the ConnectException always happen and we don't have any problem.
    I hope that now this information are enough.
    Thanks again and greetings.
    O.C.

  • Database much larger than expected when using secondary databases

    Hi Guys,
    When I load data into my database it is much larger than I expect it to be when I turn on secondary indexes. I am using the Base API.
    I am persisting (using TupleBindings) the following data type:
    A Key of size ~ *80 Bytes*
    A Value consisting of 4 longs ~ 4*8= *32 Bytes*
    I am persisting ~ *280k* of such records
    I therefore expect ballpark 280k * (80+32) Bytes ~ *31M* of data to be persisted. I actually see ~ *40M* - which is fine.
    Now, when I add 4 secondary database indexes - on the 4 long values - I would expect to see approximately an additional 4 * 32 * 280k Bytes -> ~ *35M*
    This would bring the total amount of data to (40M + 35M) ~ *75M*
    (although I would expect less given that many of the secondary keys are duplicates)
    What I am seeing however is *153M*
    Given that no other data is persisted that could account for this, is this what you would expect to see?
    Is there any way to account for the extra unexpected 75M of data?
    Thanks,
    Joel
    Edited by: JoelH on 10-Feb-2010 10:59
    Edited by: JoelH on 10-Feb-2010 10:59

    Hi Joel,
    Now, when I add 4 secondary database indexes - on the 4 long values - I would expect to see approximately an additional 4 * 32 * 280k Bytes -> ~ 35MA secondary index consists of a regular JE database containing key-value pairs, where the key of the pair is the secondary key and the value of the pair is the primary key. Your primary key is 80 bytes, so this would be 4 * (4 + 80) * 280k Bytes -> ~ 91M.
    The remaining space is taken by per-record overhead for every primary and secondary record, plus the index of keys itself. There are (280k * 5) records total. Duplicates do not take less space.
    I assume this is an insert-only test, and therefore the log should contain little obsolete data. To be sure, please run the DbSpace utility.
    Does this answer your question?
    --mark                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Problem using multiple choice LOV with custom attribute in IAS 10.1.2.0.2

    Hi
    When aplying a multiple choice and selecting multiple selection and saving in the content area , everything looks fine .
    However when looking at the page the selection is only the first one selected and not the miltiple choices I made
    can someone tell me what is going on , does the miltiple selection with custom attribute
    works ??
    thanks in advance
    Igal

    Hi there,
    I don't really understand what you're doing but I used lot of LOV in custom attributes on my custom items and everything works fine.
    Can you explain more your problem ?

  • Secondary database performance and CacheMode

    This is somewhat a follow-on thread related to: Lock/isolation with secondary databases
    In the same environment, I'm noticing fairly low-performance numbers on my queries, which are essentially a series of key range-scans on my secondary index.
    Example output:
    08:07:37.803 BDB - Retrieved 177 entries out of index (177 ranges, 177 iters, 1.000 iters/range) in: 87ms
    08:07:38.835 BDB - Retrieved 855 entries out of index (885 ranges, 857 iters, 0.968 iters/range) in: 346ms
    08:07:40.838 BDB - Retrieved 281 entries out of index (283 ranges, 282 iters, 0.996 iters/range) in: 101ms
    08:07:41.944 BDB - Retrieved 418 entries out of index (439 ranges, 419 iters, 0.954 iters/range) in: 160ms
    08:07:44.285 BDB - Retrieved 2807 entries out of index (2939 ranges, 2816 iters, 0.958 iters/range) in: 1033ms
    08:07:50.422 BDB - Retrieved 253 entries out of index (266 ranges, 262 iters, 0.985 iters/range) in: 117ms
    08:07:52.095 BDB - Retrieved 2838 entries out of index (3021 ranges, 2852 iters, 0.944 iters/range) in: 835ms
    08:07:58.253 BDB - Retrieved 598 entries out of index (644 ranges, 598 iters, 0.929 iters/range) in: 193ms
    08:07:59.912 BDB - Retrieved 143 entries out of index (156 ranges, 145 iters, 0.929 iters/range) in: 32ms
    08:08:00.788 BDB - Retrieved 913 entries out of index (954 ranges, 919 iters, 0.963 iters/range) in: 326ms
    08:08:03.087 BDB - Retrieved 325 entries out of index (332 ranges, 326 iters, 0.982 iters/range) in: 103ms
    To explain those numbers, a "range" corresponds to a sortedMap.subMap() call (ie: a range scan between a start/end key) and iters is the number of iterations over the subMap results to find the entry we were after (implementation detail).
    In most cases, the iters/range is close to 1, which means that only 1 key is traversed per subMap() call - so, in essence, 500 entries means 500 ostensibly random range-scans, taking only the first item out of each rangescan.
    However, it seems kind of slow - 2816 entries is taking 1033ms, which means we're really seeing a key/query rate of ~2700 keys/sec.
    Here's performance profile output of this process happening (via jvisualvm): https://img.skitch.com/20120718-rbrbgu13b5x5atxegfdes8wwdx.jpg
    Here's stats output after it running for a few minutes:
    I/O: Log file opens, fsyncs, reads, writes, cache misses.
    bufferBytes=3,145,728
    endOfLog=0x143b/0xd5b1a4
    nBytesReadFromWriteQueue=0
    nBytesWrittenFromWriteQueue=0
    nCacheMiss=1,954,580
    nFSyncRequests=11
    nFSyncTime=12,055
    nFSyncTimeouts=0
    nFSyncs=11
    nFileOpens=602,386
    nLogBuffers=3
    nLogFSyncs=96
    nNotResident=1,954,650
    nOpenFiles=100
    nRandomReadBytes=6,946,009,825
    nRandomReads=2,577,442
    nRandomWriteBytes=1,846,577,783
    nRandomWrites=1,961
    nReadsFromWriteQueue=0
    nRepeatFaultReads=317,585
    nSequentialReadBytes=2,361,120,318
    nSequentialReads=653,138
    nSequentialWriteBytes=262,075,923
    nSequentialWrites=257
    nTempBufferWrites=0
    nWriteQueueOverflow=0
    nWriteQueueOverflowFailures=0
    nWritesFromWriteQueue=0
    Cache: Current size, allocations, and eviction activity.
    adminBytes=248,252
    avgBatchCACHEMODE=0
    avgBatchCRITICAL=0
    avgBatchDAEMON=0
    avgBatchEVICTORTHREAD=0
    avgBatchMANUAL=0
    cacheTotalBytes=2,234,217,972
    dataBytes=2,230,823,768
    lockBytes=224
    nBINsEvictedCACHEMODE=0
    nBINsEvictedCRITICAL=0
    nBINsEvictedDAEMON=0
    nBINsEvictedEVICTORTHREAD=0
    nBINsEvictedMANUAL=0
    nBINsFetch=7,104,094
    nBINsFetchMiss=575,490
    nBINsStripped=0
    nBatchesCACHEMODE=0
    nBatchesCRITICAL=0
    nBatchesDAEMON=0
    nBatchesEVICTORTHREAD=0
    nBatchesMANUAL=0
    nCachedBINs=575,857
    nCachedUpperINs=8,018
    nEvictPasses=0
    nINCompactKey=268,311
    nINNoTarget=107,602
    nINSparseTarget=468,257
    nLNsFetch=1,771,930
    nLNsFetchMiss=914,516
    nNodesEvicted=0
    nNodesScanned=0
    nNodesSelected=0
    nRootNodesEvicted=0
    nThreadUnavailable=0
    nUpperINsEvictedCACHEMODE=0
    nUpperINsEvictedCRITICAL=0
    nUpperINsEvictedDAEMON=0
    nUpperINsEvictedEVICTORTHREAD=0
    nUpperINsEvictedMANUAL=0
    nUpperINsFetch=11,797,499
    nUpperINsFetchMiss=8,280
    requiredEvictBytes=0
    sharedCacheTotalBytes=0
    Cleaning: Frequency and extent of log file cleaning activity.
    cleanerBackLog=0
    correctedAvgLNSize=87.11789
    estimatedAvgLNSize=82.74727
    fileDeletionBacklog=0
    nBINDeltasCleaned=2,393,935
    nBINDeltasDead=239,276
    nBINDeltasMigrated=2,154,659
    nBINDeltasObsolete=35,516,504
    nCleanerDeletions=96
    nCleanerEntriesRead=9,257,406
    nCleanerProbeRuns=0
    nCleanerRuns=96
    nClusterLNsProcessed=0
    nINsCleaned=299,195
    nINsDead=2,651
    nINsMigrated=296,544
    nINsObsolete=247,703
    nLNQueueHits=2,683,648
    nLNsCleaned=5,856,844
    nLNsDead=88,852
    nLNsLocked=29
    nLNsMarked=5,767,969
    nLNsMigrated=23
    nLNsObsolete=641,166
    nMarkLNsProcessed=0
    nPendingLNsLocked=1,386
    nPendingLNsProcessed=1,415
    nRepeatIteratorReads=0
    nToBeCleanedLNsProcessed=0
    totalLogSize=10,088,795,476
    Node Compression: Removal and compression of internal btree nodes.
    cursorsBins=0
    dbClosedBins=0
    inCompQueueSize=0
    nonEmptyBins=0
    processedBins=22
    splitBins=0
    Checkpoints: Frequency and extent of checkpointing activity.
    lastCheckpointEnd=0x143b/0xaf23b3
    lastCheckpointId=850
    lastCheckpointStart=0x143a/0xf604ef
    nCheckpoints=11
    nDeltaINFlush=1,718,813
    nFullBINFlush=398,326
    nFullINFlush=483,103
    Environment: General environment wide statistics.
    btreeRelatchesRequired=205,758
    Locks: Locks held by data operations, latching contention on lock table.
    nLatchAcquireNoWaitUnsuccessful=0
    nLatchAcquiresNoWaitSuccessful=0
    nLatchAcquiresNoWaiters=0
    nLatchAcquiresSelfOwned=0
    nLatchAcquiresWithContention=0
    nLatchReleases=0
    nOwners=2
    nReadLocks=2
    nRequests=10,571,692
    nTotalLocks=2
    nWaiters=0
    nWaits=0
    nWriteLocks=0
    My database(s) are sizeable, but on an SSD in a machine with more RAM than DB size (16GB vs 10GB). I have CacheMode.EVICT_LN turned on, however, am thinking this may be harmful. I have tried turning it on, but it doesn't seem to make a dramatic difference.
    Really, I only want the secondary DB cached (as this is where all the read-queries happen), however, I'm not sure if it's (meaningfully) possible to only cache a secondary DB, as presumably it needs to look up the primary DB's leaf-nodes to return data anyway.
    Additionally, the updates to the DB(s) tend to be fairly large - ie: potentially modifying ~500,000 entries at a time (which is about 2.3% of the DB), which I'm worried tends to blow the secondary DB cache (tho don't know how to prove one way or another).
    I understand different CacheModes can be set on separate databases (and even at a cursor level), however, it's somewhat opaque as to how this works in practice.
    I've tried to run DbCacheSize, but a combination of variable length keys combined with key-prefixing being enabled makes it almost impossible to get meaningful numbers out of it (or at the very least, rather confusing :)
    So, my questions are:
    - Is this actually slow in the first place (ie: 2700 random keys/sec)?
    - Can I speed this up with caching? (I've failed so far)
    - Is it possible (or useful) to cache a secondary DB in preference to the primary?
    - Would switching from using a StoredSortedMap to raw (possibly reusable) cursors give me a significant advantage?
    Thanks so much in advance,
    fb.

    nBINsFetchMiss=575,490The first step in tuning the JE cache, as related to performance, is to ensure that nBINsFetchMiss goes to zero. That tells you that you've sized your cache large enough to hold all internal nodes (I know you have lots of memory, but we need to prove that by looking at the stats).
    If all your internal nodes are in cache, that means your entire secondary DB is in cache, because you've configured duplicates (right?). A dup DB does not keep its LNs in cache, so it consists of nothing but internal nodes in cache.
    If you're using EVICT_LN (please do!), you also want to make sure that nEvictPasses=0, and I see that it is.
    Here are some random hints:
    + In general always use getStats(new StatsConfig().setClear(true)). If you don't clear the stats every time interval, then they are cumulative and it's almost impossible to correlate them to what's going on in that time interval.
    + If you're starting with a non-empty env, first load the entire data set and clear the stats, so the fetches for populating the cache don't show up in subsequent stats.
    + If you're having trouble using DbCacheSize, you may want to find out experimentally how much cache is needed to hold the internal nodes, for a given data set in your app. You can do this simply by reading your data set into cache. When nEvictPasses becomes non-zero, the cache has overflowed. This is going to be much more accurate than DbCacheSize anyway.
    + When you measure performance, you need to collect the JE stats (as you have) plus all app performance info (txn rate, etc) for the same time interval. They need to be correlated. The full set of JE environment settings, database settings, and JVM params is also needed.
    On the question of using StoredSortedMap.subMap vs a Cursor directly, there may be an optimization you can make, if your LNs are not in cache, and they're not if you're using EVICT_LN, or if you're not using EVICT_LN but not all LNs fit. However, I think you can make the same optimization using StoredSortedMap.
    Namely when using a key range (whatever API is used), it is necessary to read one key past the range you want, because that's the only way to find out whether there are more keys in the range. If you use subMap or the Cursor API in the most obvious way, this will not only have to find the next key outside the range but will also fetch its LN. I'm guessing this is part of the reason you're seeing a lower operation rate than you might expect. (However, note that you're actually getting double the rate you mention from a JE perspective, because each secondary read is actually two JE reads, counting the secondary DB and primary DB.)
    Before I write a bunch more about how to do that optimization, I think it's worth confirming that the extra LN is being fetched. If you do the measurements as I described, and you're using EVICT_LN, you should be able to get the ratio of LNs fetched (nLNsFetchMiss) to the number of range lookups. So if there is only one key in the range, and I'm right about reading one key beyond it, you'll see double LNs fetched as number of operations.
    --mark                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Problem: using the sound widget AND gallery in one page

    Hello,
    I simply tried to have a play-music player/button at a page, and a gallery to swipe through images too.
    It caused weird problems. The iPad behaves strange, the iBook (previewed at iPad) doesn't work anymore.
    Several times I had to make a total reset of iPad3.
    The same result with a combination of a keynote widget (image-sequence) and music.
    Isn't it possible to to offer a slidehow with sound?
    Thanks for any ideas!

    Hi,
    the idea is to watch the gallery fotos or the keynote slideshow and listen to music/sound same time.
    for any reason it did work in the beginning. but now, having the media widget/audio in the same page as keynote or gallery, the application does not run smoothly anymore, particularly the swiping is blocked.
    I already made 2 chapters to avoid too many widgets in one chapter.
    there are: 1 keynote slideshow (1024x768 images) , 1 gallery, and each 3 audio widgets to let the user choose different sounds. but actually the probelms start with pacing the first audio widget already...

  • Dynamic class loading problem using unknown JAR archive and directory names

    I read the following article, which enlightened me a lot:
    Ted Neward: Understanding Class.forName().
    However, it took me some while to understand that my problem is the other way around:
    I know the name of the class, I know the name of the method,
    but my program/JVM does not know where to load the classes from.
    Shortly, my problem is that the server engine that I am writing
    uses two different versions of the same library.
    So I am trying out the following solution:
    My program is named TestClassPathMain.java
    Assume the two libraries are named JAR1.jar and JAR2.jar
    and the class/instance method that should
    be exposed to TestClassPathMain.java by them is named
    TestClass1.testMethod().
    As long as I was depending on just one library,
    I put JAR1.jar in the classpath before starting java,
    and I was happy for a while.
    At the moment I got the need to use another version of
    TestClass1.testMethod() packaged in JAR2.jar,
    a call would always access JAR1.jar's
    TestClass1.testMethod().
    I then decided to remove JAR1.jar from the classpath,
    and programmatically define two separate ClassLoaders, one for use
    with JAR1.jar and the other for use with JAR2.jar.
    However, the problem is only partly solved.
    Please refer to the enclosed code for details.
    (The code in the JAR1.jar/JAR2.jar is extremely simple,
    it just tells (by hardcoding) the name of the jar it is packaged in
    and instantiates another class packaged in the same jar using
    the "new" operator and calls a method on it. I don't enclose it.)
    The TestClassPathMain.java/UC1.java/UC2.java code suite was
    successfully compiled with an arbitrary of JAR1 or JAR2 in the classpath,
    however removed from the classpath at runtime.
    (I know that this could have been done (more elegantly...?) by producing an Interface,
    but I think the main problem principle is still untouched by this potential lack of elegancy(?))
    1) This problem should not be unknown to you experts out there,
    how is it generally and/or most elegantly solved?
    The "*** UC2: Variant 2" is the solution I would like best, had it only worked.
    2) And why arent "*** UC2: Variant 2" and
    "*** static UC2: Variant 2" working,
    while "*** Main: Variant 2" is?
    3) And a mal-apropos:
    Why can't I catch the NoClassDefFoundError?
    The output:
    *** Main: Variant 1 JAR 1 ***:
    Entering TestClass1.testMethod() packaged in JAR1.jar
    About to instantiate TestClass2 with the new operator
    About to call TestClass2.testMethod()
    Entering TestClass2.testMethod() packaged in JAR1.jar
    *** Main: Variant 1 JAR 2 ***:
    Entering TestClass1.testMethod() packaged in JAR2.jar
    About to instantiate TestClass2 with the new operator
    About to call TestClass2.testMethod()
    Entering TestClass2.testMethod() packaged in JAR2.jar
    *** Main: Variant 2 JAR 1 ***:
    Entering TestClass1.testMethod() packaged in JAR1.jar
    About to instantiate TestClass2 with the new operator
    About to call TestClass2.testMethod()
    Entering TestClass2.testMethod() packaged in JAR1.jar
    *** Main: Variant 2 JAR 2 ***:
    Entering TestClass1.testMethod() packaged in JAR2.jar
    About to instantiate TestClass2 with the new operator
    About to call TestClass2.testMethod()
    Entering TestClass2.testMethod() packaged in JAR2.jar
    *** UC1: Variant 1 JAR 1 ***:
    Entering TestClass1.testMethod() packaged in JAR1.jar
    About to instantiate TestClass2 with the new operator
    About to call TestClass2.testMethod()
    Entering TestClass2.testMethod() packaged in JAR1.jar
    *** UC1: Variant 1 JAR 2 ***:
    Entering TestClass1.testMethod() packaged in JAR2.jar
    About to instantiate TestClass2 with the new operator
    About to call TestClass2.testMethod()
    Entering TestClass2.testMethod() packaged in JAR2.jar
    *** static UC2: Variant 2 JAR 1 ***:
    Exception in thread "main" java.lang.NoClassDefFoundError: TestClass1
            at UC2.runFromJarVariant2_static(UC2.java:56)
            at TestClassPathMain.main(TestClassPathMain.java:52)
    TestClassPathMain.java
    import java.lang.reflect.InvocationTargetException;
    import java.lang.reflect.Method;
    import java.net.MalformedURLException;
    import java.net.URL;
    import java.net.URLClassLoader;
    public class TestClassPathMain {
        public static void main(final String args[]) throws MalformedURLException, ClassNotFoundException, InstantiationException, SecurityException, NoSuchMethodException, IllegalArgumentException, IllegalAccessException, InvocationTargetException {
                // Commented out because I cannot catch the NoClassDefFoundError.
                // Why?
                try {
                    final TestClass1 testClass1 = new TestClass1();
                    System.out.println(
                        "\nThe class TestClass1 is of some unexplicable reason available." +
                        "\nFor the purpose of the test, it shouldn't have been!" +
                        "\nExiting");
                    System.exit(1);
                } catch (NoClassDefFoundError e) {
                    System.out.println("\nPositively confirmed that the class TestClass1 is not available:\n" + e);
                    System.out.println("\n\nREADY FOR THE TEST: ...");
                // Works fine
                System.out.println("\n*** Main: Variant 1 JAR 1 ***:");
                runFromJarVariant1("file:/W:/java/eclipse/workspaces/simped_test/CP1/JAR1.jar");
                System.out.println("\n*** Main: Variant 1 JAR 2 ***:");
                runFromJarVariant1("file:/W:/java/eclipse/workspaces/simped_test/CP2/JAR2.jar");
                // Works fine
                System.out.println("\n*** Main: Variant 2 JAR 1 ***:");
                runFromJarVariant1("file:/W:/java/eclipse/workspaces/simped_test/CP1/JAR1.jar");
                System.out.println("\n*** Main: Variant 2 JAR 2 ***:");
                runFromJarVariant1("file:/W:/java/eclipse/workspaces/simped_test/CP2/JAR2.jar");
                // Works fine
                final UC1 uc1 = new UC1();
                System.out.println("\n*** UC1: Variant 1 JAR 1 ***:");
                uc1.runFromJarVariant1("file:/W:/java/eclipse/workspaces/simped_test/CP1/JAR1.jar");
                System.out.println("\n*** UC1: Variant 1 JAR 2 ***:");
                uc1.runFromJarVariant1("file:/W:/java/eclipse/workspaces/simped_test/CP2/JAR2.jar");
                // Crashes
                System.out.println("\n*** static UC2: Variant 2 JAR 1 ***:");
                UC2.runFromJarVariant2_static("file:/W:/java/eclipse/workspaces/simped_test/CP1/JAR1.jar");
                System.out.println("\n*** static UC2: Variant 2 JAR 2 ***:");
                UC2.runFromJarVariant2_static("file:/W:/java/eclipse/workspaces/simped_test/CP2/JAR2.jar");
                // Crashes
                final UC2 uc2 = new UC2();
                System.out.println("\n*** UC2: Variant 2 JAR 1 ***:");
                uc2.runFromJarVariant2("file:/W:/java/eclipse/workspaces/simped_test/CP1/JAR1.jar");
                System.out.println("\n*** UC2: Variant 2 JAR 2 ***:");
                uc2.runFromJarVariant2("file:/W:/java/eclipse/workspaces/simped_test/CP2/JAR2.jar");
        private static void runFromJarVariant1(final String jarFileURL)
            throws MalformedURLException,
                   ClassNotFoundException,
                   InstantiationException,
                   IllegalArgumentException,
                   IllegalAccessException,
                   InvocationTargetException,
                   SecurityException,
                   NoSuchMethodException {
            final URL url = new URL(jarFileURL);
            final URLClassLoader cl =
                new URLClassLoader(new URL[]{url},
                                   Thread.currentThread().getContextClassLoader());
            final Class clazz = cl.loadClass("TestClass1");
            final Object testClass1 = clazz.newInstance();
            final Method testMethod1 = clazz.getMethod("testMethod", null);
            testMethod1.invoke(testClass1, null);
        private static void runFromJarVariant2(final String jarFileURL)
            throws MalformedURLException,
                   ClassNotFoundException,
                   InstantiationException,
                   IllegalArgumentException,
                   IllegalAccessException,
                   InvocationTargetException,
                   SecurityException,
                   NoSuchMethodException {
            final URL url = new URL(jarFileURL);
            final URLClassLoader cl =
                new URLClassLoader(new URL[]{url},
                                   Thread.currentThread().getContextClassLoader());
            final Class clazz = cl.loadClass("TestClass1");
            final TestClass1 testClass1 = new TestClass1();
            testClass1.testMethod();
    UC1.java
    import java.lang.reflect.InvocationTargetException;
    import java.lang.reflect.Method;
    import java.net.MalformedURLException;
    import java.net.URL;
    import java.net.URLClassLoader;
    public class UC1 {
        public void runFromJarVariant1(final String jarFileURL)
            throws MalformedURLException,
                   ClassNotFoundException,
                   InstantiationException,
                   IllegalArgumentException,
                   IllegalAccessException,
                   InvocationTargetException,
                   SecurityException,
                   NoSuchMethodException {
            final URL url = new URL(jarFileURL);
            final URLClassLoader cl =
                new URLClassLoader(new URL[]{url},
                                   Thread.currentThread().getContextClassLoader());
            final Class clazz = cl.loadClass("TestClass1");
            final Object testClass1 = clazz.newInstance();
            final Method testMethod1 = clazz.getMethod("testMethod", null);
            testMethod1.invoke(testClass1, null);
    UC2.java
    import java.lang.reflect.InvocationTargetException;
    import java.net.MalformedURLException;
    import java.net.URL;
    import java.net.URLClassLoader;
    public class UC2 {
        public void runFromJarVariant2(final String jarFileURL)
        throws MalformedURLException,
               ClassNotFoundException,
               InstantiationException,
               IllegalArgumentException,
               IllegalAccessException,
               InvocationTargetException,
               SecurityException,
               NoSuchMethodException {
            final URL url = new URL(jarFileURL);
            final URLClassLoader cl =
                new URLClassLoader(new URL[]{url},
                                   Thread.currentThread().getContextClassLoader());
            final Class clazz = cl.loadClass("TestClass1");
            final TestClass1 testClass1 = new TestClass1();
            testClass1.testMethod();
         * Identic to the "runFromJarVariant2" method,
         * except that it is static
        public static void runFromJarVariant2_static(final String jarFileURL)
        throws MalformedURLException,
               ClassNotFoundException,
               InstantiationException,
               IllegalArgumentException,
               IllegalAccessException,
               InvocationTargetException,
               SecurityException,
               NoSuchMethodException {
            final URL url = new URL(jarFileURL);
            final URLClassLoader cl =
                new URLClassLoader(new URL[]{url},
                                   Thread.currentThread().getContextClassLoader());
            final Class clazz = cl.loadClass("TestClass1");
            final TestClass1 testClass1 = new TestClass1();
            testClass1.testMethod();
    }

    2. i need to load the class to the same JVM (i.e. to
    the same environment) of the current running
    aplication, so that when the loaded class is run, it
    would be able to invoke methods on it!!!
    ClassLoader(s) do this. Try the URLClassLoader.
    (I was talking about relatively esoteric "security"
    issues when I mentioned the stuff about Class objects
    "scope".) You might use the URLClassLoader kind of
    like this.
    Pseudo-code follows:
    // setup the class loader
    URL[] urls = new URL[1];
    urls[0] = new URL("/path/to/dynamic/classes");
    URLClassLoader ucl = new URLClassLoader(urls);
    // load a class & use make an object with the default constructor
    Object tmp = ucl.loadClass("dynamic.class.name").newInstance();
    // Cast the object to a know interface so that you can use it.
    // This may be used to further determine which interface to cast
    // the class to. Or it may simply be the interface to which all
    // dynamic classes have to conform in your program.
    InterfaceImplementedByDynamicClass loadedObj =
        (InterfaceImplementedByDynamicClass)tmp;It's really not as hard as it sounds, just write a little test of
    this and you will see how it works.

  • Using a Database View and Untyped Dataset

    Post Author: kramer9802
    CA Forum: .NET
    Product:Crystal Reports XI Release 2
    Version:
    Patches Applied:
    Operating System(s):XP
    Database(s):Oracle
    Error Messages: Steps to Reproduce: Normally, the reports we create are designed based on Oracle tables. Then the data source is set to a dataset I populate in code from a SQL statement. I know this isn't necessarily how it is done in the documentation, but it has been working. What I am trying to do now is use a database view to design the report and then populate the my dataset based on a query on the view for VB code. When I do that my dataset only has one row, but my report is building based on all the rows returned by the view (Thousands). The sql  is something like this  Select * From xyz_view where record_id= ('The record the user wants to see')   The view basically pulls back the data from several tables and also pulls back a few lookup tables that have description of value fields. I would use formula fields for the description but there is a lot records. I know that you can't pass a parameter into a view, so that is why I use select statement against the view to filter it down to the specific record I want. So I guess my question is why does build the report based on all the records from the view rather than all the one record in the Dataset? If I do the same thing but design the report based on a table or serveral tables, then the report only contains records from the dataset. I think I kind of know that the report is ignoring the dataset, but I guess I just need to know if there is an easy way to make this work or do I need to reconsider how I design and populate the reports. The reports are non-embedded based on a business requirement. let me know if this doesn't make sense or you need more details. Thanks Kramer

    Post Author: Argan
    CA Forum: .NET
    Honestly I do not know.
    This question is more of a design issue and would be better suited to Crystal Reports forum
    http://technicalsupport.businessobjects.com/cs/forums/13/ShowForum.aspx
    As an aside, technically speaking if you are using datasets then you should be designing the report against the schema of the dataset you are going to be passing, not the tables or storeprocs or views themselves.

  • Problem using in Stacked sequence.

    I am using sstacked sequence structure, Where in each sequence I am having a sub VI which will pop up the Front Panel during the sequence, but the sub VI present in the next sequence is also poping the Front Panel. How to avoid this . I want the sub VI present in the next sequence to pop up only after I close the Fornt panel of VI present in the First sequence. Iam using this stacked sequence inside a event structure.

    Hi Rajashekar,
    Does the first subvi complete all its execution before the second vi front panel appears. If so then it may be that you just need to tell the first vi to close its front panel after it has finished executing. To do this right click on the sub vi and choose 'Subvi Node setup...' then tick the close afterwards if originally closed option
    Dave
    Message Edited by DavidU on 10-14-2008 09:21 AM
    Message Edited by DavidU on 10-14-2008 09:21 AM
    Attachments:
    SubVI setup.PNG ‏11 KB

  • Problems using Photostream on iPad and iPhone.

    I'm hoping someone can advise me and solve this problem easily.  Not a massive techie so please use layman's terms!
    I've had a similar problem to others in that photos on my iPhone were appearing as blank white... Both in the Thumbnail and full screen.  I corrected this by using the rotate function and re-saving each photo.  The photos now appear correctly in the camera roll but not in photo stream which syncs to my iPad.  For obvious reasons I'd really love all the photos to appear correctly on both devices...
    Can anyone help?!

    Anything at all people?!?!

  • Problem using trinidad 2.0 and facelets

    Hi everyone!!!
    I am facing problem using Trinidad 2.0 components with facelets. I am using Tomcat 6.0 server , 1.6_20 jdk with jre6. I am using springsource tool suite as an IDE.
    My problem is regarding usage of facelets with trinidad component library. I am trying to run *<tr:panelTabbed>* component of TRINIDAD 2.0 on *.jsp* as well as *.xhtml*. If I run my jsp , I am able to used panel tab fully like switching between two tabs. Same code I have added in my .xhtml page in the same project under *<ui:composition>* tags. I am successfully able show the component on the screen , but I am not able to switch between the two tabs. Here are the list of libs that have added to the project.
    commons-beanutils-1.7.0.jar,commons-codec-1.3.jar,commons-collections-3.2.jar,commons-digester-1.8.jar,commons-discovery-0.4.jar,
    commons-el.jar,commons-fileupload.jar,commons-logging-1.1.1.jar,jsf-facelets.jar,jstl.jar,myfaces-api-2.0.1.jar,myfaces-impl-2.0.1.jar,
    trinidad-api-2.0.0-alpha-2.jar,trinidad-impl-2.0.0-alpha-2.jar
    index.jsp
    <%@taglib uri="http://myfaces.apache.org/trinidad" prefix="tr"%><html>
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
    <head>
    <title>Your first JSF Application</title>
    </head>
    <body bgcolor="white">
    <f:view>
         <tr:document>
              <h:form>
                   <tr:panelTabbed position="above">
                        <tr:showDetailItem text="Account">
                             <tr:panelBox text="Account Information Details"
                                  inlineStyle="width: 100%;">
                                  <tr:panelList inlineStyle="width: 100px;">
                                       <tr:panelHorizontalLayout inlineStyle="height:100px;">
                                            <f:facet name="separator">
                                                 <tr:spacer width="100" height="100" />
                                            </f:facet>
                                            <tr:outputText value="Account Number" styleClass="AFFieldText" />
                                            <tr:outputText value="Effective Date" styleClass="AFFieldText" />
                                            <tr:outputText value="Expiration Date" styleClass="AFFieldText" />
                                       </tr:panelHorizontalLayout>
                                       <tr:panelHorizontalLayout inlineStyle="height:100px;">
                                            <f:facet name="separator">
                                                 <tr:spacer width="100" height="100" />
                                            </f:facet>
                                            <tr:outputText value="#{accDet.accountNumber}"
                                                 styleClass="AFFieldText" />
                                            <tr:outputText value="#{accDet.effectiveDate}"
                                                 styleClass="AFFieldText" />
                                            <tr:outputText value="#{accDet.expirationDate}"
                                                 styleClass="AFFieldText" />
                                       </tr:panelHorizontalLayout>
                                       <tr:separator />
                                       <tr:panelHorizontalLayout inlineStyle="height:100px;">
                                            <f:facet name="separator">
                                                 <tr:spacer width="100" height="1" />
                                            </f:facet>
                                            <tr:outputText value="Address" styleClass="AFFieldText" />
                                            <tr:outputText value="Fax" styleClass="AFFieldText" />
                                       </tr:panelHorizontalLayout>
                                       <tr:panelHorizontalLayout inlineStyle="height:100px;">
                                            <f:facet name="separator">
                                                 <tr:spacer width="100" height="1" />
                                            </f:facet>
                                            <tr:outputText value="#{accDet.address}"
                                                 styleClass="AFFieldText" />
                                            <tr:outputText value="#{accDet.fax}" styleClass="AFFieldText" />
                                       </tr:panelHorizontalLayout>
                                  </tr:panelList>
                             </tr:panelBox>
                        </tr:showDetailItem>
                        <tr:showDetailItem text="Insured">
                             <tr:panelHeader text="Header 2">
                                  <tr:panelFormLayout>
                                       <tr:inputText label="Text1" />
                                       <tr:inputText label="Text2" />
                                       <tr:inputText label="Text3" />
                                  </tr:panelFormLayout>
                             </tr:panelHeader>
                        </tr:showDetailItem>
                   </tr:panelTabbed>
              </h:form>
         </tr:document>
    </f:view>
    </body>
    </html>
    guess.xhtml
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml"
         xmlns:ui="http://java.sun.com/jsf/facelets"
         xmlns:h="http://java.sun.com/jsf/html"
         xmlns:tr="http://myfaces.apache.org/trinidad"
         xmlns:f="http://java.sun.com/jsf/core">
    <body bgcolor="white">
    <f:view>
         <tr:document>
    <h:form>
         <tr:panelTabbed>
              <tr:showDetailItem text="Tab 1"></tr:showDetailItem>
              <tr:showDetailItem text="Tab 2"></tr:showDetailItem>
         </tr:panelTabbed>
    </h:form>
    </tr:document>
    </f:view>
    </body>
    </html>
    web.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
         id="WebApp_ID" version="2.5">
         <display-name>Demo_ProtoType</display-name>
         <filter>
              <filter-name>trinidad</filter-name>
              <filter-class>org.apache.myfaces.trinidad.webapp.TrinidadFilter</filter-class>
         </filter>
         <filter-mapping>
              <filter-name>trinidad</filter-name>
              <servlet-name>faces</servlet-name>
         </filter-mapping>
         <context-param>
              <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
              <param-value>client</param-value>
         </context-param>
         <listener>
              <listener-class>
                   org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
         </listener>
         <servlet>
              <servlet-name>Faces Servlet</servlet-name>
              <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
              <load-on-startup>1</load-on-startup>
         </servlet>
         <servlet-mapping>
              <servlet-name>Faces Servlet</servlet-name>
              <url-pattern>*.xhtml</url-pattern>
         </servlet-mapping>
         <servlet>
              <servlet-name>resources</servlet-name>
              <servlet-class>org.apache.myfaces.trinidad.webapp.ResourceServlet</servlet-class>
         </servlet>
         <servlet-mapping>
              <servlet-name>resources</servlet-name>
              <url-pattern>/adf/*</url-pattern>
         </servlet-mapping>
         <context-param>
              <param-name>org.apache.myfaces.trinidad.ALTERNATE_VIEW_HANDLER</param-name>
              <param-value>org.apache.myfaces.trinidadinternal.facelets.TrinidadFaceletViewHandler</param-value>
         </context-param>
         <context-param>
              <param-name>org.apache.myfaces.trinidad.FACELETS_VIEW_MAPPINGS</param-name>
              <param-value>*.xhtml</param-value>
         </context-param>
    </web-app>
    faces-config.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <faces-config 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-facesconfig_1_2.xsd"
         version="1.2">
         <application>
              <default-render-kit-id>org.apache.myfaces.trinidad.core</default-render-kit-id>
         </application>
         <managed-bean>
              <managed-bean-name>accDet</managed-bean-name>
              <managed-bean-class>com.csc.Account.AccountDetail</managed-bean-class>
              <managed-bean-scope>session</managed-bean-scope>
         </managed-bean>
    </faces-config>Following warning is coming on server start up
    java.lang.ClassNotFoundException: org.apache.myfaces.trinidadinternal.facelets.TrinidadFaceletViewHandler
         at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1484)
    PLEASE LET ME KNOW IF ANYONE NEED THE .WAR file .I can send it over mail. Please hrlp me out !!! I have literally tried everything.This is the only HOPE

    Hi gimbal2 ,
    thanks for your prompt response.
    I deleted jsf-facelets.jar from the lib.
    Also I removed      <context-param>
              <param-name>org.apache.myfaces.trinidad.ALTERNATE_VIEW_HANDLER</param-name>
              <param-value>org.apache.myfaces.trinidadinternal.facelets.TrinidadFaceletViewHandler</param-value>
         </context-param>
         <context-param>
              <param-name>org.apache.myfaces.trinidad.FACELETS_VIEW_MAPPINGS</param-name>
              <param-value>*.xhtml</param-value>
         </context-param>Now that error has gone .But I am still not able to switch between the tabs for .xhtml page but it is working fine for .jsp page.
    For .xhtml page , on clicking on the tab, console is showing something like below
    Aug 17, 2010 9:20:49 PM org.apache.myfaces.trinidad.component.UIXShowDetail broadcast
    WARNING: Event org.apache.myfaces.trinidad.event.DisclosureEvent[phaseId=INVOKE_APPLICATION(5),component=CoreShowDetailItem[UINodeFacesBean, id=j_id957384125_39108532],expanded=true] was delivered to a showDetail already in that disclosure state.

  • Testcase problem using two file adapter and a transformation

    We've got an input which looks like this :
    <?xml version="1.0" encoding="UTF-8"?>
    <rows>
    <row>
    <id>10</id>
    <naam>A</naam>
    </row>
    <row>
    <id>20</id>
    <naam>B</naam>
    </row>
    </rows>
    I've created an XSD for this message which looks like this ( straightforward ) :
    <?xml version="1.0" encoding="UTF-8"?>
    <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.test.nl/testschema" xmlns:test="http://www.test.nl/testschema" elementFormDefault="unqualified">
         <element name="row">
              <complexType>
                   <sequence>
                        <element ref="test:id"/>
                        <element ref="test:naam"/>
                   </sequence>
              </complexType>
         </element>
         <element name="rows">
              <complexType>
                   <sequence>
                        <element ref="test:row" maxOccurs="unbounded"/>
                   </sequence>
              </complexType>
         </element>
         <element name="naam">
              <simpleType>
                   <restriction base="string">
                   </restriction>
              </simpleType>
         </element>
         <element name="id">
              <simpleType>
                   <restriction base="byte">
                   </restriction>
              </simpleType>
         </element>
    </schema>
    I've imported this XSD in my ESB project and created a file adapter which reads this type op files.
    I've created another file adapter to write the files 1:1 to an output dir.
    In the routingservice I've created a very straightforward XSL mapping which maps everything 1:1.
    Now the problem
    When I use this input :
    <?xml version="1.0" encoding="UTF-8"?>
    <rows>
    <row>
    <id>10</id>
    <naam>Martin</naam>
    </row>
    <row>
    <id>20</id>
    <naam>Edward</naam>
    </row>
    </rows>
    my output result is:
    <?xml version="1.0" ?><imp1:rows xmlns:imp1="http://www.test.nl/testschema"/>
    I know this is a namespace issue. When I add the namespace
    <?xml version="1.0" encoding="UTF-8"?>
    <rows xmlns="http://www.test.nl/testschema">
    <row>
    <id>10</id>
    <naam>Martin</naam>
    </row>
    <row>
    <id>20</id>
    <naam>Edward</naam>
    </row>
    </rows>
    I get the correct ( and 1:1 output ).
    The problem is. In the scenario I'm about to build the input xml messages do not have an namespace. How can I alter my xsd file or anything within my ESB project that all files will be picked up correctly and processed without having an default namespace?
    Any help is appreciated!

    True,
    But its the other way around what is causing my problem.
    Because the input xml files contain no namespace at all the xml messages are transformed but result in an almost empty xml message. ( e.g. the root element is there and thats it ).
    This is because the XML transformation mapper in ESB ( as well as BPEL ) excplicitly needs a namespace.
    I solved it by editing the XSL by hand, removing the :imp1 namespace prefixes in the select="" tags. e.g.
    <xsl:for-each select="/imp1:rows/imp1:row"> is updated in
    <xsl:for-each select="/rows/row">
    As far as I know this is the only workaround at the moment that I could find.

Maybe you are looking for

  • Error message when importing motion files into FCP

    In FCP. I choose a clip/clips in my sequence. Then choose send to motion project and follow the directions from the training dvd. By unchecking (embed "motion" content) then save the file with a different name. Then continue with making my graphics o

  • A chart in Numbers causing crashes

    A chart in Numbers is causing Numbers to slow down & stutter when it is seleced or edited.  The memory is eventually depleted and Numbers crashes.  I'm using Numbers 2008 1.0.3.  This chart is pulling info from formulas in a large table.  That table

  • On Commit data is written to incorrect row

    Running JDev 11.1.2.4 Our ADF application is setup so there is a Tree control in the first facet of a panel splitter and panelStretchLayout in the second.  In the center facet of the psl we have a switcher component to show different regions (forms)

  • Credit card Reauthorization for expired order

    hi, why Oracle did not call re-authorization process for expired order in 11i. Thanks, Bala

  • [XFCE] Anybody want to help me make a user switching patch?

    I love my XFCE desktop, but I hate not being able to switch users or lock the screen (I use LightDM). I Googled for a while now, and there doesn't seem to be any solution to this problem except for using a GDM-only applet that looks quite out of plac