[JBoss Portal] - Re: Injecting PortalObjectContainer into servlet
by jkoek
Julien,
I tried it.
I'm getting now a PortalObjectContainer object but I'm not able to retrieve the context. This context makes it possible for me to createPages and Windows.
Underneath the code that I have used and the jboss-portlet.xml that is part of my servlet deployment.
Can you give me a new hint?
Thanks,
jeroen.
try
{
MBeanServer mbeanServer = MBeanServerLocator.locateJBoss();
container = (PortalObjectContainer)
MBeanProxy.get(PortalObjectContainer.class,
new ObjectName("portal:container=PortalObject"),
mbeanServer);
}
catch (Exception e)
{
log.error("Cannot get interceptor stack", e);
throw new IllegalStateException("Cannot get interceptor stack");
}
if (container == null) {
System.out.println("No portal object container");
}
else
{
System.out.println( "We got the portal object container" );
Context ctx = null;
try {
ctx = container.getContext();
}
catch ( Exception ex ) {
System.out.println( "Failed to get context" );
}
if ( ctx == null ) {
System.out.println( "PortalObjectContainer context is empty!" );
}
}
<portlet-app>
<!-- Service injected in the portlet context. -->
<service-name>PortalObjectContainer</service-name>
<service-class>org.jboss.portal.core.model.portal.PortalObjectContainer</service-class>
<service-ref>portal:container=PortalObject</service-ref>
</portlet-app>
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3960103#3960103
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3960103
19 years, 9 months
[JBoss AOP] - how to do tracing of advices
by Luntain
I want to trace advices of all aspects.
The following definition of tracing aspect results in stack overflow despite the !withing declaration. This is a bug, I think.
| <aspect name="TracingAspect" class="com.siemens.smarthome.aspects.tracing.TracingAspect"/>
| <bind pointcut="execution( * com.siemens.smarthome.aspects.*.*->*(..)) and !within(com.siemens.smarthome.aspects.tracing.*)">
| <advice name="traceAdvice" aspect="TracingAspect"/>
| </bind>
|
Stack overflow:
at com.siemens.smarthome.aspects.tracing.TracingAspect.traceAdvice(TracingAspect.java)
| at org.jboss.aop.advice.com.siemens.smarthome.aspects.tracing.TracingAspect0.invoke(TracingAspect0.java)
| at com.siemens.smarthome.aspects.tracing.TracingAspect$traceAdvice_N192612223631562369.invokeNext(TracingAspect$traceAdvice_N192612223631562369.java)
| at com.siemens.smarthome.aspects.tracing.TracingAspect.traceAdvice(TracingAspect.java)
| at org.jboss.aop.advice.com.siemens.smarthome.aspects.tracing.TracingAspect0.invoke(TracingAspect0.java)
| at com.siemens.smarthome.aspects.tracing.TracingAspect$traceAdvice_N192612223631562369.invokeNext(TracingAspect$traceAdvice_N192612223631562369.java)
| at com.siemens.smarthome.aspects.tracing.TracingAspect.traceAdvice(TracingAspect.java)
| at org.jboss.aop.advice.com.siemens.smarthome.aspects.tracing.TracingAspect0.invoke(TracingAspect0.java)
| at com.siemens.smarthome.aspects.tracing.TracingAspect$traceAdvice_N192612223631562369.invokeNext(TracingAspect$traceAdvice_N192612223631562369.java)
| at com.siemens.smarthome.aspects.tracing.TracingAspect.traceAdvice(TracingAspect.java)
| at org.jboss.aop.advice.com.siemens.smarthome.aspects.tracing.TracingAspect0.invoke(TracingAspect0.java)
| at com.siemens.smarthome.aspects.tracing.TracingAspect$traceAdvice_N192612223631562369.invokeNext(TracingAspect$traceAdvice_N192612223631562369.java)
| at com.siemens.smarthome.aspects.tracing.TracingAspect.traceAdvice(TracingAspect.java)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3960099#3960099
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3960099
19 years, 9 months