[JBoss AOP] - Re: NullPointerException at advised._getInstanceAdvisor();
by robotics80
I rewrite the jboss-aop.xml file because I failed to insert its code:
<!-- Declaring pointcuts -->
| <pointcut name="allPublicMethod"
| expr="execution(public * it.pitagora.sqtp.server.aicagw.fastdeferred.FileFinder->*(..))"/>
| <pointcut name="mainMethod"
| expr="execution(void it.pitagora.sqtp.server.aicagw.fastdeferred.FileFinder->main(..))"/>
| <pointcut name="constructorPointcut"
| expr="execution(it.pitagora.sqtp.server.aicagw.fastdeferred.FileFinder->new(..))"/>
| <pointcut name="logObject" expr="set(it.pitagora.util.log.Log it.pitagora.sqtp.server.aicagw.fastdeferred.FileFinder->*)"/>
|
|
| <!-- Declaring Aspects -->
| <aspect name="logAspect" class="aop.batch.interceptor.LogAspect" scope="PER_INSTANCE">
| <attribute name="PropertyFile">aicagw.properties</attribute>
| </aspect>
|
|
| <!-- Binding pointcuts to Interceptors
| <bind pointcut="(allPublicMethod OR constructorPointcut) AND !mainMethod">
| <interceptor-ref name="logInterceptor"/>
| </bind>
| -->
|
| <!-- Binding pointcuts to Aspects -->
| <bind pointcut="logObject">
| <advice name="getLogger" aspect="logAspect"/>
| </bind>
|
| <bind pointcut="(allPublicMethod OR constructorPointcut) AND !mainMethod">
| <advice name="trace" aspect="logAspect"/>
| </bind>
The error happens when I declare a pointcut expression like this:
| <pointcut name="prova" expr="call(public it.pitagora.util.log.Log->new(..)) AND within(it.pitagora.sqtp.server.aicagw.fastdeferred.FileFinder)"/>
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3994168#3994168
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3994168
19 years, 4 months
[JBoss Seam] - Facelets error
by thejavafreak
I get this error when Initializing a seam-gen generated application. I deployed the application on JBoss AS 5.0.0Beta1. Are there any workaround for this? It seems the error is harmful.
17:08:38,485 ERROR [STDERR] Dec 15, 2006 5:08:38 PM com.sun.facelets.compiler.Ta
| gLibraryConfig loadImplicit
| INFO: Added Library from: jar:file:/C:/javasoft/jboss/jboss-5.0.0.Beta1/server/d
| efault/deploy/seam.ear/seam.war/WEB-INF/lib/jsf-facelets.jar!/META-INF/jsf-html.
| taglib.xml
| 17:08:38,495 ERROR [STDERR] Dec 15, 2006 5:08:38 PM com.sun.facelets.compiler.Ta
| gLibraryConfig loadImplicit
| INFO: Added Library from: jar:file:/C:/javasoft/jboss/jboss-5.0.0.Beta1/server/d
| efault/deploy/seam.ear/seam.war/WEB-INF/lib/jsf-facelets.jar!/META-INF/jstl-fn.t
| aglib.xml
| 17:08:38,595 ERROR [STDERR] Dec 15, 2006 5:08:38 PM com.sun.facelets.compiler.Ta
| gLibraryConfig loadImplicit
| INFO: Added Library from: jar:file:/C:/javasoft/jboss/jboss-5.0.0.Beta1/server/d
| efault/deploy/seam.ear/seam.war/WEB-INF/lib/jsf-facelets.jar!/META-INF/jsf-core.
| taglib.xml
| 17:08:38,605 ERROR [STDERR] Dec 15, 2006 5:08:38 PM com.sun.facelets.compiler.Ta
| gLibraryConfig loadImplicit
| INFO: Added Library from: jar:file:/C:/javasoft/jboss/jboss-5.0.0.Beta1/server/d
| efault/deploy/seam.ear/seam.war/WEB-INF/lib/jboss-seam-ui.jar!/META-INF/seam.tag
| lib.xml
| 17:08:38,625 ERROR [STDERR] Dec 15, 2006 5:08:38 PM com.sun.facelets.compiler.Ta
| gLibraryConfig loadImplicit
| INFO: Added Library from: jar:file:/C:/javasoft/jboss/jboss-5.0.0.Beta1/server/d
| efault/deploy/seam.ear/seam.war/WEB-INF/lib/jsf-facelets.jar!/META-INF/jstl-core
| .taglib.xml
| 17:08:38,645 ERROR [STDERR] Dec 15, 2006 5:08:38 PM com.sun.facelets.compiler.Ta
| gLibraryConfig loadImplicit
| INFO: Added Library from: jar:file:/C:/javasoft/jboss/jboss-5.0.0.Beta1/server/d
| efault/deploy/seam.ear/seam.war/WEB-INF/lib/jsf-facelets.jar!/META-INF/jsf-ui.ta
| glib.xml
|
Thanks in advance
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3994166#3994166
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3994166
19 years, 4 months
[JBoss AOP] - Re: NullPointerException at advised._getInstanceAdvisor();
by robotics80
I have the main application in a file FileFinder.java that use a logger object to log its operations into a file. The FileFinder build this log object in a method init() and I want to create an aspect for logging interception that is able to intercept the log object build in method init() of FileFinder class and use this object to log operations.
A part of FileFinder.java code is:
public class FileFinder {
private SqlMapClient sqlMapClient;
private Log log;
private IniReader ini;
private InstanceManager instanceManager;
private SessionTask sessionTask;
private int errorReq = 0;
private int discardedReq = 0;
private static final String className = "FileFinder";
/**
* @throws DeferredException
*
*/
public FileFinder() throws DeferredException {
init();
}
/**
* @throws DeferredException
*
*/
private void init() throws DeferredException {
String proc = className + ".init()";
try {
ini = new IniReader(Env.getSqtpHome() + "etc/aicagw.properties");
log = new Log(ini);
log.logInit("AICAGW.FILEFINDER","BATCH");
log.setPid();
logInfo(proc,"START");
long startTime = System.currentTimeMillis();
//creazione file gestione esecuzione singola istanza del batch
String workingFolder = ini.getPrivateProfileString("AICAGW.COMMON","WORKINGFOLDER","/");
String instancefileName = "fileFinder";
logInfo(proc,"file per gestione esecuzione singola istanza del batch: " + workingFolder + "/" + instancefileName);
instanceManager = new InstanceManager(workingFolder,instancefileName);
//creazione sessione
sessionTask = new SessionTask(log);
sessionTask.setSessionName(""+startTime);
//accesso a db tramite iBatis
sqlMapClient = SqlMapClientConfig.getClient("AICAGW", "BATCH");
logInfo(proc,"END");
} catch (Exception e) {
DeferredException de = CommonDeferred.wrapException(e);
logErr(proc, de.toString());
throw de;
}
}
//... and some other methods
}
A part of LogAspect.java code is:
public class LogAspect {
private static final String className = "LogAspect";
private static final String DBG_ERROR = "ERROR";
private static final String DBG_WARNING = "WARNING";
private static final String DBG_INFO = "INFO";
private static final String DBG_TRACE = "TRACE";
private String propertyFile;
private Log log;
private IniReader ini;
/*
private void init() throws Exception {
String proc = className + ".init()";
try {
ini = new IniReader(Env.getSqtpHome() + "etc/" + propertyFile);
log = new Log(ini);
log.logInit("AICAGW.FILEFINDER","BATCH");
log.setPid();
} catch (IOException e) {
logErr(proc, e.getMessage());
throw e;
}
}
*/
public void setPropertyFile(String propertyFile) {
this.propertyFile = propertyFile;
}
public void setLog(Log log) {
this.log = log;
}
public String getName() {
return "LogAspect";
}
public Object getLogger(Invocation invocation) throws Throwable{
try{
System.out.println("INGRESSO nel getLogger()");
if (invocation instanceof FieldWriteInvocation) {
FieldWriteInvocation fieldInvocation = (FieldWriteInvocation)invocation;
setLog((Log)fieldInvocation.getValue());
} else
System.out.println("Unknown Invocation!!");
return invocation.invokeNext();
} finally {
System.out.println("USCITA dal getLogger()");
}
}
public Object trace(Invocation invocation) throws Throwable{
String proc = className + ".trace()";
long startTime = System.currentTimeMillis();
logInfo(proc, "START");
logTrace(proc, invocationTypeValue(invocation));
Object response = null;
try {
response = invocation.invokeNext();
return response;
}catch(Throwable t) {
long endTime = System.currentTimeMillis();
long elapsedTime = endTime - startTime;
logErr(proc, t.getMessage() + " - Tempo di esecuzione (ms): " + elapsedTime);
throw t;
}
finally {
long endTime = System.currentTimeMillis();
long elapsedTime = endTime - startTime;
logTrace(proc,dumpInvocationResponse(invocation, response) + " - Tempo di esecuzione (ms): " + elapsedTime);
logInfo(proc, "END");
}
}
public String dumpInvocationResponse(Invocation invocation, Object response) {
// some code
}
private String invocationTypeValue (Invocation invocation) {
// some code
}
private void logErr(String proc, String message) {
System.out.println(DBG_ERROR + ": " + message);
if (log != null) {
log.logWrite(log.DBG_ERROR, proc, message);
}
}
private void logWarning(String proc, String message) {
System.out.println(DBG_WARNING + ": " + message);
if (log != null) {
log.logWrite(log.DBG_WARNING, proc, message);
}
}
private void logInfo(String proc, String message) {
System.out.println(DBG_INFO + ": " + message);
if (log != null) {
log.logWrite(log.DBG_INFO, proc, message);
}
}
private void logTrace(String proc, String message) {
System.out.println(DBG_TRACE + ": " + message);
if (log != null) {
log.logWrite(log.DBG_TRACE, proc, message);
}
}
}
The jboss-aop.xml file is:
<!-- Declaring pointcuts -->
<!-- Declaring Aspects -->
<!-- Binding pointcuts to Aspects -->
In this way It works fine because I use the pointcut expression set(..) and a FieldWriteInvocation to intercept the log object when it is assigned in a log variable into FileFinder class.
But if I use the pointcut expression call(..) to intercept the construction of the Log object in the FileFinder.init() method, I got the NullPointerException like this:
N.B. Remember tha I run this file with load time weaving activated with option -javagent:..... JDK 1.5 and the latest version JBoss AOP 1.5.2.GA
Is there anyone that is able to solve this problem?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3994165#3994165
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3994165
19 years, 4 months
[JBoss Seam] - Re: Seam 1.1 on WebLogic 9
by gavin.king@jboss.com
anonymous wrote : Can a WL-deployed Seam application use any WL-Resources such as DataSource/ConnectionPool/JNDI/JMS-Queue/etc. from the WL server?
Sure, ofcourse!
anonymous wrote : I assume that I don't have to change/adjust any (global) configuration of the WL server when deploying a Seam-based application (aside from the regular application deployment process), since it is just a "plain-vanilla" J2EE app from the deployment point of view. Is that correct?
Right, its just a WAR.
anonymous wrote : Also are there any points where the application development with Seam is constrained when targeting the WL 9 platform for a deployment?
You can't use EJB3.
Have you looked at the examples yet? the "jpa" and "hibernate2" examples both deploy on WL.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3994164#3994164
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3994164
19 years, 4 months
[JBoss Seam] - NullPointer for SeamSelectItems config
by dave.rogers
I'm getting the error:
java.lang.NullPointerException
| at org.jboss.seam.selectitems.ui.UISeamSelectItems.isCache(UISeamSelectItems.java:64)
| at org.jboss.seam.selectitems.ui.UISeamSelectItems.evaluateCacheKey(UISeamSelectItems.java:277)
| at org.jboss.seam.selectitems.ui.UISeamSelectItems.isCacheEnabled(UISeamSelectItems.java:273)
| at org.jboss.seam.selectitems.ui.UISeamSelectItems.getValue(UISeamSelectItems.java:193)
| at org.apache.myfaces.trinidadinternal.renderkit.uix.SelectItemSupport.addSelectItems(SelectItemSupport.java:270)
| at org.apache.myfaces.trinidadinternal.renderkit.uix.SelectItemSupport.getSelectItems(SelectItemSupport.java:90)
| at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.SimpleSelectOneRenderer.encodeAllAsElement(SimpleSelectOneRenderer.java:255)
| at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.FormElementRenderer.encode
When using the select items tag as follows:
<tr:selectOneChoice id="catalogue" value="#{itemManager.item.catalogue}">
| <si:selectItems value="#{catalogues}" var="catalogue" label="#{catalogue.name}"/>
| </tr:selectOneChoice>
It was working fine just before, so it's probably something small.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3994163#3994163
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3994163
19 years, 4 months
[JBoss jBPM] - Jbpm on Tomcat 5.5
by srsuarez
I am trying to run Jbpm on Tomcat 5.5. I have done these steps, but I have some questions:
Steps
(1) Download jbpm-starters-kit-3.1.1 from Jboss site
(2) Deploy jbpm-starters-kit-3.1.1\jbpm-server\server\jbpm\deploy\jbpm.war into tomcat webapps.
(3) Copy hibernate.cfg.xml from jbpm-starters-kit-3.1.1\jbpm\src\config.files to ur <jbpm-home>/WEB-INF/classes/
(4) Run ant task for creating database tables and data from jbpm-starters-kit-3.1.1\jbpm\build.deploy.xml
( ant create.db ?buildfile build.deploy.xml)
(5) Add few jars to lib folder of your application.
(6) Start tomcat.
(7) Start jbpm application.
Questions
* On the step (2), I have copied the "jbpm-starters-kit-3.1.1\jbpm-server\server\jbpm\deploy\jbpm.war" on tomcat webapps. Is it correct?
* When I run the jbpm application I obtain this error on the tomcat logs. I don't know why success...:
javax.faces.FacesException: Cannot get value for expression '#{userBean.userSelectItems}'
at org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:421)
at org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:234)
at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:300)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:95)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:39
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
at org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:703)
at org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:670)
at org.apache.jsp.index_jsp._jspService(index_jsp.java:46)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.jbpm.webapp.filter.AuthenticationFilter.doFilter(AuthenticationFilter.java:55)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.jbpm.web.JbpmContextFilter.doFilter(JbpmContextFilter.java:83)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.jbpm.webapp.filter.LogFilter.doFilter(LogFilter.java:59)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3994162#3994162
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3994162
19 years, 4 months
[JBoss Seam] - Seam 1.1 on WebLogic 9
by schneider_id
Hello Seam/JBoss-Team,
I'm interested in the deployment and integration details of running Seam applications within WebLogic 9.
How far is the integration between the application's Seam runtime and the WebLogic server?
Can a WL-deployed Seam application use any WL-Resources such as DataSource/ConnectionPool/JNDI/JMS-Queue/etc. from the WL server? Or (for example) do I have to configure the DB connection settings within the application's Seam configuration, separate from the WL configuration?
I assume that I don't have to change/adjust any (global) configuration of the WL server when deploying a Seam-based application (aside from the regular application deployment process), since it is just a "plain-vanilla" J2EE app from the deployment point of view. Is that correct?
Also are there any points where the application development with Seam is constrained when targeting the WL 9 platform for a deployment?
Best Regards,
Christian
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3994159#3994159
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3994159
19 years, 4 months