Friday, February 8, 2013

Propagation Timeout Exception

Problem: While running propagation on WebLogic Portal, it is timing out after 1 Hour/ 3600 seconds.

Error Stack Trace:

Caused By: javax.ejb.EJBException: nested exception is: javax.ejb.EJBException: SQL Error while performing get operation on portlet instance: SQL [select DEF.MARKUP_DEFINITION_ID, DEF.IS_FORKABLE, INST.INTERSECTION_ID, DEF.PORTLET_LABEL, INST.PORTLET_LABEL, DEF.CONTENT_URI, DEF.BACKING_FILE, DEF.IS_PUBLIC, INST.PORTLET_DEFINITION_ID, INST.THEME_DEFINITION_ID, INST.TITLE_BAR_ORIENTATION, INST.DEFAULT_MINIMIZED, INST.INSTANCE_TYPE, INST.PARENT_PORTLET_INSTANCE_ID, DEF.FORK_RENDER, DEF.IS_CACHEABLE, DEF.CACHE_EXPIRES, DEF.PORTLET_FILE, DEF.IS_PORTLET_FILE_DELETED, DEF.HELP_URI, DEF.EDIT_URI, DEF.WEBAPP_NAME, INST.CREATION_DATE, INST.MODIFIED_DATE, DEF.CREATION_DATE, DEF.MODIFIED_DATE, PPV.PRODUCER_HANDLE, PPV.PORTLET_HANDLE, PPV.PORTLET_STATE_CHANGE, PPV.REQUIRES_URL_TEMPLATES, PPV.TEMPLATES_STORED_IN_SESSION, PPV.PORTLET_STATE, PPV.IS_PRODUCER_OFFERED, INST.TITLE_KEY from PF_PORTLET_DEFINITION DEF, PF_PORTLET_INSTANCE INST left outer join PF_PROXY_PORTLET_INSTANCE_V PPV on PPV.PORTLET_INSTANCE_ID = INST.PORTLET_INSTANCE_ID where INST.PORTLET_INSTANCE_ID = ? and DEF.PORTLET_DEFINITION_ID = INST.PORTLET_DEFINITION_ID] portletInstanceId [1,456,041] database error code [0] SQL state [null].; nested exception is: java.sql.SQLException: The transaction is no longer active - status: 'Marked rollback. [Reason=weblogic.transaction.internal.TimedOutException: Transaction timed out after 36002 seconds 
BEA1-5C8E244BF578F5B2D7B1]'. No further JDBC access is allowed within this transaction.
at com.bea.netuix.application.manager.persistence.jdbc.ExportImportManagerImpl.updateDesktopView(ExportImportManagerImpl.java:144)
at com.bea.netuix.application.manager.persistence.jdbc.ExportImportManager_7mrwg_EOImpl.updateDesktopView(ExportImportManager_7mrwg_EOImpl.java:366)
at com.bea.propagation.netuix.online.util.PortalXIPHelper.importDesktop(PortalXIPHelper.java:292)
at com.bea.propagation.netuix.online.util.PortalXIPHelper.addOrUpdateDesktopDefinitionInternal(PortalXIPHelper.java:254)
at com.bea.propagation.netuix.online.util.PortalXIPHelper.addDesktopDefinition(PortalXIPHelper.java:193)
at com.bea.propagation.netuix.online.util.PortalXIPHelper.updateDesktopDefinition_Standard(PortalXIPHelper.java:211)
at com.bea.propagation.netuix.online.updater.PortalDesktopDefnNodeUpdater.updateNode(PortalDesktopDefnNodeUpdater.java:123)
at com.bea.propagation.framework.tool.resolver.TreeResolver.processUpdate(TreeResolver.java:868)
at com.bea.propagation.framework.tool.resolver.TreeResolver.processElectionsIterative(TreeResolver.java:509)
at com.bea.propagation.framework.tool.resolver.TreeResolver.processElections(TreeResolver.java:408)
at com.bea.propagation.framework.tool.resolver.TreeResolver.resolveTree(TreeResolver.java:317)
at com.bea.propagation.framework.tool.servlet.InventoryManagementServlet.commitOperation(InventoryManagementServlet.java:816)
at com.bea.propagation.framework.tool.servlet.InventoryManagementServlet.doOperation(InventoryManagementServlet.java:301)
at com.bea.propagation.framework.tool.servlet.InventoryManagementServlet.doPost(InventoryManagementServlet.java:201)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:821)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:57)
at com.bea.p13n.servlets.PortalServletFilter.doFilter(PortalServletFilter.java:338)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:57)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3592)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2202)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2108)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1432)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)


