NoClassDefFoundError using DMI DataSource

Hi,

I am using a DMI data source and getting No ClassDefFoundError. Please tell me the source of error and the solution to it. This is the code for jsp:

<%@ taglib uri=“/WEB-INF/iscTaglib.xml” prefix=“isomorphic” %>
<HTML><HEAD>
<isomorphic:loadISC skin=“SmartClient”/>
</HEAD><BODY>
<SCRIPT>
<isomorphic:loadDS ID=“sampleDMI”/>
isc.ListGrid.create({
ID: “mylist”,
left: 50,
top: 50,
width: “60%”,
height: 450,
alternateRecordStyles: true,
dataSource: sampleDMI,
dataPageSize: 50,
autoFetchData: true
});
</SCRIPT>
</BODY></HTML>

and this is the code for datasource file “sampleDMI.ds.xml”:
<DataSource
ID=“sampleDMI”
serverType=“generic”
>
<fields>
<field name=“id” type=“sequence” primaryKey=“true” title=“#”/>
<field name=“name” type=“text” title=“Name”/>
<field name=“population” type=“integer” title=“Population”/>
<field name=“area” type=“float” title=“Total Area”/>
<field name=“government” type=“text” title=“Government” length=“500”/>
</fields>

&lt;serverObject lookupStyle="new" className="dmi.SampleDMI"/&gt;

&lt;operationBindings&gt;
    &lt;binding operationType="fetch" serverMethod="fetch"&gt;
    &lt;serverObject  lookupStyle="new" className="dmi.SampleDMI"/&gt;
    &lt;/binding&gt;
&lt;/operationBindings&gt;

</DataSource>

and I have placed the “sampleDMI.ds.xml” file in C:\SmartClient_70beta\smartclientSDK\shared\ds directory.

Here are the Server logs:

=== 2009-01-21 17:06:01,696 [sor4] INFO RequestContext - URL: ‘/SmartClient/web/sampleDMI.jsp’, User-Agent: ‘Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; SV1; Embedded Web Browser from: http://bsalsa.com/; .NET CLR 1.1.4322; InfoPath.1; .NET CLR 2.0.50727)’: MSIE with Accept-Encoding header, ready for compressed JS
=== 2009-01-21 17:06:01,774 [sor4] DEBUG LoadISCTag - isomorphicURI not specified in tag, defaulting to: ../../isomorphic/
=== 2009-01-21 17:06:01,789 [sor4] DEBUG XML - Parsed XML from C:\SmartClient_70beta\smartclientSDK\shared\ds\sampleDMI.ds.xml: 0ms
=== 2009-01-21 17:06:01,789 [sor4] DEBUG XML - Parsed XML from C:\SmartClient_70beta\smartclientSDK\isomorphic\system\schema\ServerObject.ds.xml: 0ms
=== 2009-01-21 17:06:01,805 [sor4] DEBUG XML - Parsed XML from C:\SmartClient_70beta\smartclientSDK\isomorphic\system\schema\OperationBinding.ds.xml: 0ms
=== 2009-01-21 17:06:01,821 [sor4] INFO JSSyntaxScannerFilter - /SmartClient/web/sampleDMI.jsp: scanning <script> tags in html output
=== 2009-01-21 17:06:01,821 [sor4] INFO Compression - /SmartClient/web/sampleDMI.jsp: 1810 -> 618 bytes
=== 2009-01-21 17:06:01,821 [sor4] DEBUG ServletTools - setting cookie ‘isc_cState’ to: ‘ready’
=== 2009-01-21 17:06:03,180 [sor4] INFO RequestContext - URL: ‘/isomorphic/IDACall’, User-Agent: ‘Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; SV1; Embedded Web Browser from: http://bsalsa.com/; .NET CLR 1.1.4322; InfoPath.1; .NET CLR 2.0.50727)’: MSIE with Accept-Encoding header, ready for compressed JS
=== 2009-01-21 17:06:03,195 [sor4] DEBUG XML - Parsed XML from (in memory stream): 0ms
=== 2009-01-21 17:06:03,195 [sor4] DEBUG XML - Parsed XML from C:\SmartClient_70beta\smartclientSDK\isomorphic\system\schema\List.ds.xml: 0ms
=== 2009-01-21 17:06:03,211 [sor4] DEBUG RPCManager - Processing 1 requests.
=== 2009-01-21 17:06:03,211 [sor4] DEBUG RPCManager - Request #1 (DSRequest) payload: {
criteria:{},
operationConfig:{dataSource:“sampleDMI”, operationType:“fetch”},
startRow:0,
endRow:50,
appID:“builtinApplication”,
operation:“sampleDMI_fetch”,
oldValues:{}
}

