Skip to Content
0
P K
Oct 07, 2008 at 03:14 PM

class not found after change in portalapp.xml

27 Views

HI All,

i am creating a jspdynpage and tryiong to get data int it using beans.

I wrote code looking at the sample examples given in sap help sites but my bean was not accessible initially though every thing was fine in code. so when i checked the sdn forums saw that the ComponentType ans JSP elements need to be deleted from the portalapp.xml.....but when i removed them the JSP is not able to find the classfiles at all......

find below my code.....please help me

<?xml version="1.0" encoding="utf-8"?>

<application>

<application-config>

<property name="PrivateSharingReference" value="com.sap.portal.htmlb"/>

</application-config>

<components>

<component name="TestJSPDynPage">

<component-config>

<property name="ClassName" value="testjspdynpage.TestJSPDynPage"/>

</component-config>

<component-profile>

<property name="tagLib" value="/SERVICE/htmlb/taglib/htmlb.tld"/>

</component-profile>

</component>

<component name="SamplePortalApplicationComponent">

<component-config>

<property name="ClassName" value="satyam.testpkg.SamplePortalApplicationComponent"/>

</component-config>

<component-profile/>

</component>

</components>

<services/>

</application>

my Java file is

		public void doProcessBeforeOutput() throws PageException {
			IUserContext userContext = null;
			IUserMappingService userMappingService = null;
			IUserMappingData userMappingData = null;
			
			IPortalComponentRequest componentRequest = (IPortalComponentRequest)this.getRequest();
			IPortalComponentContext componentContext = componentRequest.getComponentContext();
			IPortalComponentProfile componentProfile = componentContext.getProfile();
			
			Map userInfoMap = null; // map to contain the usermapping info retrieved from the usermapping service
			String currentPortalUser = null;
			String currentPortalUserDisplayName = null;
			String mappedBackendUser = null;

			/* this is the system alis which would represent the target back end
			 * The Value is hard coded to "SAP_R3_HumanResources" because for ESS 50.4 the SAP System configured in the 
			 * Portal's System Landscape must contain the alias "SAP_R3_HumanResources". 
			 */
			final String TARGET_BACKEND = "SAP_R3_HumanResources";
			
			MyBean myUserDataBean = null;
			
			myUserDataBean = new MyBean();

			//get the IUserContext object from the current request and get the user's info from the object
			userContext = ((IPortalComponentRequest) this.getRequest()).getUser();
			
			//get the UserMapping info
			userMappingService = (IUserMappingService)PortalRuntime.getRuntimeResources().getService(IUserMappingService.KEY);
			userMappingData = userMappingService.getMappingData(TARGET_BACKEND, userContext); 
			userInfoMap = new HashMap (); 
			try { 
				userMappingData.enrich (userInfoMap); 
			} 
			catch (NoLogonDataAvailableException nldae) {   
				nldae.printStackTrace();// ... Error handling 
			}
			
			//get the current logged on portal userid and display name and set the corresponsing bean values

			currentPortalUser = userContext.getUniqueName();
			myUserDataBean.setCurrentPortalUserName(currentPortalUser);
			
			currentPortalUserDisplayName = userContext.getDisplayName();
			myUserDataBean.setCurrentPortalUserDisplayName(currentPortalUserDisplayName);

			myUserDataBean.setMappedBackendUserName((String)userInfoMap.get( "user" ));
			myUserDataBean.setMappedBackendPassword((String)userInfoMap.get("mappedpassword"));
			
			((IPortalComponentRequest) getRequest()).getNode().putValue("userDataObj", myUserDataBean);
			((IPortalComponentRequest) getRequest()).getServletRequest().setAttribute("userData",myUserDataBean);
			
			componentProfile.putValue("userDataObjInProfile",myUserDataBean);

			this.setJspName("TestJSPDYNPage.jsp");
}

can any one please help me why is my class file not visible after removing the ComponentType and JSP tags from the portalapp.xml

i am getting the following exception after i made the changes

Caused by: java.lang.ClassNotFoundException: testjspdynpage.TestJSPDynPage

-


Loader Info -


ClassLoader name: [com.sapportals.portal.prt.util.ApplicationClassLoader@1ac8ae7]

Parent loader name: [com.sapportals.portal.prt.util.ApplicationClassLoader@517c21]

References:

not registered!

Resources:

C:
usr
sap
EPD
JC00
j2ee
cluster
server0
apps
sap.com
irj
servlet_jsp
irj
root
WEB-INF
portal
portalapps
SamplePortalApplication
private
lib
SamplePortalApplicationcore.jar

-


at com.sap.engine.frame.core.load.ReferencedLoader.loadClass(ReferencedLoader.java:382)

at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)

at java.lang.Class.forName0(Native Method)

at java.lang.Class.forName(Class.java:219)

at com.sapportals.portal.prt.core.broker.PortalComponentItemFacade.getInstanceInternal(PortalComponentItemFacade.java:228)

... 30 more

#

#1.5 #FAF0F2F0F0F300400000001D0000122C000458AB14B1A070#1223391716696#com.sap.portal.prt.runtime#sap.com/irj#com.sap.portal.prt.runtime#Pavank#4885##n/a##a0d018a0948011ddcedffaf0f2f0f0f3#SAPEngine_Application_Thread[impl:3]_12##0#0#Error##Java###11:01_07/10/08_0011_8548050

[EXCEPTION]

#1#java.lang.ClassNotFoundException: testjspdynpage.TestJSPDynPage

-


Loader Info -


ClassLoader name: [com.sapportals.portal.prt.util.ApplicationClassLoader@1ac8ae7]

Parent loader name: [com.sapportals.portal.prt.util.ApplicationClassLoader@517c21]

References:

not registered!

Resources:

C:
usr
sap
EPD
JC00
j2ee
cluster
server0
apps
sap.com
irj
servlet_jsp
irj
root
WEB-INF
portal
portalapps
SamplePortalApplication
private
lib
SamplePortalApplicationcore.jar

-


at com.sap.engine.frame.core.load.ReferencedLoader.loadClass(ReferencedLoader.java:382)

at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)

at java.lang.Class.forName0(Native Method)

at java.lang.Class.forName(Class.java:219)

at com.sapportals.portal.prt.core.broker.PortalComponentItemFacade.getInstanceInternal(PortalComponentItemFacade.java:228)

at com.sapportals.portal.prt.core.broker.PortalComponentItemFacade.getComponentInstance(PortalComponentItemFacade.java:160)

at com.sapportals.portal.prt.core.broker.PortalComponentItem.getComponentInstance(PortalComponentItem.java:732)

at com.sapportals.portal.prt.component.PortalComponentContext.getComponent(PortalComponentContext.java:103)

at com.sapportals.portal.prt.component.PortalComponentContext.init(PortalComponentContext.java:242)

at com.sapportals.portal.prt.core.broker.PortalComponentContextItem.refresh(PortalComponentContextItem.java:267)

at com.sapportals.portal.prt.core.broker.PortalComponentContextItem.getContext(PortalComponentContextItem.java:312)

at com.sapportals.portal.prt.component.PortalComponentRequest.getComponentContext(PortalComponentRequest.java:385)

at com.sapportals.portal.prt.connection.PortalRequest.getRootContext(PortalRequest.java:435)

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

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

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

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

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

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

at com.sap.engine.services.servlets_jsp.server.servlet.InvokerServlet.service(InvokerServlet.java:156)

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:1039)

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:102)

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

#

regards,

--

PK