Main cause: 
Since the propagation is running more than one hour (predefined timeout limit), it is getting timeout after one hour and transactions are being rolled back.

Other possible reasons:
Propagating between two domains which are separated by a firewall, could result in increased time for transactions going over the firewall. Firewall could consume as much as 400% time of actual propagation transactions depending upon the network configurations in enterprise environments. 

Proposed solutions:
Solution 1. Scope the propagation and/or use policy file for propagation to complete within 1 Hour.
Solution 2. Remove the firewall between the propagation domains (source and target), this may or may not save significant amount of time during propagation transactions.
Solution 3. Increase the transaction time out for propagation itself - this requires little more work, details to follow in upcoming posts.

These are the few possible solutions, there could be more like changing the way propagation works e.g. change the proliferation mode to ASYNC or OFF or so.

Tuesday, October 16, 2012

How to use Spring inside Struts Actions?

Spring can be integrated into Struts actions to take advantage of seamless bean findings, here is how:
Step 1: 
Create a BaseAction class and extend this class to create struts actions.
 
BaseAction.java (add spring-webmvc-struts.jar to web-inf/lib)
 
import org.springframework.web.struts.DispatchActionSupport;
public class BaseAction extends DispatchActionSupport {
 protected Object getBean(String name) {
  return getWebApplicationContext().getBean(name);
 }
} 
 
Step 2: Action class sample: 
BalanceAction.java 
public class BalanceAction extends BaseAction {
 @Override
 public ActionForward execute(ActionMapping mapping, ActionForm form,
   HttpServletRequest request, HttpServletResponse response)
   throws Exception {
  try {
   BeanService handle = (BeanService)getBean("BeanName");
   handle.businessMethod();
  } catch (Exception ex) {
   System.out.println("Cannot find the bean...");
  }
  return mapping.findForward("success");
 }
}

Maven Build Script setup for various configurations

Steps to include a jar in the EAR package while building:
Scenario 1. If the jar project is part of same EAR project heirarchy and need to build before packaging
Follow the steps given here:
step1: Add plugin maven-ear-plugin
step2: Add <configuration> block, add <modules> as follows:
 <configuration>
  <modules>
   <javaModule>
    <groupId>myProjectGroup</groupId>
    <artifactId>myArtifact</artifactId>
    <bundleFileName>myArtifact-x.0.jar</bundleFileName>
    <bundleDir>[Destination-Path]</bundleDir>
   </javaModule>
  </modules>
 </configuration>
Step3: Add the dependency as follows:
 <dependency>
  <groupId>myProjectGroup</groupId>
  <artifactId>myArtifact</artifactId>
  <version>x.0</version>
  <type>jar</type>
 </dependency>
Note: Don't specify the <bundleDir> if you want the jar file to go to default folder.

Scenario 2. If the jar is external and not part of EAR project heirarchy
Follow the steps given here:
step1: Add plugin maven-ear-plugin
step2: Add <configuration> block, add <modules> as follows:
 <configuration>
  <modules>
   <javaModule>
    <groupId>externalGroup</groupId>
    <artifactId>externalJarArtifact</artifactId>
    <bundleFileName>externalJarArtifact-x.0.jar</bundleFileName>
    <bundleDir>[Destination-Path]</bundleDir>
   </javaModule>
  </modules>
 </configuration>
Step3: Add the dependency as follows:
 <dependency>
  <groupId>externalGroup</groupId>
  <artifactId>externalJarArtifact</artifactId>
  <version>x.0</version>
  <scope>system</scope>
  <systemPath>[external-jar-local-path]/externalJarArtifact-x.0.jar</systemPath>
 </dependency>
Note: Don't specify the <bundleDir> if you want the jar file to go to default folder.

Is it the right time to buy a home or rent ?

To analyze whether you should buy a home now or still rent it depends on so many factors including:
- How long you will live in the home?
- How big you want the home?
- How much you can afford?
- What is the market trend?
- How much rent you are paying?
- Property tax
- Mortgage rate

You can analyze here http://www.ginniemae.gov/

Monday, October 15, 2012

Deployment Error while publishing application in OEPE, WebLogic Portal 10.3.4

[HTTP:101216]Servlet: "wsrp-1.0-ServiceDescriptionPortComponent"
Exception Stack Trace:
weblogic.application.ModuleException: [HTTP:101216]Servlet: "wsrp-1.0-ServiceDescriptionPortComponent" failed to preload on startup in Web application: "portalWeb".java.lang.NullPointerException

