[JBoss Seam] - @Out frustration
by texan
I can't get @Out to work as I expected. I'm just testing a trivial stateless session bean with a trivial page. I create a bean, outject it, and try to display its attribute on the page.
The problem is, the bean never makes into the scope that the page is rendered under. If I view "debug.seam", there are no beans in any scope (other than the definitions in the application scope).
However, if I add "(scope=ScopeType.SESSION)" tothe @Out tag, all is well.
I tried other scopes like EVENT and PAGE with no success. How do I simply outject a bean to the page that I'm displaying??? I don't want it in SESSION scope, and there's no value in a conversation in this case.
Here is my code. Let me know if you need my vast array of config files..
package mypackage;
|
| import javax.ejb.Local;
|
| @Local
| public interface Test {
|
| public String view();
| }
package mypackage;
|
| import javax.ejb.Stateless;
|
| import org.jboss.seam.ScopeType;
| import org.jboss.seam.annotations.Name;
| import org.jboss.seam.annotations.Out;
|
| @Name("test")
| @Stateless
| public class TestAction implements Test {
|
| @Out
| private Bean bean;
|
| public TestAction() {
| }
|
| public String view() {
| bean = new Bean("I am a bean");
| return "/test.xhtml";
| }
|
| }
package mypackage;
|
| import org.jboss.seam.annotations.Name;
|
| @Name("bean")
| public class Bean {
|
| private String name;
|
| public Bean() {
|
| }
|
| public Bean(String name) {
| this();
| setName(name);
| }
|
| public String getName() {
| return this.name;
| }
|
| public void setName(String name) {
| this.name = name;
| }
|
| }
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets"
| xmlns:s="http://jboss.com/products/seam/taglib" xmlns:t="http://myfaces.apache.org/tomahawk"
| xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" prefix="h"
| xmlns:c="http://java.sun.com/jstl/core" xmlns:fn="http://java.sun.com/jsp/jstl/functions">
|
| <body>
| <h:form>
| <h:inputText value="#{bean.name}" />
| <s:link linkStyle="button" action="#{test.view}" value="View" />
| </h:form>
| </body>
| </html>
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3970151#3970151
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3970151
19 years, 7 months
[JBoss Messaging] - Sending to a remote JMS queue - [ConnectionAspect] Caught ex
by bport
Hello.
I realize this may be a JBoss Remoting issue, please tell me if it is, but I decided to post here because it may be an issue with the config for JBoss Messaging (the lines get blurry).
I have just upgraded my jboss-4.0.4.GA installations with jboss-messaging-1.0.1.CR4. I have used the default installation configuration - with one caveat - I had to remove the jboss-aop.jar file from the SAR, as I was getting ClassCast exceptions, since I already had jboss-aop from the ejb3 install.
My scenario is this: I send a message to a queue on a remote server that is configured as above. (The client is an app running from within JBoss). The message is received, and everything appears to be sucessful. A few seconds later, I receive the following message in the server.log:
ERROR [ConnectionAspect] Caught exception from connection
java.lang.NullPointerException
at org.jboss.remoting.ConnectionValidator.run(ConnectionValidator.java:1
14)
at java.util.TimerThread.mainLoop(Timer.java:512)
at java.util.TimerThread.run(Timer.java:462)
My remoting-server.xml is the default:
<server>
|
| <mbean code="org.jboss.remoting.transport.Connector"
| name="jboss.messaging:service=Connector,transport=socket"
| display-name="Socket transport Connector">
| <attribute name="Configuration">
| <config>
| <invoker transport="socket">
| <attribute name="marshaller" isParam="true">org.jboss.jms.server.remoting.JMSWireFormat</attribute>
| <attribute name="unmarshaller" isParam="true">org.jboss.jms.server.remoting.JMSWireFormat</attribute>
| <attribute name="serializationtype" isParam="true">jboss</attribute>
| <attribute name="dataType" isParam="true">jms</attribute>
| <attribute name="socket.check_connection" isParam="true">false</attribute>
| <attribute name="timeout">0</attribute>
| <attribute name="serverBindAddress">${jboss.bind.address}</attribute>
| <attribute name="serverBindPort">4457</attribute>
| <attribute name="leasePeriod">20000</attribute>
| </invoker>
| <handlers>
| <handler subsystem="JMS">org.jboss.jms.server.remoting.JMSServerInvocationHandler</handler>
| </handlers>
| </config>
| </attribute>
| <depends>jboss.messaging:service=NetworkRegistry</depends>
| </mbean>
|
| <!-- TODO: Do I need this> -->
| <mbean code="org.jboss.remoting.network.NetworkRegistry"
| name="jboss.messaging:service=NetworkRegistry"/>
|
| </server>
|
and the code making the call looks like:
QueueConnection cnn = null;
| try {
| cnn = remoteFactory.createQueueConnection();
| QueueSession remoteSess =
| cnn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
| QueueSender remoteSender = remoteSess.createSender(remoteQueue);
| ObjectMessage obj = remoteSess.createObjectMessage();
| obj.setObject(theLog);
| remoteSender.send(obj);
| }
| finally {
| if (cnn != null) {
| cnn.close();
| }
| }
|
- where remoteFactory has been looked up from an InitialContext with an environment pointing it to the remote server.
Thanks for any help!
-brad
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3970150#3970150
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3970150
19 years, 7 months
[Security & JAAS/JBoss] - Re: Not able to authenticate against ActiveDirectory using L
by rknechtel
I'm having similar issues trying to connect to Active Directory using LDAP with JBoss.
The username is valid in AD I can login to a windows box that authenticates against the AD server.
jboss-web.xml
<?xml version="1.0" encoding="UTF-8"?>
<jboss-web>
<security-domain flushOnSessionInvalidation="false">java:/jaas/MyApp-ldap</security-domain>
<context-root>/MyApp</context-root>
</jboss-web>
web.xml
<security-constraint>
<display-name>Restrict SEAM pages</display-name>
<web-resource-collection>
<web-resource-name>SEAM</web-resource-name>
<url-pattern>*.seam</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>system</role-name>
<role-name>purch-buyer</role-name>
<role-name>purch-iss</role-name>
<role-name>purch-dataentry</role-name>
<role-name>purch-tech</role-name>
<role-name>accounting</role-name>
<role-name>asd</role-name>
<role-name>ccc_ops</role-name>
<role-name>warehouse</role-name>
<role-name>liquidation</role-name>
</auth-constraint>
</security-constraint><?xml version="1.0" encoding="UTF-8"?>
<jboss-web>
<security-domain flushOnSessionInvalidation="false">java:/jaas/MyApp-ldap</security-domain>
<context-root>/MyApp</context-root>
</jboss-web>
<security-role>
<role-name>system</role-name>
</security-role>
<security-role>
<role-name>purch-buyer</role-name>
</security-role>
<security-role>
<role-name>purch-iss</role-name>
</security-role>
<security-role>
<role-name>purch-dataentry</role-name>
</security-role>
<security-role>
<role-name>purch-tech</role-name>
</security-role>
<security-role>
<role-name>accounting</role-name>
</security-role>
<security-role>
<role-name>asd</role-name>
</security-role>
<security-role>
<role-name>ccc_ops</role-name>
</security-role>
<security-role>
<role-name>warehouse</role-name>
</security-role>
<security-role>
<role-name>liquidation</role-name>
</security-role>
<login-config>
<auth-method>FORM</auth-method>
<realm-name>MyApp-ldap</realm-name>
<form-login-config>
<form-login-page>/login.html</form-login-page>
<form-error-page>/loginError.html</form-error-page>
</form-login-config>
</login-config>
login-config.xml
<application-policy name="MyApp-ldap">
<login-module code="org.jboss.security.auth.spi.LdapExtLoginModule" flag="required" >
<!--
Some AD configurations may require searching against
the Global Catalog on port 3268 instead of the usual
port 389. This is most likely when the AD forest
includes multiple domains.
-->
<module-option name="java.naming.provider.url">ldap://server:389</module-option>
<module-option name="bindDN">administrator</module-option>
<module-option name="bindCredential">[PASSWORD]</module-option>
<module-option name="baseCtxDN">cn=users,dc=domain1.domain2,dc=local</module-option>
<module-option name="baseFilter">(sAMAccountName={0})</module-option>
<module-option name="rolesCtxDN">cn=users,dc=domain1.domain2,dc=local</module-option>
<module-option name="roleFilter">(sAMAccountName={0})</module-option>
<module-option name="roleAttributeID">memberOf</module-option>
<module-option name="roleAttributeIsDN">true</module-option>
<module-option name="roleNameAttributeID">cn</module-option>
<module-option name="roleRecursion">-1</module-option>
<module-option name="searchScope">ONELEVEL_SCOPE</module-option>
</login-module>
</application-policy>
ERROR when Logging in:
2006-09-07 08:41:15,051 DEBUG [org.jboss.security.plugins.JaasSecurityManager.MyApp-ldap] CallbackHandler: org.jboss.security.auth.callback.SecurityAssociationHandler@1669e7f
2006-09-07 08:41:15,051 DEBUG [org.jboss.security.plugins.JaasSecurityManagerService] Created securityMgr=org.jboss.security.plugins.JaasSecurityManager@2fc45d
2006-09-07 08:41:15,052 DEBUG [org.jboss.security.plugins.JaasSecurityManager.MyApp-ldap] CachePolicy set to: org.jboss.util.TimedCachePolicy@4ec21
2006-09-07 08:41:15,052 DEBUG [org.jboss.security.plugins.JaasSecurityManagerService] setCachePolicy, c=org.jboss.util.TimedCachePolicy@4ec21
2006-09-07 08:41:15,052 DEBUG [org.jboss.security.plugins.JaasSecurityManagerService] Added MyApp-ldap, org.jboss.security.plugins.SecurityDomainContext@12a9eda to map
2006-09-07 08:41:15,136 DEBUG [org.jboss.security.auth.spi.LdapExtLoginModule] Bad password for username=johndoe
javax.naming.AuthenticationException: [LDAP: error code 49 - 80090308: LdapErr: DSID-0C090334, comment: AcceptSecurityContext error, data 525, vece]
at com.sun.jndi.ldap.LdapCtx.mapErrorCode(LdapCtx.java:2985)
at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2931)
at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2732)
at com.sun.jndi.ldap.LdapCtx.connect(LdapCtx.java:2646)
at com.sun.jndi.ldap.LdapCtx.(LdapCtx.java:283)
at com.sun.jndi.ldap.LdapCtxFactory.getUsingURL(LdapCtxFactory.java:175)
at com.sun.jndi.ldap.LdapCtxFactory.getUsingURLs(LdapCtxFactory.java:193)
at com.sun.jndi.ldap.LdapCtxFactory.getLdapCtxInstance(LdapCtxFactory.java:136)
at com.sun.jndi.ldap.LdapCtxFactory.getInitialContext(LdapCtxFactory.java:66)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247)
at javax.naming.InitialContext.init(InitialContext.java:223)
at javax.naming.ldap.InitialLdapContext.(InitialLdapContext.java:134)
at org.jboss.security.auth.spi.LdapExtLoginModule.constructInitialLdapContext(LdapExtLoginModule.java:487)
at org.jboss.security.auth.spi.LdapExtLoginModule.createLdapInitContext(LdapExtLoginModule.java:331)
at org.jboss.security.auth.spi.LdapExtLoginModule.validatePassword(LdapExtLoginModule.java:229)
at org.jboss.security.auth.spi.UsernamePasswordLoginModule.login(UsernamePasswordLoginModule.java:210)
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:585)
at javax.security.auth.login.LoginContext.invoke(LoginContext.java:769)
at javax.security.auth.login.LoginContext.access$000(LoginContext.java:186)
at javax.security.auth.login.LoginContext$4.run(LoginContext.java:683)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.login.LoginContext.invokePriv(LoginContext.java:680)
at javax.security.auth.login.LoginContext.login(LoginContext.java:579)
at org.jboss.security.plugins.JaasSecurityManager.defaultLogin(JaasSecurityManager.java:601)
at org.jboss.security.plugins.JaasSecurityManager.authenticate(JaasSecurityManager.java:535)
at org.jboss.security.plugins.JaasSecurityManager.isValid(JaasSecurityManager.java:344)
at org.jboss.web.tomcat.security.JBossSecurityMgrRealm.authenticate(JBossSecurityMgrRealm.java:491)
at org.apache.catalina.authenticator.FormAuthenticator.authenticate(FormAuthenticator.java:257)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:416)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
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:869)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
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)
Anyone have any ideas or run into this error? If so how did you fix it?
Thanks,
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3970147#3970147
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3970147
19 years, 7 months