cancel
Showing results for 
Search instead for 
Did you mean: 

Iview Error

Former Member
0 Kudos

Hi All,

I have Developed iView which retreives data from backend SAP system.When i first click on iView it is connecting to R3 and displaying data as i wanted but when i click on same Iview immediately it is giving Portal Runtime exception.I am using JCO.When i look into log it is showing Null pointer exception.Below is the log file.I really appreciate for any inputs..

<b>at com.sapportals.portal.prt.core.PortalRequestManager.handlePortalComponentException(PortalRequestManager.java:858)

at com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:310)

at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:138)

at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:190)

at com.sapportals.portal.prt.component.PortalComponentResponse.include(PortalComponentResponse.java:209)

at com.sapportals.portal.prt.pom.PortalNode.service(PortalNode.java:576)

at com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:300)

at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:138)

at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:190)

at com.sapportals.portal.prt.core.PortalRequestManager.runRequestCycle(PortalRequestManager.java:669)

at com.sapportals.portal.prt.connection.ServletConnection.handleRequest(ServletConnection.java:208)

at com.sapportals.portal.prt.dispatcher.Dispatcher$doService.run(Dispatcher.java:532)

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

at com.sapportals.portal.prt.dispatcher.Dispatcher.service(Dispatcher.java:415)

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

at com.inqmy.services.servlets_jsp.server.InvokerServlet.service(InvokerServlet.java:126)

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

at com.inqmy.services.servlets_jsp.server.RunServlet.runSerlvet(RunServlet.java:149)

at com.inqmy.services.servlets_jsp.server.ServletsAndJspImpl.startServlet(ServletsAndJspImpl.java:832)

at com.inqmy.services.httpserver.server.RequestAnalizer.checkFilename(RequestAnalizer.java:666)

at com.inqmy.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:313)

at com.inqmy.services.httpserver.server.Response.handle(Response.java:173)

at com.inqmy.services.httpserver.server.HttpServerFrame.request(HttpServerFrame.java:1288)

at com.inqmy.core.service.context.container.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:36)

at com.inqmy.core.cluster.impl5.ParserRunner.run(ParserRunner.java:55)

at com.inqmy.core.thread.impl0.ActionObject.run(ActionObject.java:46)

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

at com.inqmy.core.thread.impl0.SingleThread.run(SingleThread.java:148)

Caused by: java.lang.NullPointerException

at com.ust.jcatotable.Display$DisplayDynPage.setBeanFromProfile(Display.java:128)

at com.ust.jcatotable.Display$DisplayDynPage.doInitialization(Display.java:97)

at com.sapportals.htmlb.page.PageProcessor.handleRequest(PageProcessor.java:94)

at com.sapportals.portal.htmlb.page.PageProcessorComponent.doContent(PageProcessorComponent.java:135)

at com.sapportals.portal.prt.component.AbstractPortalComponent.serviceDeprecated(AbstractPortalComponent.java:209)

at com.sapportals.portal.prt.component.AbstractPortalComponent.service(AbstractPortalComponent.java:114)

at com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:300)

at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:138)

at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:190)

at com.sapportals.portal.prt.component.PortalComponentResponse.include(PortalComponentResponse.java:209)

at com.sapportals.portal.prt.pom.PortalNode.service(PortalNode.java:576)

at com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:300)

at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:138)

at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:190)

at com.sapportals.portal.prt.core.PortalRequestManager.runRequestCycle(PortalRequestManager.java:669)

at com.sapportals.portal.prt.connection.ServletConnection.handleRequest(ServletConnection.java:208)

at com.sapportals.portal.prt.dispatcher.Dispatcher$doService.run(Dispatcher.java:532)

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

at com.sapportals.portal.prt.dispatcher.Dispatcher.service(Dispatcher.java:415)

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

at com.inqmy.services.servlets_jsp.server.InvokerServlet.service(InvokerServlet.java:126)

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

at com.inqmy.services.servlets_jsp.server.RunServlet.runSerlvet(RunServlet.java:149)

at com.inqmy.services.servlets_jsp.server.ServletsAndJspImpl.startServlet(ServletsAndJspImpl.java:832)

at com.inqmy.services.httpserver.server.RequestAnalizer.checkFilename(RequestAnalizer.java:666)

at com.inqmy.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:313)

at com.inqmy.services.httpserver.server.Response.handle(Response.java:173)

