[JBoss Seam] - Re: Forced login?
by KnisterPeter
I have a similar request for my page navigation. We have two login pages in our project.
There is a registration page which does not require login, but when the user registers successful, then no login should be required. Also there should be a login page for already registered users.
I've defined my pages.xml as follows:
<?xml version="1.0" encoding="UTF-8"?>
| <!DOCTYPE pages PUBLIC
| "-//JBoss/Seam Pages Configuration DTD 1.2//EN"
| "http://jboss.com/products/seam/pages-1.2.dtd">
| <pages login-view-id="/login.xhtml">
|
| <page view-id="/login.xhtml" login-required="false">
| <param name="c" value="#{campaign.id}" />
|
| <action if="#{validation.succeeded}"
| execute="#{identity.login()}" />
|
| <navigation>
| <rule if="#{identity.loggedIn}">
| <redirect view-id="/invite.xhtml" />
| </rule>
| </navigation>
| </page>
|
| <page view-id="/register.xhtml" login-required="false">
| <param name="c" value="#{campaign.id}" />
|
| <action if="#{validation.succeeded}"
| execute="#{register.register(person)}" />
| </page>
|
| <page view-id="*" login-required="true">
| <navigation from-action="#{identity.logout()}">
| <redirect view-id="/login.xhtml" />
| </navigation>
| </page>
|
| <exception class="org.jboss.seam.security.NotLoggedInException">
| <redirect view-id="/login.xhtml">
| <message severity="warn">Please login first.</message>
| </redirect>
| </exception>
|
| </pages>
|
But the register.xhtml page does redirect to the login.xhtml page... Any ideas?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4054727#4054727
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4054727
18Â years, 10Â months
[EJB/JBoss] - Can't lookup queue/B
by happytour
Greetings,
In a simple JMS producer I'm doing the following
InitialContext ctx = new InitialContext();
| Queue q = (Queue)ctx.lookup ("queue/B");
This raises the following exception:
Exception in thread "main" javax.naming.CommunicationException [Root exception is java.rmi.NoSuchObjectException: no such object in table]
| at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:722)
| at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
| at javax.naming.InitialContext.lookup(InitialContext.java:351)
| at ro.happytour.happyledger.jms.client.JMSProviderClient.main(JMSProviderClient.java:11)
| Caused by: java.rmi.NoSuchObjectException: no such object in table
Could anybody please help ?
Kind regards,
Nicolas
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4054723#4054723
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4054723
18Â years, 10Â months
[JBossWS] - Re: WebServiceRef injection does not work
by gsferraï¼ imnet.it
anonymous wrote :
| To me it look like the wsrunclient simply provides a classpath for simple (i.e. Service.create) invocations
|
I have problems with Service.create() too using JBoss 4.0.5GA, latest EJB3 and JBossWS packages.
When I start my client I catch the following exception:
| javax.xml.ws.WebServiceException: java.lang.IllegalArgumentException: Cannot obt
| ain wsdl service: HelloService
| at javax.xml.ws.Service.create(Service.java:731)
| at com.imnet.oam.ws.HelloClient.<init>(HelloClient.java:13)
| at com.imnet.oam.ws.HelloClient.main(HelloClient.java:27)
| Caused by: java.lang.IllegalArgumentException: Cannot obtain wsdl service: Hello
| Service
| at org.jboss.ws.metadata.builder.jaxws.JAXWSClientMetaDataBuilder.buildM
| etaDataInternal(JAXWSClientMetaDataBuilder.java:131)
| at org.jboss.ws.metadata.builder.jaxws.JAXWSClientMetaDataBuilder.buildM
| etaData(JAXWSClientMetaDataBuilder.java:85)
| at org.jboss.ws.core.jaxws.spi.ServiceDelegateImpl.<init>(ServiceDelegat
| eImpl.java:140)
| at org.jboss.ws.core.jaxws.spi.ProviderImpl.createServiceDelegate(Provid
| erImpl.java:61)
| at javax.xml.ws.Service.<init>(Service.java:83)
| at org.jboss.ws.core.jaxws.client.ServiceExt.<init>(ServiceExt.java:60)
| at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
|
| at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstruct
| orAccessorImpl.java:39)
| at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingC
| onstructorAccessorImpl.java:27)
| at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
| at javax.xml.ws.Service.create(Service.java:726)
| ... 2 more
|
This is the WSLD generated while deploying the EJB3 web service:
| <definitions name='HelloService' targetNamespace='http://mypc:8080' xmlns='http://schemas.xmlsoap.org/wsdl/' xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' xmlns:tns='http://mypc:8080' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
| <types>
| <xs:schema targetNamespace='http://mypc:8080' version='1.0' xmlns:xs='http://www.w3.org/2001/XMLSchema'>
| <xs:element name='sayHello' nillable='true' type='xs:string'/>
| <xs:element name='sayHelloResponse' nillable='true' type='xs:string'/>
| </xs:schema>
| </types>
| <message name='Hello_sayHello'>
| <part element='tns:sayHello' name='sayHello'/>
| </message>
| <message name='Hello_sayHelloResponse'>
| <part element='tns:sayHelloResponse' name='sayHelloResponse'/>
| </message>
| <portType name='Hello'>
| <operation name='sayHello' parameterOrder='sayHello'>
| <input message='tns:Hello_sayHello'/>
| <output message='tns:Hello_sayHelloResponse'/>
| </operation>
| </portType>
| <binding name='HelloBinding' type='tns:Hello'>
| <soap:binding style='document' transport='http://schemas.xmlsoap.org/soap/http'/>
| <operation name='sayHello'>
| <soap:operation soapAction=''/>
| <input>
| <soap:body use='literal'/>
| </input>
| <output>
| <soap:body use='literal'/>
| </output>
| </operation>
| </binding>
| <service name='HelloService'>
| <port binding='tns:HelloBinding' name='HelloPort'>
| <soap:address location='http://mypc:8080/HelloService/Hello'/>
| </port>
| </service>
| </definitions>
|
The client code follows:
| package org.me.ws;
|
| import java.net.URL;
| import javax.xml.namespace.QName;
| import javax.xml.ws.Service;
|
| public class HelloClient {
| private static final String SERVICE_NAME = "HelloService";
| private static final String WSDL_LOCATION = "http://mypc:8080/HelloService/HelloService?wsdl";
| private Service service;
|
| public HelloClient() throws Exception {
| service = Service.create(new URL(WSDL_LOCATION), new QName(SERVICE_NAME));
| }
|
| public String getMessage() {
| Hello hello = null;
|
| hello = service.getPort(Hello.class);
| return hello.sayHello("Jim");
| }
|
| public static void main(String[] args) {
| HelloClient client = null;
|
| try {
| client = new HelloClient();
| System.out.println(client.getMessage());
| } catch (Throwable t) {
| t.printStackTrace();
| }
| }
| }
|
and finally the service implementation class code follows:
| package com.imnet.oam.ws;
|
| import javax.jws.*;
| import javax.jws.soap.SOAPBinding;
| import javax.ejb.Stateless;
|
| @Stateless
| @WebService(name="Hello", targetNamespace="http://mypc:8080", serviceName="HelloService")
| @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
| public class Hello {
| private String message = new String("Hello, ");
|
| @WebMethod
| public String sayHello(String name) {
| return message + name + ".";
| }
| }
|
The WSDL file is easily accessible using the internet browser or throught the http://localhost:8080/jbossws/services links. I tried to call my service in many different way, changing it's name or targetName but the results are similar. Any ideas?
Thank you
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4054722#4054722
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4054722
18Â years, 10Â months
[JBoss Seam] - Session scoped component and usage
by miloslav.vlach
Hi all,
i have problem with SESSION scoped component.
I have an action which create one entity and add children to it. Name of the entity is ComponentLayout and I would like to this component exits until the save method is invoked.
But problem is: when I call the action addArticle and add article to the ComponentLayout the collection contains only one item.
The instance of the ComponentLayout is destroyed and new instance is created.
Can somebody help me ?
Thanks Mila
| @Name("componentLayoutAddAction")
| @Scope(ScopeType.SESSION)
| public class ComponentLayoutAddAction implements Serializable{
|
| /**
| *
| */
| private static final long serialVersionUID = 3749007088722731841L;
|
| @In
| Session ses;
|
| @Logger
| Log log;
|
| @DataModel
| List<ArticleLinker> articlesInComponent;
|
| @In(required = false)
| ViewArticle viewArticle;
|
| @In(required = false)
| ArticleLinker articleLinker;
|
| @In
| ComponentLayout componentLayout;
|
| @SuppressWarnings("unchecked")
| @Factory("articlesInComponent")
| public void init() {
| if (componentLayout == null)
| return;
| if (componentLayout.getArticles().size() > 0) {
| articlesInComponent = componentLayout.getArticles();
| }
|
| }
|
| public String addArticle() {
| log.info("adding article: #0", articleLinker);
|
| componentLayout.getArticles().add(articleLinker);
|
| articlesInComponent = null;
| return "success";
| }
|
| public String save() {
| log.info("saving component: #0", componentLayout);
| return "success";
| }
|
| public String remove() {
| log.info("removing article: #0", viewArticle);
| return "success";
| }
|
| @Destroy
| @Remove
| public void end() {
|
| }
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4054714#4054714
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4054714
18Â years, 10Â months