cancel
Showing results for 
Search instead for 
Did you mean: 

Error in Table Sorting in Webdynpro Java

Former Member
0 Kudos

Hi Experts,

I've a web dynpro component in which I am trying to use the table sorting in one of the views table.

But as soon as I click the view, I get the following error chain:

java.lang.NoClassDefFoundError

at com.xxx.wss.homepage.OnlineBillPayView.wdDoModifyView(OnlineBillPayView.java:153)

at com.xxx.wss.homepage.wdp.InternalOnlineBillPayView.wdDoModifyView(InternalOnlineBillPayView.java:567)

at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.doModifyView(DelegatingView.java:78)

at com.sap.tc.webdynpro.progmodel.view.View.modifyView(View.java:337)

at com.sap.tc.webdynpro.clientserver.cal.ClientComponent.doModifyView(ClientComponent.java:481)

at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.doModifyView(WindowPhaseModel.java:551)

at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.processRequest(WindowPhaseModel.java:148)

at com.sap.tc.webdynpro.clientserver.window.WebDynproWindow.processRequest(WebDynproWindow.java:335)

at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:143)

at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doProcessing(ApplicationSession.java:333)

at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessingStandalone(ClientSession.java:741)

at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessing(ClientSession.java:694)

at com.sap.tc.webdynpro.clientserver.session.ClientSession.doProcessing(ClientSession.java:253)

at com.sap.tc.webdynpro.clientserver.session.RequestManager.doProcessing(RequestManager.java:149)

at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:62)

at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doPost(DispatcherServlet.java:53)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)

at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)

at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:386)

at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:364)

at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:1060)

at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:265)

at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)

at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:175)

at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)

at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)

at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)

at java.security.AccessController.doPrivileged(Native Method)

at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:104)

at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:176)

I've followed the same steps for sorting the tables in other Web dynpro components and they are working fine.

The issue exists only for one particular component.

I reiterated all the steps quite a few times but no luck so far.

Even I deleted the ear file to verify if it is built properly and restarted the server quite a few times.

But still, I am getting this error again and again.

As far as the error is concerned, it seems that the view is not able to access the TableSorter.java class file but if that is the case I am not able to figure out why as the same steps have been followed for the other components which work absolutely fine.

Please assist.

Best Regards,

Anurag

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi,

Could u try repairing your DC once & then build it. If it doesnot work, try reloading your DC or if it is on the track then try creating the project again, which is the last option to be used if the above two options do not work. I faced the same issue once & repairing helped me solve the issue.

I hope this helps....

Regards,

Ruchita

lokesh_kamana
Active Contributor
0 Kudos

Hi,

Are you using an external library DC or what is the location of the tablesorter.java file.

Is it placed under components folder of the webdynpro DC.

If you could specify the location we could help you better.

Thanks & Regards,

Lokesh Kamana.

Former Member
0 Kudos

Hi John and Lokesh,

The Tablesorter.java file is placed as folllows:

Packages->com->sap->tc->webdynpro->tests->utils->TableSorter.java

I've placed this file on the same location in other components as well and they work fine.

The issue only exists with this component.

@Vijay Kalluri: I have to sort all the columns of the table and hence I am using the below code:

if (firstTime) {

IWDTable table = (IWDTable) view.getElement("MyAccount");

wdContext.currentContextElement().setSorter(new TableSorter (table,wdThis.wdGetSorterItemAction(),null));

}

Everything seems to be fine but still facing the error.

Please assist.

Best Regards,

Anurag

Former Member
0 Kudos

Hi ,

Have you done this type of codeing also

Select u r Table UI element---go to properties..Here u have to Create onSort()

in that method u have to this code