at com.inqmy.services.httpserver.server.HttpServerFrame.request(HttpServerFrame.java:1288)

at com.inqmy.core.service.context.container.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:36)

at com.inqmy.core.cluster.impl5.ParserRunner.run(ParserRunner.java:55)

at com.inqmy.core.thread.impl0.ActionObject.run(ActionObject.java:46)

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

at com.inqmy.core.thread.impl0.SingleThread.run(SingleThread.java:148)

Thanks in advance</b>

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Caused by: java.lang.NullPointerException

at com.ust.jcatotable.Display$DisplayDynPage.setBeanFromProfile(Display.java:128)

Hey it looks like the Dynpage is not able to get the bean instance from the session.

What is the persistence mechanism you are using to store Bean state?

It would be helpful if you could send the Code present at line 128 of the (JSPDynpage) controller class.

~Deshdeepak

Former Member
0 Kudos

Hi Shukla,

Thank you for the reply.I am posting JSPDynpage and make 128 line bold

package com.ust.jcatotable;

//import java.awt.Event;

//import java.util.Vector;

import com.sapportals.htmlb.event.Event;

import javax.resource.cci.MappedRecord;

import javax.resource.cci.RecordFactory;

import com.sapportals.connector.connection.IConnection;

import com.sapportals.connector.execution.functions.IInteraction;

import com.sapportals.connector.execution.functions.IInteractionSpec;

import com.sapportals.connector.execution.structures.IRecordSet;

import com.sapportals.htmlb.DropdownListBox;

import java.util.GregorianCalendar;

import com.sapportals.htmlb.event.TableNavigationEvent;

import com.sapportals.htmlb.page.DynPage;

import com.sapportals.htmlb.page.PageException;

import com.sapportals.portal.htmlb.page.JSPDynPage;

import com.sapportals.portal.htmlb.page.PageProcessorComponent;

import com.sapportals.portal.ivs.cg.ConnectionProperties;

import com.sapportals.portal.ivs.cg.IConnectorGatewayService;

import com.sapportals.portal.ivs.cg.IConnectorService;

import com.sapportals.portal.prt.component.IPortalComponentContext;

import com.sapportals.portal.prt.component.IPortalComponentProfile;

import com.sapportals.portal.prt.component.IPortalComponentRequest;

import com.sapportals.portal.prt.component.IPortalComponentResponse;

import com.sapportals.portal.prt.runtime.PortalRuntime;