at weblogic.wsee.monitoring.WseeBaseRuntimeMBeanImpl.unregisterPorts(WseeBaseRuntimeMBeanImpl.java:285)
at weblogic.wsee.monitoring.WseeBaseRuntimeMBeanImpl.unregister(WseeBaseRuntimeMBeanImpl.java:255)
at weblogic.wsee.monitoring.WseeV2RuntimeMBeanImpl.unregister(WseeV2RuntimeMBeanImpl.java:14)
at weblogic.management.runtime.RuntimeMBeanDelegate.unregisterChildren(RuntimeMBeanDelegate.java:350)
at weblogic.management.runtime.RuntimeMBeanDelegate.unregister(RuntimeMBeanDelegate.java:274)
at weblogic.wsee.ws.WsRegistry$1.run(WsRegistry.java:325)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
at weblogic.wsee.ws.WsRegistry.unregisterMBean(WsRegistry.java:321)
at weblogic.wsee.ws.WsRegistry.unregisterMBean(WsRegistry.java:300)
at weblogic.wsee.deploy.DeployInfo.createWsPort(DeployInfo.java:381)
at weblogic.wsee.server.servlet.BaseWSServlet.init(BaseWSServlet.java:83)
at javax.servlet.GenericServlet.init(GenericServlet.java:241)
at weblogic.servlet.internal.StubSecurityHelper$ServletInitAction.run(StubSecurityHelper.java:283)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
at weblogic.servlet.internal.StubSecurityHelper.createServlet(StubSecurityHelper.java:64)
at weblogic.servlet.internal.StubLifecycleHelper.createOneInstance(StubLifecycleHelper.java:58)
at weblogic.servlet.internal.StubLifecycleHelper.(StubLifecycleHelper.java:48)
at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:539)
at weblogic.servlet.internal.WebAppServletContext.preloadServlet(WebAppServletContext.java:1985)
at weblogic.servlet.internal.WebAppServletContext.loadServletsOnStartup(WebAppServletContext.java:1959)
at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1878)
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:207)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:176)

java.lang.Exception: Exception received from deployment driver. See Error Log view for more detail.
at oracle.eclipse.tools.weblogic.server.internal.DeploymentProgressListener.watch(DeploymentProgressListener.java:190)
at oracle.eclipse.tools.weblogic.server.internal.WlsJ2EEDeploymentHelper.redeploy(WlsJ2EEDeploymentHelper.java:893)
at oracle.eclipse.tools.weblogic.server.internal.WlsJ2EEDeploymentHelper.redeploy(WlsJ2EEDeploymentHelper.java:762)
at oracle.eclipse.tools.weblogic.server.internal.WeblogicServerBehaviour.publishWeblogicModules(WeblogicServerBehaviour.java:1430)
at oracle.eclipse.tools.weblogic.server.internal.WeblogicServerBehaviour.publishToServer(WeblogicServerBehaviour.java:861)
at oracle.eclipse.tools.weblogic.server.internal.WeblogicServerBehaviour.publishOnce(WeblogicServerBehaviour.java:655)
at oracle.eclipse.tools.weblogic.server.internal.WeblogicServerBehaviour.publish(WeblogicServerBehaviour.java:522)
at org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publish(ServerBehaviourDelegate.java:775)
at org.eclipse.wst.server.core.internal.Server.publishImpl(Server.java:2889)
at org.eclipse.wst.server.core.internal.Server$PublishJob.run(Server.java:337)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Caused by: weblogic.application.ModuleException: [HTTP:101216]Servlet: "wsrp-1.0-ServiceDescriptionPortComponent" failed to preload on startup in Web application: "portalWeb".
java.lang.NullPointerException
at weblogic.wsee.monitoring.WseeBaseRuntimeMBeanImpl.unregisterPorts(WseeBaseRuntimeMBeanImpl.java:285)
at weblogic.wsee.monitoring.WseeBaseRuntimeMBeanImpl.unregister(WseeBaseRuntimeMBeanImpl.java:255)
at weblogic.wsee.monitoring.WseeV2RuntimeMBeanImpl.unregister(WseeV2RuntimeMBeanImpl.java:14)
at weblogic.management.runtime.RuntimeMBeanDelegate.unregisterChildren(RuntimeMBeanDelegate.java:350)
at weblogic.management.runtime.RuntimeMBeanDelegate.unregister(RuntimeMBeanDelegate.java:274)
at weblogic.wsee.ws.WsRegistry$1.run(WsRegistry.java:325)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
at weblogic.wsee.ws.WsRegistry.unregisterMBean(WsRegistry.java:321)
at weblogic.wsee.ws.WsRegistry.unregisterMBean(WsRegistry.java:300)
at weblogic.wsee.deploy.DeployInfo.createWsPort(DeployInfo.java:381)
at weblogic.wsee.server.servlet.BaseWSServlet.init(BaseWSServlet.java:83)
at javax.servlet.GenericServlet.init(GenericServlet.java:241)
at weblogic.servlet.internal.StubSecurityHelper$ServletInitAction.run(StubSecurityHelper.java:283)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
at weblogic.servlet.internal.StubSecurityHelper.createServlet(StubSecurityHelper.java:64)
at weblogic.servlet.internal.StubLifecycleHelper.createOneInstance(StubLifecycleHelper.java:58)
at weblogic.servlet.internal.StubLifecycleHelper.(StubLifecycleHelper.java:48)
at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:539)
at weblogic.servlet.internal.WebAppServletContext.preloadServlet(WebAppServletContext.java:1985)
at weblogic.servlet.internal.WebAppServletContext.loadServletsOnStartup(WebAppServletContext.java:1959)
at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1878)
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:207)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:176)

