[Remoting] - Re: https with path and ejb3 can not be configured
by ron.sigal@jboss.com
Hi Rino
Are you still having problems with this issue? If so, I can tell you a couple of things that might help.
1. The problem in JBWS-1141 comes from the fact that Remoting versions 2.x require a call to org.jboss.remoting.Client.connect() before any calls to Client.invoke(), whereas earlier versions of Remoting didn't impose that requirement. The current version of EJB3 is compatible with Remoting 2.x. Perhaps you can upgrade to JBossAS 4.2, where this problem is solved.
2. Are you familiar with the "path" configuration attribute, which adds a path the the InvokerLocator:
| <attribute name="Configuration">
| <config>
| <invoker transport="socket">
| <attribute name="serverBindAddress">test.somedomain.com</attribute>
| <attribute name="serverBindPort">8084</attribute>
| <attribute name="path">foo/bar</attribute>
| </invoker>
| ...
|
3. How are you passing in the org.jboss.remoting.serverAuthMode parameter? You want it to be available to the client when it is creating its socket factory. You could do that by passing it in the configuration map to the client, e.g., new Client(locator, configuration). If you put it in an XML server configuration file, be sure to use the "isParam" attribute.
4.
anonymous wrote :
| It should be possible (according to the documentation) to pass in the client cofiguration through a URL parameter. However this results in an exception when starting up the server
|
What does your URL look like?
-Ron
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4043414#4043414
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4043414
19 years
[JBoss Seam] - problem with security and login
by mnrz
Hi
I have a problem with security.
I am using JBoss Seam 1.1.6
when I press login button I encounter following exception:
| ERROR Servlet.service() for servlet Faces Servlet threw exception
| javax.faces.FacesException: Error calling action method of component with id login:_id13
| at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:72)
| at javax.faces.component.UICommand.broadcast(UICommand.java:109)
| at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:97)
| at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:171)
| at org.apache.myfaces.lifecycle.InvokeApplicationExecutor.execute(InvokeApplicationExecutor.java:32)
| at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:95)
| at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:70)
| at javax.faces.webapp.FacesServlet.service(FacesServlet.java:139)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:100)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:147)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at org.jboss.seam.servlet.SeamRedirectFilter.doFilter(SeamRedirectFilter.java:29)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at org.jboss.seam.servlet.SeamCharacterEncodingFilter.doFilter(SeamCharacterEncodingFilter.java:41)
| 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.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.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
| at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
| at java.lang.Thread.run(Thread.java:595)
| Caused by: javax.faces.el.EvaluationException: /pages/main/login.xhtml @35,71 action="#{identity.login}": java.lang.IllegalStateException: no security rule base available - please install a RuleBase with the name 'securityRules'
| at com.sun.facelets.el.LegacyMethodBinding.invoke(LegacyMethodBinding.java:73)
| at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:61)
| ... 33 more
| Caused by: java.lang.IllegalStateException: no security rule base available - please install a RuleBase with the name 'securityRules'
| at org.jboss.seam.security.Identity.assertSecurityContextExists(Identity.java:276)
| at org.jboss.seam.security.Identity.populateSecurityContext(Identity.java:245)
| at org.jboss.seam.security.Identity.postAuthenticate(Identity.java:223)
| at org.jboss.seam.security.Identity.authenticate(Identity.java:207)
| at org.jboss.seam.security.Identity.authenticate(Identity.java:199)
| at org.jboss.seam.security.Identity.login(Identity.java:184)
| 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 com.sun.el.parser.AstValue.invoke(AstValue.java:151)
| at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:283)
| at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
| at com.sun.facelets.el.LegacyMethodBinding.invoke(LegacyMethodBinding.java:69)
| ... 34 more
|
|
and this is the authenticator class:
| @Name("authenticator")
| public class Authenticator {
|
| @PersistenceContext (unitName="SearchEngineDB")
| @In
| private EntityManager entityManager;
|
| @Out(required = false, scope = SESSION)
| private User user;
|
| @In
| private Identity identity;
|
| public boolean authenticate() {
| try{
| User user = (User) entityManager.createQuery(
| "from User where username = :username and password = :password")
| .setParameter("username", Identity.instance().getUsername())
| .setParameter("password", Identity.instance().getPassword())
| .getSingleResult();
|
|
| if (user.getRoles() != null)
| {
| for (UserRole mr : user.getRoles()){
| Identity.instance().addRole(mr.getRoleName());
| }
| }
| return true;
| }
| catch (NoResultException ex)
| {
| FacesMessages.instance().add("Invalid username/password");
| ex.printStackTrace();
| return false;
| }
| }
|
|
and security-rules.drl:
| package SearchEnginePermissions;
|
| import java.security.Principal;
|
| import org.jboss.seam.security.PermissionCheck;
| import org.jboss.seam.security.Role;
|
| rule AdminIsAUser
| salience 10
| no-loop
| when
| Role(name == "admin")
| then
| assert(new Role("admin"));
| end;
|
component.xml:
| <?xml version="1.0" encoding="UTF-8"?>
| <components xmlns="http://jboss.com/products/seam/components"
| xmlns:core="http://jboss.com/products/seam/core"
| xmlns:security="http://jboss.com/products/seam/security"
| xmlns:drools="http://jboss.com/products/seam/drools"
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
| xsi:schemaLocation=
| "http://jboss.com/products/seam/core http://jboss.com/products/seam/core-1.1.xsd
| http://jboss.com/products/seam/components http://jboss.com/products/seam/components-1.1.xsd
| http://jboss.com/products/seam/security http://jboss.com/products/seam/security-1.1.xsd
| http://jboss.com/products/seam/drools http://jboss.com/products/seam/drools-1.1.xsd">
|
|
| <core:init jndi-pattern="#{ejbName}/local" my-faces-lifecycle-bug="false" />
| <core:ejb installed="true"/>
|
| <core:manager conversation-timeout="1200000"
| concurrent-request-timeout="500"
| conversation-id-parameter="cid"
| conversation-is-long-running-parameter="clr"/>
|
| <security:identity authenticate-method="#{authenticator.authenticate}" />
| <drools:rule-base name="securityRules">
| <drools:rule-files><value>/META-INF/security-rules.drl</value></drools:rule-files>
| </drools:rule-base>
|
| <component name="entityManager" auto-create="true" class="org.jboss.seam.core.ManagedPersistenceContext">
| <property name="persistenceUnitJndiName">java:/searchengineEntityManagerFactory</property>
| </component>
|
|
| </components>
|
|
lots of Thanks
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4043412#4043412
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4043412
19 years
[JBoss Seam] - Re: Nested conversations and transaction management
by FabBoco
Christian,
anonymous wrote :
| Yes, you have a fuzzy picture about what system transactions are and now look for the wrong solutions. Seam and Java EE have _all_ options you need to handle transactions. Don't jump into the middle trying to use nested conversations, long-running persistence contexts, and complex EJB/transaction assemblies, without understanding the basics first.
|
let me say that it is too strong !!
You say, don't, don't, don't ....
This is what I am trying to do
anonymous wrote :
| What I am trying to do is very simple:
|
| 1) I start an input form for the Entity Bean A
|
| 2) From the input form I open a pop up window in which I can choose items from EB B or I can create new items
|
| 3) When I close the pop up the A form is update (so that the back entity bean)
|
| 4) If I cancel the operation I would like that the B items would not be saved to the database
|
It's fuzzy ?
In my fuzzy understanding of transactions I know that, if all the previous operations are performed into ONE SINGLE transaction (system, database, whatever you like to call) I can cancel the operation and have the database in a consistent state.
Nothing more, nothing less.
anonymous wrote :
| Seam and Java EE have _all_ options you need to handle transactions.
|
Regards
Fab
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4043409#4043409
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4043409
19 years
[JBoss Seam] - Problem with s:convertEntity
by Seto
When I choose one of the category, nothing happen. But when i choose the no selection label, the form is submitted normally. Anyone could help me? Please, I'm waiting anxiously online now.
|
| <h:form>
| <s:validateAll>
| <h:messages globalOnly="true" />
| <h:panelGrid columns="2">
| <h:outputText value="tag />
| <h:inputText value="#{brand.tag}" required="true" />
| <h:outputText value="name" />
| <h:inputText value="#{brand.name}" required="true" />
| <h:outputText value="category" />
| <h:selectOneMenu value="#{brand.category}">
| <s:selectItems value="#{categoryList}" var="category"
| label="#{category.name}" noSelectionLabel="please choose" />
| <s:convertEntity />
| </h:selectOneMenu>
| </h:panelGrid>
| <h:commandButton value="new" action="#{brandHome.persist}"
| rendered="#{!brandHome.managed}" />
| <h:commandButton value="edit" action="#{brandHome.update}"
| rendered="#{brandHome.managed}" />
| <h:commandButton value="delete" action="#{brandHome.remove}"
| rendered="#{brandHome.managed}" />
| </s:validateAll>
| </h:form>
|
| @SuppressWarnings("unchecked")
| @Factory
| public void getCategoryList() {
| entityManager.clear();
| categoryList = entityManager.createQuery("from Category category")
| .getResultList();
| Contexts.getSessionContext().flush();
| }
|
| <factory name="brand" value="#{brandHome.instance}" />
| <fwk:entity-home name="brandHome"
| entity-class="com.hongyang.domain.directory.Brand" />
|
| @ManyToOne
| @JoinColumn(name = "category")
| private Category category = new Category();
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4043407#4043407
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4043407
19 years
[JCA/JBoss] - I can't see Conneciton Sharing happening .
by vickyk
I am making the <res-sharing-scope>Unshareable</res-sharing-scope> in the web.xml file , here goes the code .<resource-ref>
| <description>DB Connection</description>
| <res-ref-name>jdbc/testDS</res-ref-name>
| <res-type>javax.sql.DataSource</res-type>
| <res-auth>Container</res-auth>
| <res-sharing-scope>Unshareable</res-sharing-scope>
| </resource-ref>
I have a jsp which does the following
InitialContext ctx = new InitialContext();
| DataSource ds = (DataSource)ctx.lookup("java:comp/env/jdbc/testDS");
| UserTransaction utx = (UserTransaction)ctx.lookup("UserTransaction");
| utx.begin();
| Connection con = ds.getConnection();
| out.println("First Connection --> "+con.toString()+"<br>");
| WrappedConnection unlycon = (WrappedConnection)con;
| out.println(unlycon.getUnderlyingConnection()+"<br>");
| Connection con1 = ds.getConnection();
| WrappedConnection unlycon1 = (WrappedConnection)con1;
| out.println(unlycon1.getUnderlyingConnection()+"<br>");
| out.println("Second Connection"+con1);
| utx.commit();
| con.close();
| con1.close();
And I see the following result First Connection --> org.jboss.resource.adapter.jdbc.WrappedConnection@4e9bea
| org.hsqldb.jdbc.jdbcConnection@169674
| org.hsqldb.jdbc.jdbcConnection@169674
| Second Connectionorg.jboss.resource.adapter.jdbc.WrappedConnection@de3c87
Since the resource sharing is defined as Unsharable I was expecting the underlying connection reference as different but it is not .
Am I missing some thing here ?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4043406#4043406
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4043406
19 years