=== 2009-01-21 17:06:03,211 [sor4] INFO IDACall - Performing 1 operation(s)
=== 2009-01-21 17:06:03,227 [sor4] ERROR IDACall - Top-level servlet error:
java.lang.NoClassDefFoundError: com/isomorphic/datasource/DSRequest
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2427)
at java.lang.Class.privateGetPublicMethods(Class.java:2547)
at java.lang.Class.getMethods(Class.java:1410)
at com.isomorphic.rpc.ServerObject.findMethod(ServerObject.java:226)
at com.isomorphic.rpc.ServerObject.getMethod(ServerObject.java:218)
at com.isomorphic.datasource.DataSourceDMI.execute(DataSourceDMI.java:20
9)
at com.isomorphic.datasource.DataSourceDMI.execute(DataSourceDMI.java:60
)
at com.isomorphic.datasource.DSRequest.execute(DSRequest.java:1111)
at com.isomorphic.servlet.IDACall.handleDSRequest(IDACall.java:155)
at com.isomorphic.servlet.IDACall.processRequest(IDACall.java:106)
at com.isomorphic.servlet.IDACall.doPost(IDACall.java:54)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
at com.isomorphic.servlet.BaseServlet.service(BaseServlet.java:152)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:269)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:188)
at com.isomorphic.js.JSSyntaxScannerFilter.doFilter(JSSyntaxScannerFilte
r.java:241)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:215)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:188)
at com.isomorphic.servlet.CompressionFilter.doFilter(CompressionFilter.j
ava:248)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:215)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:188)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
alve.java:210)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
alve.java:174)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
ava:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
ava:117)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
ve.java:108)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
a:151)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
:870)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.p
rocessConnection(Http11BaseProtocol.java:665)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpo
int.java:528)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFol
lowerWorkerThread.java:81)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadP
ool.java:685)

It looks like you are either missing some SmartClient .jars (install ALL of them to test this) or your DMI target (dmi.SampleDMI) is either mistyped, missing from the deployment or has no zero argument public constructor.

I could not figure out the issue, so i tried with example source code given in section Custom DataSource Integration using DMI , copied all the files of the example and it worked fine. Now I changed the package of java source files to “dmi” from “com.isomorphic.examples”, recompiled them and placed them under the classes directory and correspondingly changed the className attribute in serverObject to “dmi.SupplyItemDMI” from “com.isomorphic.examples.SupplyItemDMI” in supplyItemDMI.ds.xml and restarted the server. I am getting the same error now. Here are the logs:

=== 2009-01-22 11:27:37,589 [sor4] DEBUG LoadISCTag - isomorphicURI not specified in tag, defaulting to: ../../isomorphic/
=== 2009-01-22 11:27:37,605 [sor4] DEBUG XML - Parsed XML from C:\SmartClient_70beta\smartclientSDK\examples\shared\ds\supplyItemDMI.ds.xml: 16ms
=== 2009-01-22 11:27:37,605 [sor4] INFO JSSyntaxScannerFilter - /SmartClient/web/supplyItemDMI.jsp: scanning <script> tags in html output
=== 2009-01-22 11:27:37,605 [sor4] INFO Compression - /SmartClient/web/supplyItemDMI.jsp: 5808 -> 1739 bytes
=== 2009-01-22 11:27:40,324 [sor4] INFO RequestContext - URL: ‘/isomorphic/IDACall’, User-Agent: ‘Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; SV1; Embedded Web Browser from: http://bsalsa.com/; .NET CLR 1.1.4322; InfoPath.1; .NET CLR 2.0.50727)’: MSIE with Accept-Encoding header, ready for compressed JS
=== 2009-01-22 11:27:40,339 [sor4] DEBUG XML - Parsed XML from (in memory stream): 0ms
=== 2009-01-22 11:27:40,339 [sor4] DEBUG RPCManager - Processing 1 requests.
=== 2009-01-22 11:27:40,355 [sor4] DEBUG RPCManager - Request #1 (DSRequest) payload: {
criteria:{},
operationConfig:{dataSource:“supplyItemDMI”, operationType:“fetch”, textMatchStyle:“substring”},
startRow:0,
endRow:75,
appID:“builtinApplication”,
operation:“supplyItemDMI_fetch”,
oldValues:{}
}
=== 2009-01-22 11:27:40,417 [sor4] INFO IDACall - Performing 1 operation(s)
=== 2009-01-22 11:27:40,417 [sor4] ERROR IDACall - Top-level servlet error:

=== 2009-01-22 11:27:40,339 [sor4] DEBUG RPCManager - Processing 1 requests.
=== 2009-01-22 11:27:40,355 [sor4] DEBUG RPCManager - Request #1 (DSRequest) pay
load: {
criteria:{},
operationConfig:{dataSource:“supplyItemDMI”, operationType:“fetch”, textMatc
hStyle:“substring”},
startRow:0,
endRow:75,
appID:“builtinApplication”,
operation:“supplyItemDMI_fetch”,
oldValues:{}
}
=== 2009-01-22 11:27:40,417 [sor4] INFO IDACall - Performing 1 operation(s)
=== 2009-01-22 11:27:40,417 [sor4] ERROR IDACall - Top-level servlet error:
java.lang.NoClassDefFoundError: com/isomorphic/datasource/DSRequest
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2427)
at java.lang.Class.privateGetPublicMethods(Class.java:2547)
at java.lang.Class.getMethods(Class.java:1410)
at com.isomorphic.rpc.ServerObject.findMethod(ServerObject.java:226)
at com.isomorphic.rpc.ServerObject.getMethod(ServerObject.java:218)
at com.isomorphic.datasource.DataSourceDMI.execute(DataSourceDMI.java:20
9)
at com.isomorphic.datasource.DataSourceDMI.execute(DataSourceDMI.java:60
)
at com.isomorphic.datasource.DSRequest.execute(DSRequest.java:1111)
at com.isomorphic.servlet.IDACall.handleDSRequest(IDACall.java:155)
at com.isomorphic.servlet.IDACall.processRequest(IDACall.java:106)
at com.isomorphic.servlet.IDACall.doPost(IDACall.java:54)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
at com.isomorphic.servlet.BaseServlet.service(BaseServlet.java:152)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:269)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:188)
at com.isomorphic.js.JSSyntaxScannerFilter.doFilter(JSSyntaxScannerFilte
r.java:241)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:215)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:188)
at com.isomorphic.servlet.CompressionFilter.doFilter(CompressionFilter.j
ava:248)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:215)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:188)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
alve.java:210)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
alve.java:174)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
ava:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
ava:117)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
ve.java:108)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
a:151)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
:870)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.p
rocessConnection(Http11BaseProtocol.java:665)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpo
int.java:528)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFol
lowerWorkerThread.java:81)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadP
ool.java:685)
at java.lang.Thread.run(Thread.java:619)

FYI, I am using SmartClient 7 beta.

So again:

... your DMI target (dmi.SampleDMI) is either mistyped, missing from the deployment or has no zero argument public constructor.

Or another possibility is that it has a static initializer which is failing. In any case, as you have demonstrated, the problem is with your DMI class.

I think you missed my point. I used the sample code given in the example supplyitem and just changed the java file package to “dmi” from “com.isomorphic.examples” and correspoding entry in supplyItemDMI.ds.xml. and copied this new class file to classes/dmi folder And this code is giving the same error. All i have changed is package of the class file. Earlier it was picking it from isomorphic_examples jar. Now i haveplaced the class file in dmi package inside classes folder. I don’t understand this weird behaviour. Please explain.