public class Display extends PageProcessorComponent {

public DynPage getPage(){

return new DisplayDynPage();

}

public static class DisplayDynPage extends JSPDynPage{

private Object formatFlag;

public static IConnection connection ;

private IPortalComponentRequest request;

private IPortalComponentContext context;

private IPortalComponentProfile profile;

private IPortalComponentResponse response;

private int visibleRow=1;

private String selection=" " ;

private String selectionYear=" ";

private String Month;

private String Year;

TableBean myBean;

private String R3Dest;

public void doInitialization(){

response = (IPortalComponentResponse) this.getResponse();

request = (IPortalComponentRequest) this.getRequest();

context = request.getComponentContext();

profile = context.getProfile();

if( selection.equals(" ") )

{

GregorianCalendar GC = new GregorianCalendar();

int Month = GC.get(GregorianCalendar.MONTH);

int Year = GC.get(GregorianCalendar.YEAR);

response.write("Month:"+Month);

response.write("Month:"+Year);

Month=Month+1;

//selection = "11";

selection = "Month";

}

if( selectionYear.equals(" ") )

//selectionYear = "2005";

selectionYear = "Year";

//// GregorianCalendar GC = new GregorianCalendar();

//// int Month = GC.get(GregorianCalendar.MONTH);

//// int Year = GC.get(GregorianCalendar.YEAR);

//// //Month= Month+1;

//// response.write("Month.."+Month);

//// selection = ""Month"";

//// //selection = "Month";

//// //visRow = "1";

//// }

//// if( selectionYear.equals(" ") )

////

//// selectionYear = ""Year"";

Object o = context.getValue("myBean");

if(o==null || !(o instanceof TableBean)){

myBean = new TableBean();

setBeanFromProfile(profile, myBean);

context.putValue("myBean",myBean);

}else {

setBeanFromProfile(profile, myBean);

myBean = (TableBean) o;

}

this.getData();

}

public void myOnNavigate(Event event) throws PageException{

TableNavigationEvent tne = (TableNavigationEvent) event;

this.visibleRow = tne.getFirstVisibleRowAfter();

if(myBean!=null)

myBean.setVisibleRow(new Integer(this.visibleRow).toString());

}

// This method is called when the user clicks on an entry in the listBox.

public void onSelect(Event event) throws PageException {

DropdownListBox lb= (DropdownListBox)this.getComponentByName("myListBox");

DropdownListBox lbYear= (DropdownListBox)this.getComponentByName("myListBoxYear");

selection = lb.getSelection();

selectionYear = lbYear.getSelection();

this.getData();

}

<b>public void doProcessAfterInput() throws PageException {

}</b> private void setBeanFromProfile(IPortalComponentProfile myProfile, TableBean myBean) {

myBean.setBoxWidth(myProfile.getProperty("width"));

myBean.setTooltip(myProfile.getProperty("tooltip"));

myBean.setDisabled(myProfile.getProperty("disabled"));

myBean.setItemText(myProfile.getProperty("ItemsFromJSP"));

myBean.setItemSelected(myProfile.getProperty("ItemSelected"));

}

public void doProcessBeforeOutput() throws PageException {

this.setJspName("display.jsp");

}

public void getConnection() {

IPortalComponentRequest request = (IPortalComponentRequest) this.getRequest();

IPortalComponentContext myContext = request.getComponentContext();

IPortalComponentProfile myProfile = myContext.getProfile();

R3Dest = myProfile.getProperty("R3DEST");

//String sapsystemalias= "SAP_R3_HumanResources";

IPortalComponentResponse response = (IPortalComponentResponse) this.getResponse();

try {

Object tempCon = PortalRuntime.getRuntimeResources().getService(IConnectorService.KEY);

IConnectorGatewayService cgService=(IConnectorGatewayService) tempCon;

if (cgService == null) {

}

ConnectionProperties cp=new ConnectionProperties(request.getLocale(),request.getUser());

connection= cgService.getConnection(R3Dest, cp);

// if (connection == null) {

//

// //response.write("connection fail");

// }

// else{

//

// //response.write("connection success");

// }

//

}

catch (Exception e) {

response.write("exception"+e);

}

}

public void getData()

{

IPortalComponentResponse response = (IPortalComponentResponse) this.getResponse();

String BAPIMethod_Get = "Y_Report";

String BAPI_Table_Get = "Ytable1";

String BAPI_Table_YLEG = "Ytable2";

String BAPI_Table_YDET = "Ytable3";

String BAPI_Table_YDAYS = "Ytable4";

request = (IPortalComponentRequest) this.getRequest();

context = request.getComponentContext();

profile = context.getProfile();

IPortalComponentProfile profile = context.getProfile();

Object o = context.getValue("myBean");

if(o==null || !(o instanceof TableBean)){

myBean = new TableBean();

// setBeanFromProfile(profile, myBean);

context.putValue("myBean",myBean);

}else {

//setBeanFromProfile(profile, myBean);

myBean = (TableBean) o;

}

this.getConnection() ;

try

{

// IConnection connection ;

Object LEVELS = profile.getProperty("LEVELS");

//Object LEVELS = "0";

String YEAR = selectionYear;

String MONTH = selection;

String MSS_ESS = profile.getProperty("MSS_ESS");

//String M = "M";

IInteraction ix = (IInteraction )connection.createInteractionEx();

IInteractionSpec ixspec = ix.getInteractionSpec();

ixspec.setPropertyValue("Name", BAPIMethod_Get);

RecordFactory rf = ix.getRecordFactory();

MappedRecord input = rf.createMappedRecord("input");

input.put("MSS_ESS", MSS_ESS);

input.put("MONTH", MONTH);

input.put("YEAR", YEAR);

input.put("LEVELS",LEVELS);

MappedRecord output = (MappedRecord) ix.execute(ixspec, input);

IRecordSet tableCAL = (IRecordSet)output.get("YCAL");

IRecordSet tableYDET = (IRecordSet)output.get("YDET");

IRecordSet tableYLEG = (IRecordSet)output.get("YLEG");

myBean.setdropMonth(selection);

myBean.setdropYear(selectionYear);

myBean.createData(tableCAL, output.get("NUMDAYS"), output.get("YDAYS"), tableYDET, tableYLEG,selection);

//Vector vTest = myBean.createData1(tableCAL, output.get("NUMDAYS"));

//response.write("Size:"+vTest.size());

connection.close();

}catch(Exception ex){

//response.write("Here Display"+ex.toString());

}

}

}

}

