[JBossCache] - Tutorial Problem
by kgwilliams
I'm trying to follow the POJOCache tutorial and have been running into problems. The first problem is that the GUI won't start up most of the time. I get the message "[java] start(): creating the GUI" but then nothing else happens. It took me five tries before I could get the second GUI to pop up for the tutorial the last time I tried.
Also, I'm entering the commands shown in section 7.1 of the tutorial and I run into problems again. The commands in step one usually are fine, but the command to attach the joe Person object always gets me the following error:
|
| // Error: // Uncaught Exception: Method Invocation cache.attach : at Line: 1 : in file: <unknown file> : cache .attach ( "pojo/joe" , joe )
|
| Target exception: java.lang.IllegalArgumentException: PojoCache.putObject(): Object type is neither aspectized nor Serializable nor an array of primitives. Object class name is org.jboss.cache.pojo.test.Person
|
| java.lang.IllegalArgumentException: PojoCache.putObject(): Object type is neither aspectized nor Serializable nor an array of primitives. Object class name is org.jboss.cache.pojo.test.Person
| at org.jboss.cache.pojo.util.AopUtil.checkObjectType(AopUtil.java:125)
| at org.jboss.cache.pojo.interceptors.CheckNonSerializableInterceptor.invoke(CheckNonSerializableInterceptor.java:36)
| at org.jboss.aop.advice.PerInstanceInterceptor.invoke(PerInstanceInterceptor.java:105)
| at org.jboss.cache.pojo.impl.PojoCacheImpl$attach_3085019539260813833.invokeNext(PojoCacheImpl$attach_3085019539260813833.java)
| at org.jboss.cache.pojo.interceptors.CheckIdInterceptor.invoke(CheckIdInterceptor.java:33)
| at org.jboss.aop.advice.PerInstanceInterceptor.invoke(PerInstanceInterceptor.java:105)
| at org.jboss.cache.pojo.impl.PojoCacheImpl$attach_3085019539260813833.invokeNext(PojoCacheImpl$attach_3085019539260813833.java)
| at org.jboss.cache.pojo.interceptors.PojoBeginInterceptor.invoke(PojoBeginInterceptor.java:36)
| at org.jboss.aop.advice.PerInstanceInterceptor.invoke(PerInstanceInterceptor.java:105)
| at org.jboss.cache.pojo.impl.PojoCacheImpl$attach_3085019539260813833.invokeNext(PojoCacheImpl$attach_3085019539260813833.java)
| at org.jboss.cache.pojo.impl.PojoCacheImpl.attach(PojoCacheImpl.java)
| at org.jboss.cache.pojo.impl.PojoCacheImpl.attach(PojoCacheImpl.java:93)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:597)
| at bsh.Reflect.invokeMethod(Unknown Source)
| at bsh.Reflect.invokeObjectMethod(Unknown Source)
| at bsh.Name.invokeMethod(Unknown Source)
| at bsh.BSHMethodInvocation.eval(Unknown Source)
| at bsh.BSHPrimaryExpression.eval(Unknown Source)
| at bsh.BSHPrimaryExpression.eval(Unknown Source)
| at bsh.Interpreter.run(Unknown Source)
| at java.lang.Thread.run(Thread.java:619)
|
It looks like the Person object isn't serializable or properly annotated, but since it was provided along with the POJOCache libraries, shouldn't it be? All I have is the class file for the object so I can't even look inside to see what's there.
Is anyone else having these problems? Any suggestions on how to get the tutorial working properly?
Thanks
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4077085#4077085
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4077085
18Â years, 8Â months
[JBoss Seam] - Re: Missing exceptions within asynchronious methods
by gbcï¼ gmx.de
Second Post regarding the missing Seam Exception:
Here I have two SessionBeans:
Interface One:
| package org.esit.server.sessionbeans;
|
| import javax.ejb.Local;
|
| @Local
| public interface Blob {
|
| public boolean isAvailable();
|
| public void raiseBlob();
|
| public void destroy();
|
| }
|
SessionBean One:
| package org.esit.server.sessionbeans;
|
| import javax.ejb.Remove;
| import javax.ejb.Stateful;
|
| import org.jboss.seam.annotations.In;
| import org.jboss.seam.annotations.Logger;
| import org.jboss.seam.annotations.Name;
| import org.jboss.seam.core.Events;
| import org.jboss.seam.faces.FacesMessages;
| import org.jboss.seam.log.Log;
|
| @Stateful
| @Name("blob")
| public class BlobAction implements Blob {
|
| @In FacesMessages facesMessages;
|
| @In Events events;
|
| @Logger Log log;
|
| public boolean isAvailable() {
| boolean out = true;
| facesMessages.add("isAvailable(): #0", out);
| return out;
| }
|
| public void raiseBlob() {
| facesMessages.add("raiseEvent() called");
| events.raiseAsynchronousEvent("blob");
| }
|
| @Remove
| public void destroy() { }
| }
|
Interface Two:
| package org.esit.server.sessionbeans;
|
| import javax.ejb.Local;
|
| @Local
| public interface Foo {
|
| public void observeBlob();
|
| public void destroy();
|
| }
|
SessionBean Two:
| package org.esit.server.sessionbeans;
|
| import javax.ejb.Remove;
| import javax.ejb.Stateful;
|
| import org.jboss.seam.annotations.In;
| import org.jboss.seam.annotations.Name;
| import org.jboss.seam.annotations.Observer;
|
| @Stateful
| @Name("fooAction")
| public class FooAction implements Foo{
|
| @In(create=true) Blob blb;
|
| @Observer("blob")
| public void observeBlob() {
| System.out.println("blob");
| throw new RuntimeException("blob");
| }
|
| @Remove
| public void destroy() {
| }
|
| }
|
Same Page with invoking button gives no server output at all. The injected Blob variable name is misspelled so that the component cannot be found.
Correcting the variable name to blob, the server shows only
[code|
23:56:35,359 INFO [STDOUT] blob
[/code|
like in the example above and no RuntimeException again.
So long, Greetz GHad
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4077081#4077081
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4077081
18Â years, 8Â months
[JBoss Seam] - Re: Success configuring generic filters in SEAM?
by pete.muirï¼ jboss.org
This is much easier in Seam2, if you can use it...
@Scope(APPLICATION)
| @Name("myFilter")
| @BypassInterceptors
| @Filter(within="org.jboss.seam.web.ajax4jsfFilter")
| public class MyFilter extends AbstractFilter {
|
| public void doFilter(final ServletRequest request, final ServletResponse response, final FilterChain chain) throws IOException, ServletException {
| new ContextualHttpServletRequest( (HttpServletRequest) request ) {
| public void process() throws ServletException, IOException
| {
| // Do your work
| }
| }.run();
| }
| }
If you are stuck on Seam 1.2, then you don't havve @Filter and you don't have ContextualHttpServletRequest, so mark your filter with @Name and @Startup, and do the Lifecycle setup and teardown yourself (look at filters in org.jboss.seam.web for how to do this).
You can configure it using components.xml as usual (just add getters and setters).
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4077077#4077077
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4077077
18Â years, 8Â months
[JBoss Seam] - Re: Missing exceptions within asynchronious methods
by gbcï¼ gmx.de
Ok, full working example code, tested just now.
First post regarding the missing RuntimeException (Second post follows later after coding example...):
Interface:
| package org.esit.server.sessionbeans;
|
| import javax.ejb.Local;
|
| @Local
| public interface Blob {
|
| public boolean isAvailable();
|
| public void raiseBlob();
|
| public void observeBlob();
|
| public void destroy();
|
| }
|
SessionBean:
| package org.esit.server.sessionbeans;
|
| import javax.ejb.Remove;
| import javax.ejb.Stateful;
|
| import org.jboss.seam.annotations.Begin;
| import org.jboss.seam.annotations.End;
| import org.jboss.seam.annotations.In;
| import org.jboss.seam.annotations.Name;
| import org.jboss.seam.annotations.Observer;
| import org.jboss.seam.core.Events;
| import org.jboss.seam.faces.FacesMessages;
|
| @Stateful
| @Name("blob")
| public class BlobAction implements Blob {
|
| @In FacesMessages facesMessages;
|
| @In Events events;
|
| public boolean isAvailable() {
| boolean out = true;
| facesMessages.add("isAvailable(): #0", out);
| return out;
| }
|
| @Begin
| @End
| public void raiseBlob() {
| facesMessages.add("raiseEvent() called");
| events.raiseAsynchronousEvent("blob");
| }
|
| @Observer("blob")
| public void observeBlob() {
| System.out.println("blob");
| throw new RuntimeException("blob");
| }
|
| @Remove
| public void destroy() { }
| }
|
|
Called by blob.xhtml (seam generated and edited)
| <!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
| "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
| <ui:composition xmlns="http://www.w3.org/1999/xhtml"
| xmlns:s="http://jboss.com/products/seam/taglib"
| xmlns:ui="http://java.sun.com/jsf/facelets"
| xmlns:f="http://java.sun.com/jsf/core"
| xmlns:h="http://java.sun.com/jsf/html"
| xmlns:rich="http://richfaces.ajax4jsf.org/rich"
| xmlns:a="https://ajax4jsf.dev.java.net/ajax"
| template="layout/template.xhtml">
|
| <ui:define name="body">
|
| <h:messages globalOnly="true" styleClass="message"/>
|
| <rich:panel>
| <f:facet name="header">blob</f:facet>
|
| <h:form id="blobActionForm">
|
| <h:commandButton id="isAvailable" value="isAvailable!"
| action="#{blob.isAvailable}"/>
|
| <h:commandButton id="raiseBlob" value="raiseBlob!"
| action="#{blob.raiseBlob}"/>
|
| </h:form>
|
| </rich:panel>
|
| </ui:define>
|
| </ui:composition>
|
Fresh seam-gen project, no further configuration gives only following Server output on JBoss 4.2 (using Java 1.5 Beta 12 and Seam 2.0 Beta1):
| ...
| 23:31:40,437 INFO [STDOUT] blob
| ...
|
But no sign of the RuntimeException. I tried to throw the RuntimeException in method raiseBlob() directly and voilá, there it is as expected.
Missing RuntimeException, where are you?
Note: Just tested without
| @Begin
| @End
|
with same effect
Greetz, GHad
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4077075#4077075
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4077075
18Â years, 8Â months