This is the source code for supplyItemDMI.java. As you can see, I have only changed the package.

//----------------------------------------------------------------------
// Isomorphic SmartClient
//
// SupplyItemDMI implementation
//
//----------------------------------------------------------------------

package dmi;

import java.util.;
import javax.servlet.
;
import javax.servlet.http.*;

import com.isomorphic.log.;
import com.isomorphic.util.
;
import com.isomorphic.datasource.*;
import vo.SupplyItem;

import dao.SupplyItemStore;

// the <serverObject> declaration in supplyItemDMI.ds.xml directs the SmartClient Java
// server libraries to find the SupplyItemFetch class.
// Several ways of finding or creating the DMI target are supported, including via Spring, or
// via session or request attributes. See ServerObject.lookupStyle in the SmartClient Reference.
// You can also provide your own servlet, invoking SmartClient DMI from a Spring Controller or
// Struts Action.
public class SupplyItemDMI {

Logger log = new Logger(SupplyItemDMI.class.getName());

public SupplyItemDMI() {
	super();
	// TODO Auto-generated constructor stub
}

// By default, for a DSRequest of type "fetch", a method named "fetch" is invoked.  You can
// customize this via the &lt;serverObject&gt; declaration.
public DSResponse fetch(DSRequest dsRequest) 
    throws Exception 
{
    System.out.println("/n/n/n/n/procesing DMI fetch operation/n/n/n/n");

    // Fetch a List of matching SupplyItem Beans from some pre-existing Java object model
    // provided by you, represented by "SupplyItemStore" in this example
    List matchingItems =
        SupplyItemStore.findMatchingItems((Long)dsRequest.getFieldValue("itemID"),
                                          (String)dsRequest.getFieldValue("itemName"));

    // this implementation shows data paging (returning only ranges of requested records)
    long startRow = dsRequest.getStartRow();
    long endRow = dsRequest.getEndRow();

    long totalRows = matchingItems.size();
    DSResponse dsResponse = new DSResponse();
    dsResponse.setTotalRows(totalRows);
    dsResponse.setStartRow(startRow);

    endRow = Math.min(endRow, totalRows);
    dsResponse.setEndRow(endRow);

    // trim the data to the requested range of records.  In a real application, the startRow
    // and endRow would be passed to the ORM layer or to SQL for maximum efficiency.
    List results;
    if (totalRows &gt; 0) {
        results = matchingItems.subList((int)dsResponse.getStartRow(), 
                                        (int)dsResponse.getEndRow());
    } else {
        results = matchingItems;
    }
    
    // just return the List of matching beans
    dsResponse.setData(results);

    return dsResponse;
}

// Declared parameters of the method are automatically provided.  For example, if your
// method declares a parameter of type HttpServletRequest, the current HttpServletRequest
// will be passed.
// If you declare a parameter that is a Java Bean, SmartClient will create an instance of
// the bean and apply the DSRequest data to the bean via Java reflection, matching
// DataSource fields to Java setter methods.  For example, for the DataSource field
// "itemName", SupplyItem.setItemName() is called.
public SupplyItem add(SupplyItem record)
    throws Exception
{
    log.info("procesing DMI add operation");

    // most ORM systems can store a new Object with a single call like this.
    SupplyItemStore.storeItem(record);

    // return the record-as-saved so SmartClient can update client-side caches.  This
    // pattern ensures client-side components receive server-generated fields (such as an
    // auto-generated primaryKey value).  SmartClient can then update caches in place
    // instead of re-fetching data.
    return record;
}

// The "update" method declares a parameter of type "Map" and so receives DSRequest.data as
// a Java Map.  For an "update" operation, the data includes updated fields and always
// includes the field declared as primaryKey:true.
public SupplyItem update(Map record)
    throws Exception
{
    log.info("procesing DMI update operation");

    // look up the existing data by primary key
    SupplyItem existingRecord = SupplyItemStore.getItemByID((Long)record.get("itemID"));

    // DataTools.setProperties() is a SmartClient API that applies a Map of properties to a
    // Bean via reflection, matching Map keys to setter methods on the Bean.
    DataTools.setProperties(record, existingRecord);

    // store it, and return the record-as-saved so SmartClient can update client-side caches.  
    SupplyItemStore.storeItem(existingRecord);
    return existingRecord;
}


public SupplyItem remove(SupplyItem record) 
    throws Exception
{
    log.info("procesing DMI remove operation");

    // on a removal, just return
    return SupplyItemStore.removeItem(record.getItemID());
}

}

