[JBoss Seam] - Re: foo.page.xml <action execute=...> never fires. Why?
by tynor
Ouch. I've debugged and found the problem. It turns out that the page is being initialized and then cached from a mention in pages.xml:
<page view-id="/home.xhtml">
| <restrict>#{(not empty authenticator.currentClient)}</restrict>
| </page>
Is this intentional? I'd have expected even views mentioned in pages.xml to load definitions out of foo.page.xml as well (with foo.page.xml overriding anything found in pages.xml). Is this behavior documented anywhere? The only mention I can find is in the reference manual where it just says:
anonymous wrote : If you have a lot of different page actions and page parameters, or even just a lot of navigation rules, you will
| almost certainly want to split the declarations up over multiple files. You can define actions and parameters for
| a page with the view id /calc/calculator.jsp in a resource named calc/calculator.page.xml. The root
| element in this case is the element, and the view id is implied:
|
(no warning to avoid definitions in both foo.page.xml and pages.xml).
I can work around by moving all the definitions from my foo.page.xml into pages.xml, but this feels error prone -- all of my restrict markup is in my pages.xml (most are wildcards, but a few pages are marked up explicitly), while most of my navigation and action markup is in foo.page.xml files -- until now I thought hey could all coexist. Now it would seem I need to choose one or the other...
As others have commented recently, a Seam "best practices" guide would sure be a nice thing to have so that we don't all have to stumble on simple stuff like this and debug the innards of the framework to determine why it's not working like we think it ought to.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4081838#4081838
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4081838
18 years, 7 months
[JBoss Seam] - bug in HEAD or am I doing something wrong?
by mwkohout
I'm getting a strange error:
from a facelet, I'm generating a bunch of action type links:
| <rich:dataTable value="#{studyHome.getAll().toArray()}" var="study">
| <rich:column>
| <f:facet name="header">Click To View</f:facet>
|
| <s:link value="View Study #{study.name}" action="#{viewStudyAction.viewStudy(study)}" >
| <a4j:actionparam name="studyID" value="#{study.id}"/>
| </s:link>
| </rich:column>
| </rich:dataTable>
|
when the user clicks the generated link, the app is supposed to call viewStudyAction.viewStudy(study), passing in the study to view.
in my app the viewStudy method is called, but the passed Study object is null for some reason. I don't know why.
FYI, I've got the generator of the list studyHome.getAll() annotated with @DataModel but it didn't work either way...
any ideas?
Thanks
Mike Kohout
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4081837#4081837
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4081837
18 years, 7 months
[JBoss Seam] - Usage of TimeZone in Seam 2.0
by tonylmai
I am migrating my apps from Seam 1.2.1GA to Seam 2.0 (last night build) and am running into a few exception. This particular one is about the new class org.jboss.seam.international.TimeZone.
In my code, I did the following in a component that has th @Startup declaration.
@Startup
| public class PostSalesManager {
| private java.util.TimeZone timeZone;
|
| @Create
| public void init() throws ServiceLocatorException, AuthenticationException, JMSException {
| ...
| timeZone = org.jboss.seam.international.TimeZone.instance();
| }
|
When the app came up, it threw the following exception:
anonymous wrote : 12:31:54,109 ERROR [[/postsales]] Exception sending context initialized event to listener instance of class org.jboss.seam.servlet.SeamListener
| java.lang.IllegalStateException: No active session context
| at org.jboss.seam.international.TimeZoneSelector.instance(TimeZoneSelector.java:107)
| at org.jboss.seam.international.TimeZone.getTimeZone(TimeZone.java:28)
Can someone help clarifying the usage of this new class?
Thanks
-tony
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4081835#4081835
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4081835
18 years, 7 months
[EJB/JBoss] - SSL EJB 3.0 invocation
by paul_da_programmer
Environment: JBoss 4.0.5.GA, Sun JDK jdk1.5.0_11
| C:\Paul\Projects\SSL-EJB\bin>run.bat -c ejb-server
| ===============================================================================
|
| JBoss Bootstrap Environment
|
| JBOSS_HOME: C:\Paul\Projects\SSL-EJB\bin\\..
|
| JAVA: C:\Program Files\Java\jdk1.5.0_11\bin\java
|
| JAVA_OPTS: -Dprogram.name=run.bat -server -Xms128m -Xmx512m -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.ser
| ver.gcInterval=3600000 -Djavax.net.ssl.keyStore=C:/Paul/Projects/SSL-EJB/server/chap8.keystore -Djavax.net.ssl.keyStore
| Password=rmi+ssl -Djava.security.debug=access,failure
|
| CLASSPATH: C:\Program Files\Java\jdk1.5.0_11\lib\tools.jar;C:\Paul\Projects\SSL-EJB\bin\\run.jar
|
| ===============================================================================
|
I've tried in vain to get SSL invocation of EJB 3.0 session beans working.
I've successfully followed the guide located here:
http://docs.jboss.org/jbossas/jboss4guide/r3/html/ch8.chapter.html#d0e20905
and gotten their EJB 2.x example working both from an J2SE example and another JBoss server as clients.
I cannot get the exact same example working when updating the SLSB to EJB3.0
Here are my changes:
The EJB interface
| package org.jboss.chap8.ex4;
|
| /**
| *
| * @author Scott.Stark(a)jboss.org
| * @version $Revision: 1.1 $
| */
| public interface Echo
| {
| public String echo(String arg);
| }
|
The EJB impl
| package org.jboss.chap8.ex4;
|
| import static javax.ejb.TransactionAttributeType.REQUIRED;
| import static javax.ejb.TransactionAttributeType.SUPPORTS;
| import static javax.ejb.TransactionManagementType.CONTAINER;
|
| import java.util.List;
|
| import javax.annotation.security.PermitAll;
| import javax.ejb.Local;
| import javax.ejb.Remote;
| import javax.ejb.TransactionManagement;
| import javax.persistence.EntityManager;
| import javax.persistence.NoResultException;
| import javax.persistence.PersistenceContext;
|
| import org.apache.log4j.Logger;
| import org.jboss.annotation.ejb.LocalBinding;
| import org.jboss.annotation.ejb.RemoteBinding;
|
| @javax.ejb.Stateless
| @Local( {Echo.class})
| @LocalBinding(jndiBinding = "local/EchoBean4")
| @Remote( {Echo.class})
| @RemoteBinding(clientBindUrl="sslsocket://0.0.0.0:3873", jndiBinding="EchoBean4")
| @TransactionManagement(CONTAINER)
| @PermitAll
| public class EchoBean implements Echo
| {
| private static final Logger LOG = Logger.getLogger(EchoBean.class);
|
| public String echo(String arg)
| {
| LOG.debug("echo, arg="+arg);
| return arg;
| }
| }
|
The Client
| package org.jboss.chap8.ex4;
|
| import java.rmi.RemoteException;
| import java.security.Security;
| import javax.naming.InitialContext;
|
| import org.apache.log4j.BasicConfigurator;
| import org.apache.log4j.Category;
| import org.apache.log4j.Priority;
|
| import org.jboss.logging.XLevel;
| import java.util.Properties;
| import javax.naming.Context;
|
|
| /**
| *
| * @author Scott.Stark(a)jboss.org
| * @version $Revision: 1.1 $
| */
| public class ExClient
| {
| public static void main(String args[]) throws Exception
| {
| // Install the Sun JSSE provider since we may not have JSSE installed
| Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());
| // Configure log4j
| BasicConfigurator.configure();
| Category root = Category.getRoot();
| root.setLevel(XLevel.TRACE);
| Context iniCtx = new InitialContext();
| Object ref = iniCtx.lookup("EchoBean4");
| Echo echo = (Echo) ref;
| System.out.println("Created Echo");
| System.out.println("Created Echo");
| System.out.println("Echo.echo()#1 = "+echo.echo("This is call 1"));
| }
| }
|
I also removed EchoHome.java and ejb-jar.xml which are superfluous for EJB 3.0.
I get the following log on the server:
| 2007-09-06 15:02:09,949 DEBUG [org.jboss.ejb3.Ejb3Module] Started jboss.j2ee:service=EJB3,module=chap8-ex4.jar
| 2007-09-06 15:02:09,949 DEBUG [org.jboss.system.ServiceController] Starting dependent components for: jboss.j2ee:service=EJB3,module=chap8-ex4.jar dependent components: []
| 2007-09-06 15:02:09,949 INFO [org.jboss.ejb3.EJB3Deployer] Deployed: file:/C:/Paul/Projects/SSL-EJB/server/ejb-server/deploy/chap8-ex4.jar
| 2007-09-06 15:02:09,949 DEBUG [org.jboss.deployment.MainDeployer] End deployment start on package: chap8-ex4.jar
| 2007-09-06 15:02:09,949 DEBUG [org.jboss.deployment.MainDeployer] Deployed package: file:/C:/Paul/Projects/SSL-EJB/server/ejb-server/deploy/chap8-ex4.jar
| 2007-09-06 15:02:12,100 ERROR [org.jboss.remoting.transport.socket.SocketServerInvoker] Failed to accept socket connection
| java.lang.reflect.InvocationTargetException
| at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
| at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
| at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
| at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
| at org.jboss.remoting.transport.socket.ServerThread.createServerSocket(ServerThread.java:184)
| at org.jboss.remoting.transport.socket.ServerThread.<init>(ServerThread.java:86)
| at org.jboss.remoting.transport.socket.SocketServerInvoker.processInvocation(SocketServerInvoker.java:426)
| at org.jboss.remoting.transport.socket.SocketServerInvoker.run(SocketServerInvoker.java:388)
| at java.lang.Thread.run(Thread.java:595)
| Caused by: java.io.StreamCorruptedException: invalid stream header
| at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:764)
| at java.io.ObjectInputStream.<init>(ObjectInputStream.java:277)
| at org.jboss.remoting.loading.ObjectInputStreamWithClassLoader.<init>(ObjectInputStreamWithClassLoader.java:73)
| at org.jboss.remoting.serialization.impl.java.JavaSerializationManager.createInput(JavaSerializationManager.java:52)
| at org.jboss.remoting.transport.socket.ServerSocketWrapper.createInputStream(ServerSocketWrapper.java:56)
| at org.jboss.remoting.transport.socket.ClientSocketWrapper.createStreams(ClientSocketWrapper.java:76)
| at org.jboss.remoting.transport.socket.ClientSocketWrapper.<init>(ClientSocketWrapper.java:54)
| at org.jboss.remoting.transport.socket.ServerSocketWrapper.<init>(ServerSocketWrapper.java:50)
| ... 9 more
|
|
and the client hangs with this message
| run-example4:
| [copy] Copying 1 file to C:\Paul\Projects\SSL-EJB\server\ejb-server\deploy
| [echo] Waiting for 5 seconds for deploy...
| [java] created Initial Context
| [java] about to lookup
| [java] after to lookup
| [java] retrieved reference to EchoBean4: jboss.j2ee:jar=chap8-ex4.jar,name=EchoBean,service=EJB3
| [java] cast completed
| [java] Created Echo
| [java] Created Echo
| [java] 0 [main] DEBUG org.jboss.security.SecurityAssociation - Using ThreadLocal: false
| [java] 16 [main] TRACE org.jboss.security.SecurityAssociation - getPrincipal, principal=null
| [java] 125 [main] DEBUG org.jboss.remoting.Client - invoke called, but our invoker is disconnected, discarding and
| fetching another fresh invoker for: InvokerLocator [sslsocket://162.86.118.144:3873/]
| [java] 125 [main] DEBUG org.jboss.remoting.transport.socket.ssl.SSLSocketClientInvoker - connect called for: org.j
| boss.remoting.transport.socket.ssl.SSLSocketClientInvoker@18fd984
| [java] 125 [main] TRACE org.jboss.remoting.transport.socket.ssl.SSLSocketClientInvoker - 1) invoking =>org.jboss.r
| emoting.InvocationRequest@91cee with parameter: [advisedMethod=public abstract java.lang.String org.jboss.chap8.ex4.Echo
| .echo(java.lang.String), unadvisedMethod=public abstract java.lang.String org.jboss.chap8.ex4.Echo.echo(java.lang.String
| ), metadata=[metaData={REMOTING={INVOKER_LOCATOR=[type=AS_ISvalue=InvokerLocator [sslsocket://162.86.118.144:3873/]], SU
| BSYSTEM=[type=AS_ISvalue=AOP]}, DISPATCHER={OID=[type=AS_ISvalue=jboss.j2ee:jar=chap8-ex4.jar,name=EchoBean,service=EJB3
| ]}}], targetObject=null, arguments=[Ljava.lang.Object;@4a63d8]
| [java] 156 [main] TRACE org.jboss.remoting.transport.socket.ssl.SSLSocketClientInvoker - Creating socket number 0
| [java] 499 [main] TRACE org.jboss.remoting.serialization.impl.java.JavaSerializationManager - Creating ObjectOutpu
| tStream
| [java] 499 [main] TRACE org.jboss.remoting.serialization.impl.java.JavaSerializationManager - Creating ObjectInput
| StreamWithClassLoader
|
I've also tried
| @RemoteBinding(clientBindUrl="sslsocket://0.0.0.0:14445", jndiBinding="EchoBean4")
|
for the Bean implementation for which I get no log from the server and the client still hangs.
Is this issue related to a bug in JBoss remoting as described here:
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3972519#3972519
The solution described there is to 'upgrade to JBoss Remoting 2.0.0'. Can someone point me to a concise guide as to how to do this upgrade? Rebuilding JBoss is not going to be allowed ... I tried upping the lib/jboss-remoting.jar file and was met with failure.
Any help will be greatly appreciated ... at least confirmation that this is a JBoss remoting problem would help.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4081827#4081827
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4081827
18 years, 7 months