public void onActionsort(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
{
//@@begin onActionsort(ServerEvent)
* wdContext.currentContextElement().getTableSorter().sort(wdEvent, wdContext.nodeTableData());*
//@@end
}

I hope this is helpfull for you,

Regards

Vijay Kalluri

Former Member
0 Kudos

Hi Vijay,

Yes, I've created an action for sorting the table like you've mentioned. Please find below the code for the same.

public void onActionSorterItem(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )

{

//@@begin onActionSorterItem(ServerEvent)

wdContext.currentContextElement().getTableSorter().sort(wdEvent,wdContext.nodeMyAccounts());

//@@end

}

My problem is that I am not getting the error when I am trying to sort the table but I am getting the error as soon as I am calling the view because of the below code as it is rendered everytime in the view:

public static void wdDoModifyView(IPrivateOnlineBillPayView wdThis, IPrivateOnlineBillPayView.IContextNode wdContext, com.sap.tc.webdynpro.progmodel.api.IWDView view, boolean firstTime)

{

//@@begin wdDoModifyView

if (firstTime) {

IWDTable table = (IWDTable) view.getElement("MyAccounts");

wdContext.currentContextElement().setSorter(new TableSorter (table,wdThis.wdGetSorterItemAction(),null));

}

//@@end

}

The error is coming on the below line:

wdContext.currentContextElement().setSorter(new TableSorter (table,wdThis.wdGetSorterItemAction(),null));

Best Regards,

Anurag

junwu
Active Contributor
0 Kudos

TableSorter is placed in which DC? current or external?

Former Member
0 Kudos

Hi John,

TableSorter is placed in the current DC.

Best Regards,

Anurag

Former Member
0 Kudos

This message was moderated.

Former Member
0 Kudos

Hi Anurag Gwari,

Do one think. U can follow this link. Actually

Actually you are getting Error in wdDoModifyView()

U can follow these Steps. Its working fineu2026all ready I have done this work.

The error is coming on the below line:

wdContext.currentContextElement().setSorter(new TableSorter (table,wdThis.wdGetSorterItemAction(),null));

Here u can write this code then check it.

wdContext.currentContextElement().setCustomerTableSorter(

new TableSorter(table, wdThis.wdGetSortCustomersAction(), null, new String[] { "CustomerTable_Name" }));

Hope this is help full for u

Regards

Vijay Kalluri

p330068
Active Contributor
0 Kudos

Dear Anurag

As per your code there is mismatch, you are setting at wdDoModifyView with context attribute Sorter

 wdContext.currentContextElement().setSorter(new TableSorter (table,wdThis.wdGetSorterItemAction(),null)); 

then you are accessing at onActionSorterItem with context attribute TableSorter

 wdContext.currentContextElement().getTableSorter().sort(wdEvent,wdContext.nodeMyAccounts()); 

I think you should use the TableSorter context attribute in both place while setting and getting methods.

Refer to document for the same : [http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/e0cf0997-2e08-2d10-b08e-964a2c04c47a|http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/e0cf0997-2e08-2d10-b08e-964a2c04c47a]

Hope it will helps

Best Regards

Arun Jaiswal

Former Member
0 Kudos

Hi Vijay,

I tried re-iterating the steps that you mentioned in your above reply, but still it doesn't work.

As far as I understand, the issue seems to be with the accessibility of tablesorter.java file.

Because if I comment the code in the wdDoModifyView method of the view controller, then the view works fine but if I again uncomment it, the view throws an error as soon as it gets invoked.

So, the issue seems to be with the Tablesorter. java file's accessibility only.

The file is placed at the correct location and I get the import statement also when I press Organize imports after placing the code in the wdDoModifyView method.

import com.sap.tc.webdynpro.tests.utils.TableSorter;

But somehow, it doesn't work.

Please assist.

Best Regards.

Anurag

Former Member
0 Kudos

Hi Arun,

I am using the same attribute at both the places but still it doesn't work.

Actually, the issue seems to be with the accessibility of the TableSorter.java file.

Kindly assist.

Best Regards,

Anurag

p330068
Active Contributor
0 Kudos

Hi Anurag

Please check and verify the path for table sorter java file at com > sap > tc > webdynpro > tests > utils > TableSorter under SRC > PACKAGES as you have imported

 import com.sap.tc.webdynpro.tests.utils.TableSorter; 

Check the correct path of the TableSorter java file under SRC > PACKAGES in the webdynpor project and then use the path in import statement in code.

Best Regards

Arun Jaiswal

Former Member
0 Kudos

Hi Arun,

Yes, my table sorter java file is placed at com > sap > tc > webdynpro > tests > utils > TableSorter under SRC > PACKAGES path.

It is placed at the similar location in other Web dynpro components as well and they are working fine.

The issue is only with this component.

I've also tried deleting the table sorter java file and pasting it again at the same path and built the component and even restarted the server but it still gives me the error.

Please assist.

Best Regards,

Anurag

p330068
Active Contributor
0 Kudos

Hi Anurag

Please re-check the document for table sorter. May be you missed something in this webdynpro component.

[Enhanced Web Dynpro Java TableSorter for SAP NetWeaver 04s|http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/3287] [original link is broken] [original link is broken] [original link is broken];

Also refer the NWDS error log at windows > show view > others > PDE runtime > error log

As you said other DC is working fine, then you can check the settings in both dc's

Hope it will helps

Best Regards

Arun Jaiswal

Former Member
0 Kudos

This message was moderated.

junwu
Active Contributor
0 Kudos

where you put the tablesorter class?