Obtaining the JAAS subject in a portal application?
G'day,
Is there a safe method for obtaining the JAAS subject in a portal application?
There are problems in Java with getting the JAAS subject, as the standard Subject.getSubject() call can return null if called within a privileged action:
Subject s = Subject.getSubject(AccessController.getContext());
Subject.doAs(s, new PrivilegedAction() {
public Object run() {
Subject s1 = Subject.getSubject(AccessController.getContext());
AccessController.doPrivileged(new PrivilegedAction() {
public Object run() {
Subject s2 = Subject.getSubject(AccessController.getContext());
return null;
return null;
Here, s2 may be null, which is why other app servers have custom approaches (such as JBoss and its SecurityAssociation.getSubject() call).
In fact, when I try the above code in a portal application (protected by the login module used to access the portal), I get NULL value for each subject s, s1, and s2.
I have found a Netweaver API that may be useful for obtaining the subject:
Object object = com.sap.security.core.InternalUMFactory.getEngineResourceHelper();
if (object != null && object instanceof com.sap.security.core.IEngineResourceHelper) {
com.sap.security.core.IEngineResourceHelper helper =
(com.sap.security.core.IEngineResourceHelper) object;
Subject subject = helper.getCurrentSubject();
A portal application containing this code will display the following:
Subject: Principal: tu-1_basic Principal: com.sap.security.api.logon.AuthSchemePrincipal@19b07b7 Private Credential: GSSCredential: name: [email protected] usage: INITIATE_AND_ACCEPT for mechs: 1.2.840.113554.1.2.2 usage:INITIATE_ONLY 1.2.840.113554.1.2.2.3 usage:INITIATE_AND_ACCEPT underlying Kerberos creds: TGT remaining lifetime = 594 Private Credential: com.sap.security.core.server.jaas.SAPLogonTicketCredential@6a527bdd
However, the class name InternalUMFactory suggests that this API may be undocumented or unstable.
Is there a documented API in Netweaver AS Java for obtaining the JAAS subject?
--Geoff
Hi,
We can use the following API to get the current role:
IWDNavigationHelperService wdNavHelperService =
(IWDNavigationHelperService) WDPortalUtils.getService(IWDNavigationHelperService.KEY);
String navNode = wdNavHelperService.getCurrentNavNode();
Regards,
Ganpati
Similar Messages
-
JAAS: How can I access the JAAS subject in an EJB?
Hello,
I try to understand the JAAS integration in J2EE 1.3.
I know:
J2EE defines a role-based container managed authorization for the web and ejb container. Roles, users and their relationship are defined in the realm.
JAAS has a more sophisticated policy-based authorisation model. Since J2EE1.3 I can define a realm using JAAS having the role-based authorization of the container managed security.
My question:
How can I access the JAAS subject object in an EJB or servlet to use the policy-based authorization?
Thank you for your answers
PeterMay be I should redefine my question:
If I use JAAS as J2EE-Realm, how can I receive the subject?
All JAAS-Tutorials contains code fragments like
LoginContext lc = new LoginContext("entryFoo");
try {
// authenticate the Subject
lc.login();
System.out.println("authentication successful");
// get the authenticated Subject
Subject subject = lc.getSubject();But if I use JAAS as J2EE-Realm the container creates the LoginContext.
Whom can I ask for the subject now?
There is no such method implemented in the EJBContext, the HttpServlet or HttpServletRequest!
Peter -
Error in Jdev while running the "home" page in WebCenter Portal Application
Hi All,
I am using Jdev 11.1.1.6 with WebCenter extensions installed.
I created a WebCenter Portal -Framework Application, in the folders created there is a home page which is giving the below error in Jdev Stack while trying to run it.
Can someone help me how to go ahead from this.
<EclipseLinkLogger> <basicLog> 2012-04-19 16:23:43.067--ServerSession(5023997)--PersistenceUnitInfo ServiceFrameworkPUnit has transactionType RESOURCE_LOCAL and therefore jtaDataSource will be ignored
<LifecycleServletContextListener> <doImportExportSet>
oracle.webcenter.lifecycle.LifecycleException: MDSException while creating an export set import lock
at oracle.webcenter.lifecycle.operation.LockUnit.doImportExportSet(LockUnit.java:359)
at oracle.webcenter.lifecycle.operation.ImportExportSetOperation.doImportExportSet(ImportExportSetOperation.java:106)
at oracle.webcenter.lifecycle.LifecycleService.doImportExportSet(LifecycleService.java:585)
at oracle.webcenter.lifecycle.listener.LifecycleServletContextListener.doImportExportSet(LifecycleServletContextListener.java:361)
at oracle.webcenter.lifecycle.listener.LifecycleServletContextListener.contextInitialized(LifecycleServletContextListener.java:148)
at weblogic.servlet.internal.EventsManager$FireContextListenerAction.run(EventsManager.java:481)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
at weblogic.servlet.internal.EventsManager.notifyContextCreatedEvent(EventsManager.java:181)
at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1872)
at weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:3153)
at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1508)
at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:482)
at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119)
at weblogic.application.internal.flow.ScopedModuleDriver.start(ScopedModuleDriver.java:200)
at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:247)
at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119)
at weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:27)
at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:636)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:205)
at weblogic.application.internal.EarDeployment.activate(EarDeployment.java:58)
at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:161)
at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:79)
at weblogic.deploy.internal.targetserver.operations.AbstractOperation.activate(AbstractOperation.java:569)
at weblogic.deploy.internal.targetserver.operations.ActivateOperation.activateDeployment(ActivateOperation.java:150)
at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doCommit(ActivateOperation.java:116)
at weblogic.deploy.internal.targetserver.operations.AbstractOperation.commit(AbstractOperation.java:323)
at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentCommit(DeploymentManager.java:844)
at weblogic.deploy.internal.targetserver.DeploymentManager.activateDeploymentList(DeploymentManager.java:1253)
at weblogic.deploy.internal.targetserver.DeploymentManager.handleCommit(DeploymentManager.java:440)
at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.commit(DeploymentServiceDispatcher.java:163)
at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doCommitCallback(DeploymentReceiverCallbackDeliverer.java:195)
at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$100(DeploymentReceiverCallbackDeliverer.java:13)
at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$2.run(DeploymentReceiverCallbackDeliverer.java:68)
at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:528)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
Caused by: oracle.mds.exception.ReadOnlyStoreException: MDS-01273: The operation on the resource /oracle/webcenter/lock/exportsetImport/exportsetImport.xml failed because source metadata store mapped to the namespace / DEFAULT is read only.
at oracle.mds.core.MDSSession.checkAndSetWriteStoreInUse(MDSSession.java:2495)
at oracle.mds.core.MDSSession.checkAndSetWriteStoreInUse(MDSSession.java:2548)
at oracle.mds.core.BeanMetadataObject.createInstanceInternal(BeanMetadataObject.java:363)
at oracle.mds.core.BeanMetadataObject.access$000(BeanMetadataObject.java:74)
at oracle.mds.core.BeanMetadataObject$1.run(BeanMetadataObject.java:319)
at java.security.AccessController.doPrivileged(Native Method)
at oracle.mds.core.BeanMetadataObject.createInstance(BeanMetadataObject.java:313)
at oracle.webcenter.lock.schema.jaxb.LockMO.createInstance(LockMO.java:40)
at oracle.webcenter.lock.LockService.createLockDocument(LockService.java:442)
at oracle.webcenter.lock.LockService.createLock(LockService.java:176)
at oracle.webcenter.lifecycle.operation.LockUnit.doImportExportSet(LockUnit.java:336)
... 41 more
<ProfileFactory> <<clinit>>
java.lang.ClassCastException: oracle.webcenter.peopleconnections.profile.config.beans.PeopleconnProfileConfigImpl cannot be cast to oracle.webcenter.peopleconnections.profile.config.beans.PeopleconnProfileConfig
at oracle.webcenter.peopleconnections.profile.ProfileFactory.<clinit>(ProfileFactory.java:113)
at oracle.webcenter.peopleconnections.profile.LifecycleListener.contextInitialized(LifecycleListener.java:76)
at oracle.webcenter.framework.internal.view.WCFrameworkContextListener.contextInitialized(WCFrameworkContextListener.java:354)
at weblogic.servlet.internal.EventsManager$FireContextListenerAction.run(EventsManager.java:481)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
at weblogic.servlet.internal.EventsManager.notifyContextCreatedEvent(EventsManager.java:181)
at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1872)
at weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:3153)
at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1508)
at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:482)
at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119)
at weblogic.application.internal.flow.ScopedModuleDriver.start(ScopedModuleDriver.java:200)
at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:247)
at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119)
at weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:27)
at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:636)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:205)
at weblogic.application.internal.EarDeployment.activate(EarDeployment.java:58)
at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:161)
at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:79)
at weblogic.deploy.internal.targetserver.operations.AbstractOperation.activate(AbstractOperation.java:569)
at weblogic.deploy.internal.targetserver.operations.ActivateOperation.activateDeployment(ActivateOperation.java:150)
at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doCommit(ActivateOperation.java:116)
at weblogic.deploy.internal.targetserver.operations.AbstractOperation.commit(AbstractOperation.java:323)
at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentCommit(DeploymentManager.java:844)
at weblogic.deploy.internal.targetserver.DeploymentManager.activateDeploymentList(DeploymentManager.java:1253)
at weblogic.deploy.internal.targetserver.DeploymentManager.handleCommit(DeploymentManager.java:440)
at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.commit(DeploymentServiceDispatcher.java:163)
at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doCommitCallback(DeploymentReceiverCallbackDeliverer.java:195)
at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$100(DeploymentReceiverCallbackDeliverer.java:13)
at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$2.run(DeploymentReceiverCallbackDeliverer.java:68)
at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:528)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
<ProfileFactory> <getProfileManager> null
<ADFContext> <getCurrent> Automatically initializing a DefaultContext for getCurrent.
Caller should ensure that a DefaultContext is proper for this use.
Memory leaks and/or unexpected behaviour may occur if the automatic initialization is performed improperly.
This message may be avoided by performing initADFContext before using getCurrent().
For more information please enable logging for oracle.adf.share.ADFContext at FINEST level.
<Apr 19, 2012 4:23:43 PM IST> <Warning> <HTTP> <BEA-101162> <User defined listener oracle.webcenter.framework.internal.view.WCFrameworkContextListener failed: java.lang.InstantiationError: ServiceContext resource configuration file "META-INF/context.provider" found, but the class defined "class oracle.webcenter.framework.internal.service.DefaultServiceContext" is not an instance of oracle.webcenter.framework.service.ServiceContext..
java.lang.InstantiationError: ServiceContext resource configuration file "META-INF/context.provider" found, but the class defined "class oracle.webcenter.framework.internal.service.DefaultServiceContext" is not an instance of oracle.webcenter.framework.service.ServiceContext.
at oracle.webcenter.framework.service.ServiceContext.getContext(ServiceContext.java:248)
at oracle.webcenter.peopleconnections.connections.ConnectionsServiceFactory.getInstance(ConnectionsServiceFactory.java:96)
at oracle.webcenter.peopleconnections.connections.LifecycleListener.contextInitialized(LifecycleListener.java:59)
at oracle.webcenter.framework.internal.view.WCFrameworkContextListener.contextInitialized(WCFrameworkContextListener.java:354)
at weblogic.servlet.internal.EventsManager$FireContextListenerAction.run(EventsManager.java:481)
Truncated. see log file for complete stacktrace
>
<WCFrameworkCacheUtils> <createRegion> cannot access Java Object Cache
<PortletServletContextListener> <contextDestroyed> MBean deregistration problem
INFO: Found persistence provider "org.eclipse.persistence.jpa.PersistenceProvider". OpenJPA will not be used.
INFO: Found persistence provider "org.eclipse.persistence.jpa.PersistenceProvider". OpenJPA will not be used.
<ProfileFactory> <getProfileManager> null
<LifecycleListener> <contextDestroyed> java.lang.NullPointerException
<BPELConnectionUtil> <getWorklistConnections> The Worklist service does not have a ConnectionName configuration entry in adf-config.xml that maps to a BPELConnection in connections.xml, therefore the Worklist service was not configured for this application.
<ADFContext> <getCurrent> Automatically initializing a DefaultContext for getCurrent.
Caller should ensure that a DefaultContext is proper for this use.
Memory leaks and/or unexpected behaviour may occur if the automatic initialization is performed improperly.
This message may be avoided by performing initADFContext before using getCurrent().
For more information please enable logging for oracle.adf.share.ADFContext at FINEST level.
<Apr 19, 2012 4:23:43 PM IST> <Warning> <HTTP> <BEA-101162> <User defined listener oracle.webcenter.framework.internal.view.WCFrameworkContextListener failed: java.lang.InstantiationError: ServiceContext resource configuration file "META-INF/context.provider" found, but the class defined "class oracle.webcenter.framework.internal.service.DefaultServiceContext" is not an instance of oracle.webcenter.framework.service.ServiceContext..
java.lang.InstantiationError: ServiceContext resource configuration file "META-INF/context.provider" found, but the class defined "class oracle.webcenter.framework.internal.service.DefaultServiceContext" is not an instance of oracle.webcenter.framework.service.ServiceContext.
at oracle.webcenter.framework.service.ServiceContext.getContext(ServiceContext.java:248)
at oracle.webcenter.peopleconnections.connections.ConnectionsServiceFactory.getInstance(ConnectionsServiceFactory.java:96)
at oracle.webcenter.peopleconnections.connections.LifecycleListener.contextDestroyed(LifecycleListener.java:83)
at oracle.webcenter.framework.internal.view.WCFrameworkContextListener.contextDestroyed(WCFrameworkContextListener.java:203)
at weblogic.servlet.internal.EventsManager$FireContextListenerAction.run(EventsManager.java:482)
Truncated. see log file for complete stacktrace
Regards, Suma EmaniDo you have any space in jdeveloper workspace directory ?
i.e C:\Document and settings like path.
Also mention the default integrated domain's path.
If any space is present then create a new domain and workspace without containing any space and run your application.
Regards,
Hoque -
How do I get the JAAS Subject for an authenticated user?
Hi
I searched through the site, but didn't find anything useful.
I came across many instances of using the javax.security.auth.login.LoginContext
to get the Subject, but am not sure how to get a handle for it, after the login process is completed and the usre is authenticated.
RG.WLS has a static method for returning the javax.security.auth.Subject :
http://e-docs.bea.com/wls/docs81/javadocs/weblogic/security/Security.html#getCurrentSubject() -
Obtaining JAAS subject in a servlet.
G'day,
There are problems in Java with getting the JAAS subject, as the standard Subject.getSubject() call can return null if called within a privileged action:
Subject s = Subject.getSubject(AccessController.getContext());
Subject.doAs(s, new PrivilegedAction() {
public Object run() {
Subject s1 = Subject.getSubject(AccessController.getContext());
AccessController.doPrivileged(new PrivilegedAction() {
public Object run() {
Subject s2 = Subject.getSubject(AccessController.getContext());
return null;
return null;
Here, s2 may be null, which is why other app servers have custom approaches (such as JBoss and its SecurityAssociation.getSubject() call).
Is there a similar API for Netweaver AS Java for obtaining the JAAS subject? Or can the JAAS subject be obtained always using the standard Java API?
Edit I put the above code into a servlet protected by BasicLoginModule, and all three subject objects (s, s1, and s2) were null. I thought that at least 's' would be non-null, but apparently not.
--GeoffG'day,
Thanks for the link to the JAAS login module section of the SAP Library documentation.
I have already written a custom JAAS login module (which populates a subject with principals and their credentials), but I am looking for the Netweaver equivalent of JBoss's SecurityAssociation.getSubject() that can be called from any code. I did not find anything suitable while searching through the SAP Library documentation.
However, I did stumble upon an API that might be useful:
Object object = com.sap.security.core.InternalUMFactory.getEngineResourceHelper();
if (object != null && object instanceof com.sap.security.core.IEngineResourceHelper) {
com.sap.security.core.IEngineResourceHelper helper =
(com.sap.security.core.IEngineResourceHelper) object;
Subject subject = helper.getCurrentSubject();
The class name InternalUMFactory suggests that this API may be undocumented or unstable.
If I have a servlet protected by the BasicLoginModule, and I authenticate to the servlet using a username/password, then the subject returned is a principal with the correct username, and with password credentials.
If the servlet is not protected by a login module, then the subject returned is "Guest".
If I put the servlet as an iView within a portal, then the subject returned is "Guest", even though the portal is protected by a login module and authentication is required. I thought here that the Subject for the portal would be propogated to the servlets running in that portal, but maybe my understanding is wrong.
--Geoff -
Runtime Error in Portal Application
Can any body help me in resolving the following runtime error in portal application, (Netweaver Version : 7.0)
Full Message Text
03:21_21/09/11_0002_6275851
[EXCEPTION]
java.lang.NoClassDefFoundError: org.apache.commons.httpclient.methods.RequestEntity
at java.lang.J9VMInternals.verifyImpl(Native Method)
at java.lang.J9VMInternals.verify(J9VMInternals.java:69)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:131)
at java.lang.Class.forNameImpl(Native Method)
at java.lang.Class.forName(Class.java:152)
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:271)
at com.sapportals.portal.prt.core.broker.PortalComponentContextItem.getContext(PortalComponentContextItem.java:316)
at com.sapportals.portal.prt.component.PortalComponentRequest.getComponentContext(PortalComponentRequest.java:387)
at com.sapportals.portal.prt.connection.PortalRequest.getRootContext(PortalRequest.java:488)
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:540)
at java.security.AccessController.doPrivileged(AccessController.java:246)
at com.sapportals.portal.prt.dispatcher.Dispatcher.service(Dispatcher.java:423)
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(AccessController.java:219)
at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:104)
at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:176)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.httpclient.methods.RequestEntity
Found in negative cacheHi,
this exception seems caused by a missing interface org.apache.commons.httpclient.methods.RequestEntity. Please the following ones:
http://www.jarfinder.com/index.php/java/info/org.apache.commons.httpclient.methods.RequestEntity
Br,
Javier -
XML News content modification problem in Portal application
Hi,
We are trying to update the xml news content in Portal application with KM API.
We are getting following exception while updating the content.
javax.xml.transform.TransformerException: Namespace fixup failed. Prefix 'xsi' used in attribute 'xsi:noNamespaceSchemaLocation' is not declared anywhere
Please let me know what's to be done
ThanksHello,
I faced the same problem in a similar implementation: Message "Namespace fixup failed. Prefix 'xsi' used in attribute 'xsi:noNamespaceSchemaLocation' is not declared anywhere".
When looking at the attributes of the org.w3c.dom.Document, I saw that the namespace URI of xsi was already null after parsing.
The solution which made it work for me was
factory.setNamespaceAware(true);
before parsing the XML text. The URI of xsi was then the one provided by the document.
P.S.: Unfortunately, the error message did not pop up in this test code:
package mytests;
import java.io.StringReader;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.transform.Result;
import javax.xml.transform.Source;
import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
import junit.framework.TestCase;
import org.w3c.dom.Document;
import org.xml.sax.InputSource;
import com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl;
public class XmlFormsHelperTest2 extends TestCase {
Document doc;
String xmldoc =
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
+ "<News_Header_v2 xmlns:xf=\"http://www.sapportals.com/wcm/app/xmlforms\" xmlns:xsi=\"http//www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"/etc/xmlforms/News_Header_v2/btexx_News_Header_v2-Schema.xml\">"
+ "<text>This is the main text</text>" + "</News_Header_v2>";
protected void setUp() throws Exception {
super.setUp();
public void testToDoc() throws Exception {
Document doc = setupDocumentSap(xmldoc);
assertEquals("News_Header_v2", doc.getDocumentElement().getTagName());
assertEquals("This is the main text", doc.getDocumentElement().getFirstChild().getTextContent());
public void testFromDoc() throws Exception {
Document doc = setupDocumentSap(xmldoc);
String actual = xmlToString(doc);
assertEquals(xmldoc, actual);
private Document setupDocument(String xmltext) throws Exception {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setValidating(false);
factory.setCoalescing(true);
DocumentBuilder builder = factory.newDocumentBuilder();
return builder.parse(new InputSource(new StringReader(xmltext)));
private Document setupDocumentSap(String xmltext) throws Exception {
DocumentBuilderFactory factory = new DocumentBuilderFactoryImpl();
factory.setValidating(false);
factory.setCoalescing(true);
//factory.setNamespaceAware(true);
DocumentBuilder builder = factory.newDocumentBuilder();
return builder.parse(new InputSource(new StringReader(xmltext)));
public static String xmlToString(Document xmlDocument) throws Exception {
Source xmlSource = new DOMSource(xmlDocument);
StringWriter stringWriter = new StringWriter();
Result outputTarget = new StreamResult(stringWriter);
TransformerFactory.newInstance().newTransformer().transform(xmlSource, outputTarget);
return stringWriter.getBuffer().toString(); -
Loading LDAP groups into WLS JAAS Subject
Hi,
I have a 10.1.4.3 OAM webgate+OHS setup to protect weblogic 10.3.2 as described ('1st best option') in this blog below.
http://fusionsecurity.blogspot.com/2010/01/integrating-oracle-access-manager-oam.html
In the weblogic security realm, I have the OAM Identity Asserter (REQUIRED), OID Authentication Provider (SUFFICIENT), Default Authenticator (SUFFICIENT), Default Identity Asserter configured in that order.
A simple JSP app with CLIENT-CERT is deployed to the WLS. After the user is authenticated at OHS Webgate, the OAM Identity asserter is correctly asserting the user (and the obSSOCookie) as can be seen from the logs. The JSP app is getting a valid (non-anoymous) JAAS Subject with a single JAAS principal (of the user).
But I 'm not sure it is loading the LDAP groups correctly using the OID provider. Are the LDAP groups supposed to be loaded as principals into the JAAS Subject? The user is part of many LDAP groups but only one principal (user itself) is in the JAAS Subject. Are there any additional steps to 'pair' the OAM Identity Asserter with the OID authentication provider as described in the above blog?
I 'm using weblogic.security.Security.getCurrentSubject() to get the Subject and subject.getPrincipals() to get the principals in the JSP app.
Thanks.Like I said in my post, subject.getPrincipals() has only one entry, the user id. The LDAP groups aren't in the Set returned. I 'm wondering how to debug this or fix it. I 'm wondering if I need to re-associate the domain policy store with LDAP as described here before the LDAP groups will be loaded into the subject.
http://download.oracle.com/docs/cd/E14571_01/core.1111/e10043/cfgauthr.htm#CHDIIJDB -
How can I debug portal application?
What is the best IDE for developing portal application? So this IDE allows to debug
portal programs. Because a portal application is enterprise application, EJB will
possibly be used as business components. What IDE allows to not only degug components
that are reside in web container such as JSP and InputProcessor components but
also debug pipeline components that are reside in Enterprise Java Bean (EJB) container.
Many thanks!
PennyMy suggestion is to learn and use a logging framework in your enterprise
applications instead of relying on a debugger. (we use log4j and the
jakarta log tag library). This will also make maintenance and support of
your application much easier. It also is very usefull after deployment,
allowing you to configure it on the fly.
We like intellij very much (I think they have a sale on their personal
licenses going $200/each). Not for debugging, which it can do, but for ant
integration and its huge EJB and web application support. It can do things
like code completion and refactoring even in JSP pages. It is the only IDE
I've found that is very powerful but also gets out of your way and doesn't
impose its standards on your project.
Of course, when you ask for the best IDE you'll get many opinions.
"Penny" <[email protected]> wrote in message
news:[email protected]..
>
What is the best IDE for developing portal application? So this IDE allowsto debug
portal programs. Because a portal application is enterprise application,EJB will
possibly be used as business components. What IDE allows to not only degugcomponents
that are reside in web container such as JSP and InputProcessor componentsbut
also debug pipeline components that are reside in Enterprise Java Bean(EJB) container.
>
Many thanks!
Penny -
Webcenter Portal Application Performance improvement
Hi All,
We are using jdeveloper version 11.1.1.6.0.
We are using weblogic server 11g.
We have deployed webcenter portal application on it.
Want to know how to improve performance of the web application.
What are the ways to improve performance factorgenerally you need to look into all the areas individually inside webcenter portal application to increase the performance of your application,
check the below links and see if you can follow and implement,
http://download.oracle.com/docs/cd/E14571_01/core.1111/e10108/adf.htm
http://download.oracle.com/docs/html/B25947_01/bcadvvo002.htm#sm0342
http://www.oracle.com/technetwork/developer-tools/jdev/introduction-best-practices-131743.pdf
http://technology.amis.nl/blog/1385/worst-practices-when-using-oracle-jdbc-drivers
http://download.oracle.com/docs/cd/E11035_01/wls100/perform/topten.html
http://download.oracle.com/docs/cd/E13222_01/wls/docs92/perform/WLSTuning.html
http://download.oracle.com/docs/cd/E16764_01/core.1111/e10108/toc.htm
http://download.oracle.com/docs/html/B25947_01/bcadvvo002.htm#sm0342
http://amulyamishras-tech-blog.blogspot.com/2011/04/fine-tune-adf-faces-ui-layerperformance.html
http://andrejusb.blogspot.com/2009/08/oracle-adf-tuning-preventing-sql-query.html
http://andrejusb.blogspot.com/2011/01/adf-11g-performance-tuning-select-one.html -
Error while running the portal application
Hi All,
I have made one sample portal application in Sun Java Studio Enterprise 8.When I build this application it is successfully build.Now when I start the server of Sun Java Studio Enterprise 8 and try to run the project ,the browser opens and gives the following error::
HTTP Status 404 - /portlet/
type Status report
message /portlet/
description The requested resource (/portlet/) is not available.
Sun-Java-System/Application-Server
If anyone having idea about this problem then please let me know.All suggestions are welcome.
Thanx and Regards,
Chirag.OK, so they are not in the mood for posting on the forum today :-)
They suggest three things.
1) Restart the server. Deploying a portlet requires some configuration changes, which will take effect only after the server is restarted. Thus if it failed to restart due to some reason...
2) Try deleting the JSE userdir and trying again.
3) If the above two items do not help. Start the studio with the following command:runide.exe -J-Dcom.sun.tools.ide.portletbuilder.log=log,info try the deployment and either post here or email the output which will be output to the console.
HTH,
Kirill -
How to get the source code of a PRT application in the portal
Hi!
Does anybody know how to get the source code of a PRT application in the portal?
Thanks in advance,
CelsoCelso,
If its Java-based code have a look at the properties of an iView that belongs to the application in question and copy the value of the Code Link parameter e.g. 'com.sap.pct.hcm.rc_vacancyrequestov.default'.
Search the Portal installation directory under /j233/cluster/server/ for a .par.bak file of the same name, removing .default from the codelink parameter
e.g. com.sap.pct.hcm.rc_vacancyrequestov.par.bak
Copt this locally and import into Netweaver Developer Studio. You will have to decompilte the class files with a decompiler such as DJ Decompiler or Cavaj (search with Google).
Cheers,
Steve -
Remote enabled FM for the Portal application
Dear all,
I need to develop a Remote enabled FM for the Portal application. The requirement is to pass the output( few fileds) of MC.1 Transaction to the portal.The issue is whether to write our own logic in the function module or is there any alternative way.
The input is same as for the std tarnsaction MC.1
Thanks
KumarYes you will have to create a Z function module.
Instead of declaring the function module as normal function module in the attributes tab, mention it as remote function module.
Also when giving import and export parameters select the pass value check box.
This might solve your query.
Thanks & Regards,
Lalit Mohan Gupta. -
How to read xml file present in the UCMS from webcenter portal application
Hi,
I'm new to webcenter portal and would like to know how to read an xml file which is present in UCMS 11g(contributors folder) from webcenter portal application.
Thanks in advanceI guess I had mentioned that I want to read it via my webcenter portal app rather than login to ucms and searching it via url.
I want text labels and button names being stored in the xml file which I'm going to keep in the UCMS.
After reading that from the xml will be placed at appropriate locations like the button values and label feilds, so that we dont need to deploy entire app for this kind of simple changes.
Now can anyone provide some help with the api's related to this? -
Debugging the portal application
Hi all,
It is possible to debug the portal application.
If yes how.
Regards,
Aravindhan.RHi Aravindhan,
Check out this link
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/com.sap.km.cm.docs/lw/developercontent/sap%20portal%20development%20kit%20for%20.net%20developer's%20Guide/Previewing%20and%20Debugging%20Portal%20Applications_Debugging%20Portal%20Applications.html
Also do not forgot to set iViewProcessorService property, ProductionMode to false.
Regards,
Ashutosh
Maybe you are looking for
-
Reading files from local hard disk - Access Local Files Only
Hi All, I have a local flash file published as 'Access Local Files Only', to allow me to read from local filesystem. What methods or classes can I use to read text and other files from the user's harddisk. This is the first time I am trying to do som
-
Paid for (not from Itunes store) music downloaded not showing up in library as usual. Imported CD also not appearing as usual. What gives?
-
Read web page content via Sockets
Hey, I have to write a program that will read web page content, using sockets. I got that piece of code and it works for most pages: Socket socket = new Socket(address, 80); BufferedReader input = new BufferedReader(
-
Automatic receipt print of an online order
I have a web application developed using jsp/servlets. It is a website for customers to order food online from a restaurant. The customer orders the dishes and pays online and submits the order. What I want is, that when the customer submits the orde
-
Error in forwarding to other jsp page
HI , I am trying to move from one page to other page by using jsp:forward. I get the following error. what might be the problem. java.lang.NullPointerException at org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:688) at org.ap