at weblogic.wsee.monitoring.WseeBaseRuntimeMBeanImpl.unregisterPorts(WseeBaseRuntimeMBeanImpl.java:285)
at weblogic.wsee.monitoring.WseeBaseRuntimeMBeanImpl.unregister(WseeBaseRuntimeMBeanImpl.java:255)
at weblogic.wsee.monitoring.WseeV2RuntimeMBeanImpl.unregister(WseeV2RuntimeMBeanImpl.java:14)
at weblogic.management.runtime.RuntimeMBeanDelegate.unregisterChildren(RuntimeMBeanDelegate.java:350)
at weblogic.management.runtime.RuntimeMBeanDelegate.unregister(RuntimeMBeanDelegate.java:274)
at weblogic.wsee.ws.WsRegistry$1.run(WsRegistry.java:325)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
at weblogic.wsee.ws.WsRegistry.unregisterMBean(WsRegistry.java:321)
at weblogic.wsee.ws.WsRegistry.unregisterMBean(WsRegistry.java:300)
at weblogic.wsee.deploy.DeployInfo.createWsPort(DeployInfo.java:381)
at weblogic.wsee.server.servlet.BaseWSServlet.init(BaseWSServlet.java:83)
at javax.servlet.GenericServlet.init(GenericServlet.java:241)
at weblogic.servlet.internal.StubSecurityHelper$ServletInitAction.run(StubSecurityHelper.java:283)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
at weblogic.servlet.internal.StubSecurityHelper.createServlet(StubSecurityHelper.java:64)
at weblogic.servlet.internal.StubLifecycleHelper.createOneInstance(StubLifecycleHelper.java:58)
at weblogic.servlet.internal.StubLifecycleHelper.(StubLifecycleHelper.java:48)
at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:539)
at weblogic.servlet.internal.WebAppServletContext.preloadServlet(WebAppServletContext.java:1985)
at weblogic.servlet.internal.WebAppServletContext.loadServletsOnStartup(WebAppServletContext.java:1959)
at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1878)
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:207)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:176)
at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1510)
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:207)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:176)
Caused by: java.lang.NullPointerException:
at weblogic.wsee.monitoring.WseeBaseRuntimeMBeanImpl.unregisterPorts(WseeBaseRuntimeMBeanImpl.java:285)
at weblogic.wsee.monitoring.WseeBaseRuntimeMBeanImpl.unregister(WseeBaseRuntimeMBeanImpl.java:255)
at weblogic.wsee.monitoring.WseeV2RuntimeMBeanImpl.unregister(WseeV2RuntimeMBeanImpl.java:14)
at weblogic.management.runtime.RuntimeMBeanDelegate.unregisterChildren(RuntimeMBeanDelegate.java:350)
at weblogic.management.runtime.RuntimeMBeanDelegate.unregister(RuntimeMBeanDelegate.java:274)
at weblogic.wsee.ws.WsRegistry$1.run(WsRegistry.java:325)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
at weblogic.wsee.ws.WsRegistry.unregisterMBean(WsRegistry.java:321)
at weblogic.wsee.ws.WsRegistry.unregisterMBean(WsRegistry.java:300)
at weblogic.wsee.deploy.DeployInfo.createWsPort(DeployInfo.java:381)
at weblogic.wsee.server.servlet.BaseWSServlet.init(BaseWSServlet.java:83)
at javax.servlet.GenericServlet.init(GenericServlet.java:241)
at weblogic.servlet.internal.StubSecurityHelper$ServletInitAction.run(StubSecurityHelper.java:283)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
at weblogic.servlet.internal.StubSecurityHelper.createServlet(StubSecurityHelper.java:64)
at weblogic.servlet.internal.StubLifecycleHelper.createOneInstance(StubLifecycleHelper.java:58)
at weblogic.servlet.internal.StubLifecycleHelper.(StubLifecycleHelper.java:48)
at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:539)
at weblogic.servlet.internal.WebAppServletContext.preloadServlet(WebAppServletContext.java:1985)
at weblogic.servlet.internal.WebAppServletContext.loadServletsOnStartup(WebAppServletContext.java:1959)
at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1878)
at weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:3153)
at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1508)

