Source code does NOT work


My software is:
1) Tamino
2) Windows 2000 Professional with SP2
3) jdk 1.4.0
4) TaminoClient.jar, TaminoAPI4J.jar, jdom.jar

I have tried to compile source code by using command:


Unfortunately I got the following message warning:

Note: uses or overrides a deprecated API.

Note: Recompile with -deprecation for details

What does it mean?

However I got XMLGreeting.class so I have tried to execute this file by executing command:

java XMLGreeting

Unfortunately, I got the following error message exception:

Exception in thread “main” java.lang.NoClassDefFoundError: XMLGreeting (wrong name: com/softwareag/tamino/db/api/examples/greeting/XMLGreeting)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(
at Method)
at sun.misc.Laucher$AppClassLoader.loadClass(
at java.lang.ClassLoader.loadClass(
at java.lang.ClassLoader.loadClassInternal(

What should I do to execute this sample code sucessfully?

Thanks in advance!

Dariusz Baumann


Here is this sample code:

|| Example for the Tamino API for Java
|| It is assumed that a Tamino database called “myDB” has
|| been created and is running.
|| For storing data the default collection ino:etc is used
|| which should only be used for examples/test code.
|| We do not recommend this for real applications.
|| The following tasks are performed:
|| - establish a connection to the Tamino database
|| - obtain an XML accessor
|| - insert a new XML document
|| - query the inserted document
|| - close the connection
package com.softwareag.tamino.db.api.examples.greeting;

import com.softwareag.tamino.db.api.accessor.;
import com.softwareag.tamino.db.api.common.
import com.softwareag.tamino.db.api.connection.;
import com.softwareag.tamino.db.api.objectModel.
import com.softwareag.tamino.db.api.objectModel.dom.;
import com.softwareag.tamino.db.api.response.
import org.jdom.;
import org.jdom.input.

public class XMLGreeting {

public static void main(String[] args) throws Exception {
// Put the XML content into a StringReader
StringReader stringReader = new StringReader( XML );
// Instantiate an empty TXMLObject instance using the DOM object model
TXMLObject xmlObject = TXMLObject.newInstance( TDOMObjectModel.getInstance() );
// Establish the DOM representation by reading the content from the
// character input stream
xmlObject.readFrom( stringReader );
// Establish the connection to Tamino
TConnection connection = TConnectionFactory.getInstance().newConnection( DATABASE_URI );
// Obtain a TXMLObjectAccessor with a DOM object model
TXMLObjectAccessor xmlObjectAccessor = connection.newXMLObjectAccessor(
TAccessLocation.newInstance( “ino:etc” ),
TDOMObjectModel.getInstance() );
try {
// Invoke the insert operation
xmlObjectAccessor.insert( xmlObject );
// Show the ino:id of the document just inserted
System.out.println( “Insert succeeded, ino:id=” + xmlObject.getId() );
catch (TInsertException insertException) {
// Inform about the reason for the failure
System.out.println( “Insert failed!” );
if ( insertException.hasAccessFailureMessage() )
System.out.println( “Insert rejected by Tamino. Reason:” +
insertException.getAccessFailureMessage() );
System.out.println( “Insert failed due to following reason:” +
insertException.getDeepestException().getMessage() );
// Prepare to read the instance
TQuery query = TQuery.newInstance( xmlObject.getDoctype() + “[@ino:id=” +
xmlObject.getId() + “]” );
try {
// Invoke the query operation
TResponse response = xmlObjectAccessor.query( query );
if ( response.hasFirstXMLObject() ) {
StringWriter stringWriter = new StringWriter();
response.getFirstXMLObject().writeTo( stringWriter );
System.out.println( “Retrieved following instance:” + stringWriter );
System.out.println( “No instance found!” );
catch (TQueryException queryException) {
// Inform about the reason for the failure
System.out.println( “Query failed!” );
if ( queryException.hasAccessFailureMessage() )
System.out.println( “Query rejected by Tamino. Reason:” +
queryException.getAccessFailureMessage() );
System.out.println( “Insert failed due to following reason:” +
queryException.getDeepestException().getMessage() );
// OK, everything is done, close the connection.

// URI of the Tamino database, please edit accordingly
public final static String DATABASE_URI = “http://localhost/tamino/myDB”;

// XML document to be written to the connected database
public final static String XML =
“Hello World”;


Hi Dariusz,

the problem is that the Java class is actually called:

So, you have two options:
1. Call java using the full classname:
   java com.softwareag.tamino.db.api.examples.greeting.XMLGreeting

2. Remove the package line from the source (so that the class is called XMLGreeting), recompile and execute:
   java XMLGreeting

If you would like to see the full details of the “deprecated” warning, compile like this:
   javac -deprecation

Last thing: I would be careful about not having both TaminoClient.jar and TaminoAPI4J.jar in my classpath.
I don’t know of any problems with this, but I would still avoid it…

I hope that helps,