A class SupplyItemDMI in package “dmi” has a fully qualified classname of dmi.SupplyItemDMI, not dmi.SampleDMI.

I guess you missed my point where I said that now i am trying with the example code given in Custom Data Source Using DMI section. I am no longer proceeding with my sampleDMI.jsp and sampleDMI.ds.xml. Now I am using supplyItemDMI.jsp and supplyItemDMI.ds.xml which are files copied from the example code.

supplyItemDMI.ds.xml>>

<DataSource
ID=“supplyItemDMI”
serverType=“generic”
testFileName=“supplyItem.data.xml”
>
<fields>
<field name=“itemID” type=“sequence” hidden=“true” primaryKey=“true”/>
<field name=“itemName” type=“text” title=“Item” length=“128” required=“true”/>
<field name=“SKU” type=“text” title=“SKU” length=“10” required=“true”/>
<field name=“description” type=“text” title=“Description” length=“2000”/>
<field name=“category” type=“text” title=“Category” length=“128” required=“true”
foreignKey=“supplyCategory.categoryName”/>
<field name=“units” type=“enum” title=“Units” length=“5”>
<valueMap>
<value>Roll</value>
<value>Ea</value>
<value>Pkt</value>
<value>Set</value>
<value>Tube</value>
<value>Pad</value>
<value>Ream</value>
<value>Tin</value>
<value>Bag</value>
<value>Ctn</value>
<value>Box</value>
</valueMap>
</field>
<field name=“unitCost” type=“float” title=“Unit Cost” required=“true”>
<validators>
<validator type=“floatLimit” precision=“2” min=“0” errorMessage=“Please enter a valid cost”/>
</validators>
</field>
<field name=“inStock” type=“boolean” title=“In Stock”/>
<field name=“nextShipment” type=“date” title=“Next Shipment”/>
</fields>

&lt;serverObject lookupStyle="new" className="dmi.SupplyItemDMI"/&gt;


&lt;!-- You can define an operationBindings section to bind operation names to server method
     (potentially additionally discriminated by the operationId).
     In the absense of this section, the server will look for a server method named after
     the operationType.  
--&gt;
&lt;!--
&lt;operationBindings&gt;
    &lt;binding operationType="fetch" serverMethod="fetch"&gt;
    &lt;serverObject  lookupStyle="new" className="com.isomorphic.examples.SupplyItemDMI"/&gt;
    &lt;/binding&gt;
&lt;/operationBindings&gt;
--&gt;

</DataSource>

supplyItemDMI.jsp>>

<!--------------------------------------------------------------------
SmartClient SDK
Custom DataSource Operations Remoting Example

Copyright 2001-2007 Isomorphic Software, Inc. (www.isomorphic.com)

---------------------------------------------------------------------->

<%@ taglib uri=“/WEB-INF/iscTaglib.xml” prefix=“isomorphic” %>
<HEAD><TITLE>
SmartClient SDK - Custom DataSource Operations Remoting example
</TITLE></HEAD><isomorphic:loadISC skin=“SmartClient”/>
<BODY BGCOLOR=#D3D3D3><SCRIPT>

<isomorphic:loadDS ID=“supplyItemDMI”/>