Thanks in Advance

Former Member
0 Kudos

Try getting the Bean again from the context in the PAI Block(which is ur 128 line)

<b>Plz don forget points, if it helped.</b>

Regards,

P.

Former Member
0 Kudos

Hi Peter,

Thanks for the reply.Can you please elaborate it?.

thanks in advance

Former Member
0 Kudos

Hi All,

Can anyone have any idea on this.....?

Its really urgent..

Thanks

Former Member
0 Kudos

Any inputs?

Former Member
0 Kudos

Try this in the ProcessAfterInput() Method:

myBean = (TableBean)context.getValue("myBean");

<b>Plz don forget points, if it helped.</b>

Regards,

P.

Former Member
0 Kudos

Hi Peter,

Thanks for the reply.I tried as you said.But still it is giving same problem.First when i click on iView it displayed data.Again when i click on same link it is giving error.

Thanks

Former Member
0 Kudos

Hi ALL,

I appreciate all inputs

Thanks

Former Member
0 Kudos

what you mean by clicking on iview??

A button on Iview?? or minimizing and maximizing the iview??

Regards,

P.

Former Member
0 Kudos

Iview link.

Thanks

Former Member
0 Kudos

Hey you

Iview is assigned to a Role.So in toplevel navigation we will have Role.When we click on that we will get all the worksets which are assigned to that role in second level nagivation.When we click on that workset we will all iviews in Detailed Navigation which are assigned to that workset.When i first click on that iview it is connecting to R3 and displaying data.But When i click on same link it is giving error.I am getting after refreshing the page or after few mins.Below is the logfile

at com.sapportals.portal.prt.core.PortalRequestManager.handlePortalComponentException(PortalRequestManager.java:858)

at com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:310)

at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:138)

at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:190)

at com.sapportals.portal.prt.core.async.AsyncPortalComponentResponse.include(AsyncPortalComponentResponse.java:295)

at com.sapportals.portal.prt.core.async.AsyncPortalComponentResponse.include(AsyncPortalComponentResponse.java:249)

at com.sapportals.portal.navigation.workAreaiView.doContent(workAreaiView.java:232)

at com.sapportals.portal.prt.component.AbstractPortalComponent.serviceDeprecated(AbstractPortalComponent.java:209)

at com.sapportals.portal.prt.component.AbstractPortalComponent.service(AbstractPortalComponent.java:114)

at com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:300)

at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:138)

at com.sapportals.portal.prt.core.async.AsyncIncludeRunnable$1$DoDispatchRequest.run(AsyncIncludeRunnable.java:340)

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

at com.sapportals.portal.prt.core.async.AsyncIncludeRunnable.run(AsyncIncludeRunnable.java:352)

at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:729)

at java.lang.Thread.run(Thread.java:479)

Caused by: java.lang.NullPointerException

at com.ust.jcatotable.Display$DisplayDynPage.setBeanFromProfile(Display.java:120)

at com.ust.jcatotable.Display$DisplayDynPage.doInitialization(Display.java:86)

at com.sapportals.htmlb.page.PageProcessor.handleRequest(PageProcessor.java:94)

at com.sapportals.portal.htmlb.page.PageProcessorComponent.doContent(PageProcessorComponent.java:135)

at com.sapportals.portal.prt.component.AbstractPortalComponent.serviceDeprecated(AbstractPortalComponent.java:209)

at com.sapportals.portal.prt.component.AbstractPortalComponent.service(AbstractPortalComponent.java:114)

at com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:300)

at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:138)

at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:190)

at com.sapportals.portal.prt.core.async.AsyncPortalComponentResponse.include(AsyncPortalComponentResponse.java:295)

at com.sapportals.portal.prt.core.async.AsyncPortalComponentResponse.include(AsyncPortalComponentResponse.java:249)

at com.sapportals.portal.navigation.workAreaiView.doContent(workAreaiView.java:232)

at com.sapportals.portal.prt.component.AbstractPortalComponent.serviceDeprecated(AbstractPortalComponent.java:209)

at com.sapportals.portal.prt.component.AbstractPortalComponent.service(AbstractPortalComponent.java:114)

at com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:300)

at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:138)

Thanks