[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, 7 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, 7 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, 7 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, 7 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, 7 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, 7 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, 7 months
[JBossWS] - Run-time mapping problem (4.0.3)
by orfordi
I'm working on a project that's using JBoss 4.0.3. This version does not come with "wstools". The documentation talks about using JWSDP's "wscompile", but that gave me some exceptions (no public constructors on some of the enum-type classes), so I'm using "wstools" from an installation of the latest JBoss and WS addon.
So, I've got my soap definition xml file and have used wstools to generate my wsdl and my mapping xml files.
I've added the dummy servlet definition to web.xml and have also created the webservices.xml file that refers to my mapping file.
The server now exposes the wsdl under ?wsdl which is good. I've imported this into VS.NET and am trying to call the method. I get a mapping exception. I had to use "document" style SOAP rather than "rpc" because VS2003 could not understand the WSDL when I tried "rpc".
So I'm trying to work out what's happening with my mapping. Note that the file is not called "jaxrpc-mapping.xml", I've prefixed it with something else, but I've checked that it's in WEB-INF and my WEB-INF\webservices.xml file refers to the correctly named mapping file.
Any suggestions? Thanks in advance.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3994157#3994157
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3994157
19 years, 7 months
[JBoss Messaging] - Destination is not an instance of SpyDestination JBossQueue
by chaituu
anyway queue is coming correctly.while sending the messages do to the queue i am getting exception.
|
| Properties env = new Properties();env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");env.put(Context.URL_PKG_PREFIXES, "org.jboss.naming rg.jnp.interfaces"); env.put(Context.PROVIDER_URL, "172.16.7.12:1099"); Context remoteCtx = new InitialContext(env);Queue queue = (Queue)remoteCtx.lookup("queue/testQueue"); QueueConnectionFactory queueFactory =(QueueConnectionFactory)remoteCtx.lookup("ConnectionFactory"); queueConnection = queueFactory.createQueueConnection(); QueueSession queueSession = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE); QueueSender queueSender = queueSession.createSender(queue); TextMessage message = queueSession.createTextMessage(); message.setText(Long.toString(2));queueSender.send(message);
|
|
this is the log file i am getting;
| 2006-12-15 13:41:55,883 INFO [STDOUT] queue=JBossQueue[testQueue]2006-12-15 13:41:55,883 INFO [STDOUT] queueFactory=org.jboss.mq.SpyConnectionFactory@ee25db2006-12-15 13:41:55,883 INFO [STDOUT] queueSender=SpyMessageProducer@18073655[ dest=JBossQueue[testQueue] delivery=persist priority=4 ttl=0 disableMessageID=false disableTS=false session=SpySession@31137799[tx=false ack=AUTO txid=null RUNNING connection=Connection@29203625[token=ConnectionToken:ID:3/e754023924168169359317b4cb79f038 rcvstate=STOPPED]]]2006-12-15 13:41:55,883 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/sample].[jsp]] Servlet.service() for servlet jsp threw exceptionjavax.jms.InvalidDestinationException: Destination is not an instance of SpyDestination JBossQueue[testQueue] at org.jboss.mq.SpyMessageProducer.send(SpyMessageProducer.java:225) at org.jboss.mq.SpyMessageProducer.send(SpyMessageProducer.java:199) at org.apache.jsp.UploadSessionBean_jsp._jspService(org.apache.jsp.UploadSessionBean_jsp:83) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97) at javax.servlet.http.HttpServlet.service(HttpServlet.java:810) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322) 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:810) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81) 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) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178) at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39) at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:153) at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112) at java.lang.Thread.run(Thread.java:595)
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3994148#3994148
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3994148
19 years, 7 months
[JBoss Seam] - Re: Basic Seam questions
by lightbulb432
I have some questions about the responses above, but to have a better understanding leading up to it, I need to figure some things out about conversations.
>From the Seam FAQ:
anonymous wrote : Most other web frameworks store all application state in the HTTP session, which is inflexible, difficult to manage and a major source of memory leak. Seam can manage business and persistence components in several stateful scopes: components that only need to live across several pages are placed in the conversation scope; components that need to live with the current user session are placed in the session scope
anonymous wrote : Seam supports fine-grained user state management beyond the simple HTTP session. It isolates and manages user state associated with individual browser window or tab (in contrast, HTTP session is shared across all windows of the same browser).
What is the conversation equivalent of an HTTP session? Where and how is this conversation information actually stored?
How does Seam know that a new tab or window has been opened...I haven't been able to figure it out at all, but it almost seems like magic. I believe it happens with both client- and server-side state-saving. In both cases, how does it actually know of and keep track of all different conversations?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3994147#3994147
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3994147
19 years, 7 months
[JBoss Messaging] - JBoss 5.0beta1: JMS with PostgreSQL
by Juergen.Zimmermann
After unzipping the archive I modified ejb3-timer-service.xml. There was no problem (changes see below). However, I get these error messages in the PostgreSQL console regarding JMS.
ERROR: syntax error at or near "(" at character 74
| STATEMENT: CREATE TABLE JMS_TRANSACTION (TRANSACTIONID BIGINT, BRANCH_QUAL VARBINARY(254), FORMAT_ID INTEGER, GLOBAL_TXID VARBINARY(254), PRIMARY KEY (TRANSACTIONID))
|
| ERROR: syntax error at or near "(" at character 283
| STATEMENT: CREATE TABLE JMS_MESSAGE (MESSAGEID BIGINT, RELIABLE CHAR(1), EXPIRATION BIGINT, TIMESTAMP BIGINT, PRIORITY TINYINT, COREHEADERS LONGVARBINARY, PAYLOAD LONGVARBINARY, CHANNELCOUNT INTEGER, TYPE TINYINT, JMSTYPE VARCHAR(255), CORRELATIONID VARCHAR(255), CORRELATIONID_BYTES VARBINARY(254), DESTINATION_ID BIGINT, REPLYTO_ID BIGINT, JMSPROPERTIES LONGVARBINARY, PRIMARY KEY (MESSAGEID))
Where can I find these table definitions in 5.0beta1? Any hint is appreciated!
Changes made in ejb3-timer-service.xml:
HSQLDBDelegate -> PostgreSQLDelegate
| qrtz_job_details: BINARY -> oid
| qrtz_triggers: BINARY -> oid
| IS_VOLATILE VARCHAR(1) -> IS_VOLATILE boolean
| qrtz_blob_triggers: BINARY -> oid
| qrtz_calendars: BINARY -> oid
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3994145#3994145
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3994145
19 years, 7 months
[EJB 3.0] - Re: EntityManager is loosing updates
by konstantin.ermakov
Hi!
Thanks a lot for your answer. I actually want not to update the entity from the second thread, but just be sure, that the entity I am reading is up-to-date. And, of course, @Version, optimistic locking does not help me in this case. In general, let's assume the following scenario.
| * In some stateless bean we have the update() method:
|
| | ...
| | void update() {
| | .....
| | entity.setName("Name");
| | manager.flush();
| | sendJMSNotification();
| | };
| |
| * sendJMSNotification() is sending a message to the rich clients, that the entity was updated (in my case, the interceptor is doing it)
| * the client is trying to call manager.find(...) from the same stateless bean, and receives an old data.
|
|
| So, the main question is , if there is a possibility to get postCommit event? IMHO this is important, because the client may receive the notification and in theory, the client does NOT have to access the EJB server, but the database directly. The good example would be a reporting tool, which is refreshing the data after receiving the notification.
|
| Even If I am implementing manager.lock( entity, LockType.READ ), I think it does not work properly in this case - after flush() method the lock is gone.
|
| The only workaround I see is to use the direct JDBC calls, but then it does not make sence to use EJB and Persistence API to work with database.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3994144#3994144
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3994144
19 years, 7 months
[Security & JAAS/JBoss] - Help! flushAuthenticationCache cann't work!
by joeyli
I use the following code to flush the role, but I use the request.isUserInRole('Anonymous'), the result is still true:
| private void logout() throws Exception {
|
| String domainName = "EatOutDomain";
|
| MBeanServer server = (MBeanServer) MBeanServerFactory
| .findMBeanServer(null).get(0);
| String jaasMgrName= "jboss.security:service=JaasSecurityManager";
| ObjectName jaasMgr = new ObjectName(jaasMgrName);
| Object[] params = { domainName };
| String[] signature = { "java.lang.String" };
| List users = (List) server.invoke(jaasMgr,
| "getAuthenticationCachePrincipals", params, signature);
|
| for (int i = 0; i < users.size(); i++) {
| SimplePrincipal principal = (SimplePrincipal) users.get(i);
|
|
| Object[] pParams = { domainName, principal };
| String[] pSignature = { "java.lang.String", "java.security.Principal"};
| server.invoke(jaasMgr, "flushAuthenticationCache", pParams,
| pSignature);
|
There have only one principal "Anonymous" in domain, and I user getAuthenticationCachePrincipals to get the roles after call "flushAuthenticationCache", the prinipals all clearned.
But, I use the request.isUserInRole("Anonymous") the result is always is true.
How can I clean the request.isUserInRole()? And relogin into web site?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3994143#3994143
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3994143
19 years, 7 months
[EJB 3.0] - how to get username of logged in user
by lorandsm_
Hello,
I use authentication in my application this way:
| Hashtable props = new Hashtable();
|
| props.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
| props.put(Context.SECURITY_PRINCIPAL, user);
| props.put(Context.SECURITY_CREDENTIALS, password);
| props.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.security.jndi.JndiLoginInitialContextFactory");
| props.put(Context.PROVIDER_URL, "jnp://" + readingPropertiesForConnection() + ":" + "1099");
|
| Context ctx = new InitialContext(props);
|
| dispecerat = (DispeceratEntityManager) ctx.lookup("capitol/DispeceratEntityManagerBean/remote");
|
and define the users and roles in the user.properties and roles.properties property files. What I want is to log user actions on the server which is running jboss. So in the business methods of my session bean I want to find out what user is requesting the operation to log the user requesting the operation. How could I do this? Thanks.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3994140#3994140
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3994140
19 years, 7 months
[JBoss Seam] - Re: Seam & Maven2
by mzeijen
I have seen it and tested it. I find it great that someone else already made something. The problem is that every Maven2, ready to go, solution that I found is incomplete.
The following stuff is missing or anouyes me.
- It misses several dependencies so that you really need to rebuild the POM files before you get, for example, UnitTesting to work. And they don't solve the dependency problems (thirdparty-all.jar).
- I don't want to be dependent on a non-official, or non-JBoss, repository. What happens if they stop being available in a shot while...
- The archetype generates only a complete project with one war, one jar and one ear file. There aren't any archetypes to create those part separately.
- The archetype is only meant for a JBoss deployment.
- They are already behind, because there aren't any Seam 1.1.0 GA, CR1, CR2 or other releases to be found.
I feel like that there is some 'official' support needed for Maven2.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3994139#3994139
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3994139
19 years, 7 months
[JBoss Messaging] - Re: JmsXA vs XAConnectionfactory and durable topic subscript
by mclu
"timfox" wrote : BTW, any reason why you're not just using MDBs?
Hmm Yes!
As I said I have a Topic where messages comes in. These must be processed and send to a queue for each connected system.
I don't want so hardcode his so it must be self maintaining.
My Idea: Have a service which starts or stops durable subscribers on a topic based on registered servers...
The Order is relevant so I can only have one instance per connected Server.
Any small hints how I can handle this with MDB? I would prefer this way because of DLQ handling and transactions...
In the end I need a scaleable system which consumes messages from a topic and send the processed data (different for each server) to connected servers/outgoing queue (which register themself).
One Idea is to have an MDB which handles the message for all servers, but this is not that scaleable, because the order is relevant so I only can have one MDB instance...
"weston.price(a)jboss.com" wrote : <config-property name="Strict">False</config-property>
Thx for this hint but I try be be spec compliant...
/MDB consuming messages
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3994137#3994137
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3994137
19 years, 7 months
[JBoss Seam] - Re: Basic Seam questions
by SmokingAPipe
anonymous wrote : What are best practices or suggestions regarding what to bind fields in the webpage to - session beans or entities?
Bind them to what they should be bound to! If you're manipulating an object like a "Car", that has color, price, model name, etc, those should be bound directly to the car. The cool thing about Seam is that it gets rid of the whole "data transfer objects" (DTOs) thing. You certainly can use session beans as DTOs in cases where you really need to, but if you don't need to, don't! I started using Seam because I don't want to use any more DTOs. JSF backing beans are DTOs.
Why are DTOs so bad? Because they don't correspond to any part of your business. Working on stuff that's not part of your business means wasting time, effectively.
I'm a Seam newbie so I hope someone will correct me if I'm wrong on this.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3994133#3994133
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3994133
19 years, 7 months
[JNDI/Naming/Network] - jndi reference problem(urgent)?
by augustfox
My environment is myeclipse4.1.1+jboss4.0.1sp1+DB28.2.
When I wanna get a database connection,i meet with a problem,the error as follows:
14:38:06,343 INFO [STDOUT] javax.naming.NamingException: Could not dereference object [Root exception is javax.naming.NameNotFoundException: jdbc not bound]
14:38:06,343 INFO [STDOUT] at org.jnp.interfaces.NamingContext.resolveLink(NamingContext.java:999)
14:38:06,343 INFO [STDOUT] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:629)
14:38:06,343 INFO [STDOUT] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:658)
14:38:06,343 INFO [STDOUT] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:520)
14:38:06,343 INFO [STDOUT] at javax.naming.InitialContext.lookup(InitialContext.java:347)
My code like this:
Context context = new InitialContext();
return (DataSource) context.lookup("java:comp/env/jdbc/test");
I can get connecton via context.lookup("java:jdbc/test"),
but i still want to know why context.lookup("java:comp/env/jdbc/test") not works?
I want to get your help eagerly!
my db2-ds.xml:
<local-tx-datasource>
<jndi-name>jdbc/test</jndi-name>
<connection-url>jdbc:db2:tempdb</connection-url>
<driver-class>COM.ibm.db2.jdbc.app.DB2Driver</driver-class>
<user-name>test</user-name>
test
<min-pool-size>5</min-pool-size>
<max-pool-size>20</max-pool-size>
<type-mapping>DB2</type-mapping>
</local-tx-datasource>
my web.xml:
<resource-ref>
<res-ref-name>jdbc/test</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>
my jboss-web.xml:
<resource-ref>
<res-ref-name>jdbc/test</res-ref-name>
<jndi-name>jdbc/test</jndi-name>
</resource-ref>
I also tried resource-env-ref in my web.xml and jboss-web.xml,it still not works.
thanks a lot!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3994132#3994132
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3994132
19 years, 7 months
[JBoss Seam] - Re: Basic Seam questions
by lightbulb432
1)
Is there a DTD or some detailed documentation that is available for exceptions.xml? I did a web search on this file and noticed a link (http://jira.jboss.com/jira/browse/JBSEAM-186?page=comments) that showed a lot of proposed activity, and I'm just wondering what the final set of functionality offered by this file is.
That link talks about a lot of things like ExceptionFilter, a request-scoped variable named "exception", and some different possible tags (many of which are also provided in the link in your previous post). It'd be nice to have take a look at DTD or documentation that describes all the current possibilities with the exceptions.xml file.
2) anonymous wrote : A Seam persistence context is most like a container-managed extended persistence context. But whereas the container-managed context is tied to an SFSB instance, and hence there can be multiple contexts per conversation, the Seam persistence context has exactly one per conversation.
What implications does the existence of multiple persistence contexts per conversation have? (i.e. What negative consequence of this was being solved by the introduction of the Seam-Managed Persistance Context?)
Is it necessary (or recommended?) to use the SMPC in all cases where there exists a conversation? - I'm not sure about the decision process for which of the two to choose, and the rationale behind it.
3) anonymous wrote : There is nothing wrong with having a bunch of stateless actions all using the same conversation-scope persistence context. This is part of the magic of Seam - components with different scopes can all work smoothly together in a loosley coupled way, with no need for orchestration by the Java code.
In that case, is it correct to say that everything in Seam is stateful regardless of whether you use stateless or stateful session beans - because the component tree and state holds the information which is injected into fields of the session beans? If everything can be conveniently done with a stateless session bean because of the beauty of bijection, then when (this'll sound like a really dumb question) would you use stateful session beans at all? I imagine it'd be more than just a matter of convenience coding (e.g. saving a few merge() calls or something like that)?
4)
I need some guidance here: What are best practices or suggestions regarding what to bind fields in the webpage to - session beans or entities? If you have a Registration session bean and a Person entity, would you bind fields such as "name" to the entity directly and other things like "password1" and "password2" to the session bean (because, for example, you need to make sure both passwords are the same)?
Or is such a direct access to the entity not considered good (because that's what the session facade is meant for?), and even "name" should be bound to the session bean then passed through to the entity? Is it not good practice to, in a form with multiple fields, have some forms bound to #{register. } and others bound to #{person. }...should you remain consistent instead? What would you do?
Thanks. Whew!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3994131#3994131
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3994131
19 years, 7 months
[JBoss Seam] - Using DataModelSelection and @Out for an "are you sure" page
by SmokingAPipe
Here's the scenario:
I use a DataModel in my SFSB to present a table to a user. Let's say it's a table of important things that you wouldn't normally delete, like a table of Customers. I display this table, using the DataModel, and next to each Customer there is a "delete" button. Clicking "delete" will take the user to another page where the details of the customer are shown, and it says, "are you sure you want to delete this customer?" Then there is a "yes really delete" button there.
Obviously I can know which entry was clicked with a @DataModelSelection, and I can use an <s:link> to get to the "are you sure" page. I put an @Out along with the @DataModelSelection. When I do this, the DataModelSelection is being set and outjected, but it is being outjected after the "are you sure" page is rendered, so the details can't be displayed on that page.
As a hack, I have used a <h:commandButton> instaed of an <s:link>, and for the action I have used a method call that looks like this:
public String doIt() {
| return "/are-you-sure.jsp";
| }
What this does is it gets the value outjected before it needs to render the are-you-sure.jsp page.
So, that works, but it involves writing a method that doesn't do anything more than returning a string, and seems hackish.
Is there some nicer way to do this? This is important to me because I do this kind of thing all the time in my application.
Thanks
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3994129#3994129
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3994129
19 years, 7 months
[JBossCache] - Re: Performance Issue with Jbosscache
by muthukumaran_m
Thanks for your interest.
Actually we didn't have any cluster setup, while we took the performance results.
We actually wanted to get the performance of the application with a single server instance. Kindly advice me, whether I am missing some setting here?
Then, regarding the JGroups version, here is it
| Version: 2.2.8
| CVS: $Id: Version.java,v 1.18.2.1 2005/05/30 09:47:56 belaban Exp $
| History: (see doc/history.txt for details)
|
The real thing that makes me worry is that the application flow, for which I am testing the performance, does not include any call to the Jboss Cache. We are using Jboss Cache for a different flow/purpose, mainly for invalidating the custom in memory architecture that we have in our application. But I am not sure why this JGroup call is coming in.
Kinldy let me know any more information.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3994121#3994121
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3994121
19 years, 7 months