VStack.create({
left:50, top:75,
width:“70%”,
membersMargin:20,
members:[

	Label.create({
		ID:"helpText",
          autoDraw: false,
		contents:"&lt;ul&gt;" +
			"&lt;li&gt;click a record in the grid to view and edit that record in the form&lt;/li&gt;" +
			"&lt;li&gt;click &lt;b&gt;Save&lt;/b&gt; to save changes to an edited record in the form&lt;/li&gt;" +
			"&lt;li&gt;click &lt;b&gt;Clear&lt;/b&gt; to clear all fields in the form&lt;/li&gt;" +
			"&lt;li&gt;click &lt;b&gt;Filter&lt;/b&gt; to filter (substring match) the grid based on the value of the 'Item' form value only.&lt;/li&gt;" +
			"&lt;li&gt;click &lt;b&gt;Fetch&lt;/b&gt; to fetch records (exact match) for the grid based on the value of the 'Item' form value only.&lt;/li&gt;" +
			"&lt;li&gt;click &lt;b&gt;Delete&lt;/b&gt; to delete all selected records&lt;/li&gt;" +
			"&lt;li&gt;double-click a record in the grid to edit inline (press Return, or arrow/tab to another record, to save)&lt;/li&gt;" +
			"&lt;/ul&gt;"
	}),

	// databound ListGrid
	//   * click records to edit in boundForm and view in boundViewer
	//   * double-click record to edit inline (Return or arrow/tab off current row to save)
	ListGrid.create({
		ID:"boundList",
        autoDraw: false,
        dataSource: supplyItemDMI,
		height:200,
		canEdit:true,
        selectionChanged : function (record, state) {
            if (this.selection.anySelected()) {
                deleteBtn.enable();
                saveBtn.setDisabled(this.selection.multipleSelected());
                boundForm.editRecord(record);
                boundViewer.viewSelectedData(this);
            } else {
                deleteBtn.disable();
                saveBtn.disable();
            }
        }
	}),

	// databound DynamicForm
	//   * click boundList records to edit
	DynamicForm.create({
		ID:"boundForm",
          autoDraw: false,
          dataSource: supplyItemDMI,
		numCols:"6",
		autoFocus:false
	}),

	// toolbar to perform various actions using the boundForm values (see helpText above)
	Toolbar.create({
		autoDraw:false,
		membersMargin:10,
        buttonConstructor: "IButton",
        height: 22,
		buttons:[
			{title:"Save", click:"boundForm.saveData()", ID:"saveBtn"},
			{title:"Clear", click:"boundForm.clearValues();boundForm.editNewRecord();saveBtn.enable()"},
			{title:"Filter", click:"boundList.filterData(boundForm.getValuesAsCriteria());"},
			{title:"Fetch", 
             click:"boundList.fetchData(boundForm.getValuesAsCriteria());"},
			{title:"Delete", ID:"deleteBtn", disabled: true, 
             click:"boundList.removeSelectedData();boundList.deselectAllRecords()"}
		]
	}),
	
	// databound DetailViewer
	//   * click boundList records to display
	DetailViewer.create({
		ID:"boundViewer",
          autoDraw: false,
          dataSource: supplyItemDMI
	})
]

});

boundList.filterData();

</SCRIPT></BODY>
</HTML>

Again, static initializers are a good place to look. You have these:

import vo.SupplyItem;

import dao.SupplyItemStore;

If you have actually copied the demo source code for these classes over to these new packages, then you have a static initializer in SupplyItemStore which depends on the presence of a SQL database. As the comments say, this code is only for demonstration purposes only and SupplyItemStore is meant to represent an ORM system (like Hibernate) that you already have set up.

Lots and lots of people are using DMI successfully. You can figure it out.

My only question to you is that why is the code not working after changing the class package and then placing it inside classes folder while it is working fine without any package changes when it is being referred from jar.

In this particular (unnecessary and flawed) test, that would mean your code would not compile. If you want to continue with this test, yes remove the SupplyItemStore import and return hardcoded data instead. But the underlying problem appears to be that you need training - we can’t help you any further on the forums. If interested in training, contact Isomorphic here.

My only question to you is that why is the code not working after changing the class package and then placing it inside classes folder while it is working fine without any package changes when it is being referred from jar.