My Observations:
Most of the time I have run into this exception because I have modified resources (JSP, portlet, portal, java etc.) and compiled and tried to publish the application changes through OEPE.

Solution:
If you application compiles fine and does not throw any build errors, you should be able to do another publish and it should publish like a snap without any error. Try two to three times - you should be good.

If you are still facing this error, try removing the project from the server, build, compile again and add the project to the server - publish again.

Monday, September 24, 2012

Difference between SID and Service for WLST Config


How to define a datasource in Oracle WebLogic WLST Configuration

For a SID:
<attribute name="Url" value="jdbc:oracle:thin:@hostname:1521:SID" />

For a Service:
<attribute name="Url" value="jdbc:oracle:thin:@hostname:1521/Service" />

Monday, September 10, 2012

javax.security.auth.callback.UnsupportedCallbackException: [Security:090175]

Application throwing Unrecognized Callback exception when connecting through t3:
javax.security.auth.callback.UnsupportedCallbackException: [Security:090175]Unrecognized Callback com.abc.def.security.identityassertion.DramaCallback@32a4755]
at weblogic.jndi.internal.ExceptionTranslator.toNamingException(ExceptionTranslator.java:44)
at weblogic.jndi.WLInitialContextFactoryDelegate.toNamingException(WLInitialContextFactoryDelegate.java:788)
at weblogic.jndi.WLInitialContextFactoryDelegate.pushSubject(WLInitialContextFactoryDelegate.java:675)
at weblogic.jndi.WLInitialContextFactoryDelegate.newContext(WLInitialContextFactoryDelegate.java:469)
at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialContextFactoryDelegate.java:376)
at weblogic.jndi.Environment.getContext(Environment.java:315)
at weblogic.jndi.Environment.getContext(Environment.java:285)
at weblogic.jndi.Environment.createInitialContext(Environment.java:208)
at weblogic.jndi.Environment.getInitialContext(Environment.java:192)
at weblogic.jndi.Environment.getInitialContext(Environment.java:170)
at weblogic.jndi.Environment.getContext(Environment.java:215)


Normally the application works fine when connected through http protocol.
Following are the suggestions to get rid of this error:
1. Move the default SQL authenticator to the top and make it sufficient
2. Don't throw any exception when UnsupportedCallbackException is caught during callback handler handle call

However you may need to watch out for the pros and cons of these solutions provided here.

Default Roles not listed when using RolePolicyManager api


When using RolePolicyManager api, default roles are not listed
If no roles are created by default following two roles are provided for each portal web application:
- AnonymousVisitor
- AuthenticatedVisitor
These can be verified using portal admin console, however these never appear when using the following api:
RolePolicyManager.listRolesForResource(EARName, WEBName, EntitlementConstants.P13N_ROLE_POLICY_POOL);
To make these default roles visible, create a custom role in the web application and same api will list all the three roles:
- AnonymousVisitor
- AuthenticatedVisitor
- Custom role

Find out if database sessions are locked


To Check if there is any database session locked

SELECT s1.username || '@' || s1.machine
    || ' ( SID=' || s1.sid || ' )  is blocking '
    || s2.username || '@' || s2.machine || ' ( SID=' || s2.sid || ' ) ' AS blocking_status
    FROM v$lock l1, v$session s1, v$lock l2, v$session s2
    WHERE s1.sid=l1.sid AND s2.sid=l2.sid
    AND l1.BLOCK=1 AND l2.request > 0
    AND l1.id1 = l2.id1
    AND l2.id2 = l2.id2 ;

select * from v$lock
select * from v$session

Display the session count, max sessions, highwater etc.
select sessions_max, sessions_current, sessions_highwater from v$license;