[JBoss Seam] - Re: Could not instantiate Seam component:
by pasmith
Hi Sateesh,
Thanks again for your reply.
I checked under the JNDIView service from the JMX Console and invoked the "list" operation. (Did I do that right?)
I looked under Global JNDI Namespace and got this:
| +- EventDispatcher (class: org.jboss.ws.eventing.mgmt.DispatcherDelegate)
| +- UserTransactionSessionFactory (proxy: $Proxy12 implements interface org.jboss.tm.usertx.interfaces.UserTransactionSessionFactory)
| +- console (class: org.jnp.interfaces.NamingContext)
| | +- PluginManager (proxy: $Proxy56 implements interface org.jboss.console.manager.PluginManagerMBean)
| +- UUIDKeyGeneratorFactory (class: org.jboss.ejb.plugins.keygenerator.uuid.UUIDKeyGeneratorFactory)
| +- HAPartition (class: org.jnp.interfaces.NamingContext)
| | +- DefaultPartition (class: org.jboss.ha.framework.server.HAPartitionImpl)
| +- HASessionState (class: org.jnp.interfaces.NamingContext)
| | +- Default (class: org.jboss.ha.hasessionstate.server.HASessionStateImpl)
| +- JAXR (class: org.apache.ws.scout.registry.ConnectionFactoryImpl)
| +- UserTransaction (class: org.jboss.tm.usertx.client.ClientUserTransaction)
| +- invokers (class: org.jnp.interfaces.NamingContext)
| | +- [computer name](class: org.jnp.interfaces.NamingContext)
| | | +- iiop (class: org.jboss.invocation.iiop.IIOPInvoker)
| +- jmx (class: org.jnp.interfaces.NamingContext)
| | +- invoker (class: org.jnp.interfaces.NamingContext)
| | | +- RMIAdaptor (proxy: $Proxy55 implements interface org.jboss.jmx.adaptor.rmi.RMIAdaptor,interface org.jboss.jmx.adaptor.rmi.RMIAdaptorExt)
| | +- rmi (class: org.jnp.interfaces.NamingContext)
| | | +- RMIAdaptor[link -> jmx/invoker/RMIAdaptor] (class: javax.naming.LinkRef)
| +- HiLoKeyGeneratorFactory (class: org.jboss.ejb.plugins.keygenerator.hilo.HiLoKeyGeneratorFactory)
|
I see no mention of my EJB or anything related to it.
Any more help is greately appreciated, as I am totally lost :(
Thanks agian.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3962335#3962335
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3962335
18 years, 6 months
[JBossWS] - JSR 181 EJB + WS Endpoint Authentication Problem
by sappenin
I'm encountering a strange authentication/authorization issue. I'm running JBAS 4.0.4GA_Patch1 and JBossWS1.0.2GA.
I have a JSR181 EJB endpoint exposed as a web-service.
My Port annotation looks thus:
@PortComponent(
transportGuarantee="NONE",
contextRoot = "/sample",
urlPattern="/InternalApi",
authMethod="BASIC"
)
I can access the Web-Service via a JSR109 client that is deployed on a separate jBoss machine (i.e., the client is a packaged jar file with application-client.xml, jaxrpc-mapping.xml, and jboss-client.xml, service-wsdl.xml. I access the client via JNDI lookup).
However, I can only access the web-service using my J2EE client as long as I package my wsdl file with the client jar.
I would like to be able to use the "wsdl-override" element of the jboss-client, so that the client simply downloads the wsdl from the remote server instead of referencing a file in my client deployment directory.
This is where things get sticky.
Option 1.) If, in my PortComponent, I have authMethod="BASIC", AND I use the jboss-client.xml "wsdl-override", then I get a 401 error saying that I am not authorized to view the wsdl (this despite specifiying a username/password in the WS Stub call). However, if I include my wsdl file in the client deployment, and don't try the "wsdl-override" trick, then everything works.
Option 2.) If, in my PortComponent, I have authMethod="NONE", then I get a 403 error, regardless of whether I use the "wsdl-override" or not.
Option 3.) If I omit the "authMethod" attribute entirely, and try to use the "wsdl-override" trick, then I can view the remote WSDL (for instance, via the web browser), but I get an javax.ejb.EJBAccessExcepion: authorization failure on my WebServices server (as one would expect, since my EJB's require a protected role), and a SOAP fault on the WS client.
In the end, it seems like my Stub Username/Password information is ignored whenever I try to use the "wsdl-override".
Is what I'm trying to do possible? I have seen hints in other forum posts (some people have decided to put the WSDL in a different, non-secure URL). However, in my case, I DO want the WSDL to be secured, along with the endpoint.
Any thoughts?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3962334#3962334
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3962334
18 years, 6 months
[JBoss Seam] - where is <h:inputText> going?
by dbatcn
I realize that this is probably a n00b mistake and if it were a snake it prob'ly woulda bit me, but I hope an answer to this will help others too. I've spent a couple of days on this but cannot see what's wrong; I tried to search for similar issues but didn't find anything and I don't see what's wrong with my example compared to the examples. I've got an abstracted example here, I hope it's not too long to post, but it should be complete.
I have a stateful session bean with scope defaulting to conversation that is backing a page with a couple of <h:inputText> fields that are bound to a couple of non-required bijected values, one being a String, the other a property of an entity bean. I'm using Seam-managed transactions and persistence context.
My problems are:
1. For an <h:inputText> whose value is the property of a conversation-scoped context variable managed by my SFSB, why is the property's setter never called with the value typed in? (in bqmgr.xhtml below, typing a new value for the field next to the button labeled "rename quux" and then pressing the button)
2. For an <h:inputText> whose value is a String conversation-scoped context variable managed by my SFSB, why is the variable null (and apparently not injected from the value typed in the form). (in bqmgr.xhtml below, typing in a value for the field next to the button "New Baz Specifying Name" and then pressing the button)
I'm using Seam with facelets and EJB3.
As always, apologies if I've somehow missed a previous post or piece of RTFM documentation.
Thanks,
David
bqmgr.xhtml
| <!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
| <html
| xmlns="http://www.w3.org/1999/xhtml"
| xmlns:f="http://java.sun.com/jsf/core"
| xmlns:h="http://java.sun.com/jsf/html"
| xmlns:s="http://jboss.com/products/seam/taglib"
| xmlns:ui="http://java.sun.com/jsf/facelets"
| >
| <head>
| <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
| <title>Baz/Quux Manager</title>
| </head>
| <body>
| <div class="errors"><h:messages globalOnly="true"/></div>
| <h:form>
| <s:link linkStyle="button" value="rename quux" action="#{bqManager.commitQuux}" />
| <h:inputText value="#{quux.name}" />
| </h:form>
| <h:form>
| <h:outputText value="you have no bazs"
| rendered="#{bazList.rowCount == 0}" />
| <h:dataTable var="baz" value="#{bazList}"
| rendered="#{bazList.rowCount > 0}">
| <h:column>
| <h:outputText value="#{1+bazList.rowIndex}. "/>
| <s:link value="delete" action="#{bqManager.deleteBaz}" linkStyle="button"/>
| <h:outputText value="#{baz.name}" />
| <br/>
| </h:column>
| </h:dataTable>
| <hr/>
| <s:link value="New Baz Specifying Name" action="#{bqManager.createBazSpecifyingName}" linkStyle="button" />
| <h:inputText value="#{namefornewbaz}"/>
| <hr/>
| <s:link value="New Baz" action="#{bqManager.createBaz}" linkStyle="button" />
| </h:form>
| </body>
| </html>
|
BQManagerBean.java
| package com.orgmob.play;
|
| import java.io.Serializable;
| import java.util.HashSet;
| import java.util.List;
|
| import javax.ejb.Remove;
| import javax.ejb.Stateful;
| import javax.persistence.EntityManager;
|
| import org.jboss.seam.annotations.Begin;
| import org.jboss.seam.annotations.Destroy;
| import org.jboss.seam.annotations.End;
| import org.jboss.seam.annotations.Factory;
| import org.jboss.seam.annotations.In;
| import org.jboss.seam.annotations.Logger;
| import org.jboss.seam.annotations.Name;
| import org.jboss.seam.annotations.Out;
| import org.jboss.seam.annotations.datamodel.DataModel;
| import org.jboss.seam.annotations.datamodel.DataModelSelection;
| import org.jboss.seam.core.FacesMessages;
| import org.jboss.seam.log.Log;
|
| @Stateful
| @Name("bqManager")
| public class BQManagerBean implements BQManager, Serializable {
|
| @Logger
| private Log log;
|
| @In(required=false) @Out(required=false)
| private Quux quux;
|
| @In(required=false) @Out(required=false)
| private String nameForNewBaz;
|
| @DataModel(value="bazList")
| private List<Baz> bazList;
|
| @DataModelSelection(value="bazList")
| @Out(required=false)
| private Baz baz;
|
| @In(create=true)
| private EntityManager orgmobDatabase;
|
| @In(create=true)
| private transient FacesMessages facesMessages;
|
| @Begin(join=true)
| @Factory("quux")
| public void findQuuxen() {
| log.debug("looking for quux objects...");
| List<Quux> quuxList = (List<Quux>)orgmobDatabase.createQuery(
| "from Quux quux order by quux.id asc").getResultList();
| log.debug("found "+quuxList.size()+" quuxs in quuxList: " + quuxList );
| if ( 0 == quuxList.size() ) {
| quux = new Quux();
| quux.setName( "quux1" );
| orgmobDatabase.persist( quux );
| orgmobDatabase.flush();
| log.debug( "created: "+quux);
| }
| else {
| quux = quuxList.get(0);
| log.debug( "found: "+quux);
| }
| }
|
| @Begin(join=true)
| @Factory("bazList")
| public void findBazs() {
| log.debug("looking for baz objects...");
| bazList = (List<Baz>)orgmobDatabase.createQuery(
| "from Baz baz order by baz.id asc").getResultList();
| log.debug("found "+bazList.size()+" bazs in bazList: " + bazList );
| }
|
| @End
| public void stop() {
| }
|
| private String newBazname() {
| // find a name not currently seen by user;
| HashSet<String> baznameS = new HashSet<String>();
| for ( Baz baz : bazList ) {
| baznameS.add( baz.getName() );
| }
| String baznamePrefix = "baz";
| String bazname;
| int attempt = 1;
| do {
| bazname = baznamePrefix + (attempt++);
| } while ( baznameS.contains( bazname ) );
| return bazname;
| }
|
| private void makeABaz( String name ) {
|
| baz = new Baz();
| baz.setName( name );
| orgmobDatabase.persist( baz );
| orgmobDatabase.flush();
|
| log.debug( "created: "+baz);
|
| findBazs(); // update bazList
| }
|
| public void createBaz() {
| makeABaz( newBazname() );
| }
|
| public void createBazSpecifyingName() {
| if ( null == nameForNewBaz ) {
| facesMessages.add("BQManagerBean.createBazSpecifyingName(): nameForNewBaz is null!");
| }
| makeABaz( nameForNewBaz );
| }
|
| public void commitQuux() {
| if ( null == quux ) {
| facesMessages.add("BQManagerBean.commitQuux() called but quux is null!");
| log.error("BQManagerBean.commitQuux() called but quux is null!");
| }
| else {
| log.debug("BQManagerBean.commitQuux(): pre-merge quux: "+quux);
| orgmobDatabase.merge( quux );
| orgmobDatabase.flush();
| }
| }
|
| public void commitBaz() {
| if ( null == baz ) {
| facesMessages.add("BQManagerBean.commitBaz() called but baz is null!");
| log.error("BQManagerBean.commitBaz() called but baz is null!");
| }
| else {
| log.debug("BQManagerBean.commitBaz(): pre-merge baz: "+baz);
| orgmobDatabase.merge( baz );
| orgmobDatabase.flush();
| }
| }
|
| public void deleteBaz() {
| if ( null == baz ) {
| facesMessages.add("BQManagerBean.deleteBaz() called but baz is null!");
| log.error("BQManagerBean.deleteBaz() called but baz is null!");
| }
| else {
| log.debug("removing "+baz+"...");
| orgmobDatabase.remove( baz );
| orgmobDatabase.flush();
| log.debug( "baz removed.");
| findBazs(); // update bazList
| }
| }
|
| @Destroy @Remove
| public void destroy() {
| }
|
| }
|
Baz.java
| package com.orgmob.play;
|
| import java.io.Serializable;
|
| import javax.persistence.Column;
| import javax.persistence.Entity;
| import javax.persistence.GeneratedValue;
| import javax.persistence.Id;
| import javax.persistence.Table;
|
| import org.jboss.seam.annotations.Name;
|
| @Entity
| @Name("baz")
| @Table(name="BAZS")
| public class Baz implements Serializable {
|
| private long id;
| private String name;
|
| @Id
| @Column(name="BAZ_ID")
| @GeneratedValue
| public Long getId() {
| return id;
| }
| public void setId(Long id) {
| this.id = id;
| }
|
| @Column(name="NAME")
| public String getName() {
| System.out.println("Baz.getName():returning:"+name);
| return name;
| }
| public void setName(String name) {
| System.out.println("Baz.setName():setting name to:"+name);
| this.name = name;
| }
|
| @Override
| public String toString() {
| return "Baz[" + name + "]";
| }
|
| }
|
Quux.java
| package com.orgmob.play;
|
| import java.io.Serializable;
|
| import javax.persistence.Column;
| import javax.persistence.Entity;
| import javax.persistence.GeneratedValue;
| import javax.persistence.Id;
| import javax.persistence.Table;
|
| import org.jboss.seam.annotations.Name;
|
| @Entity
| @Name("quux")
| @Table(name="QUUXS")
| public class Quux implements Serializable {
|
| private long id;
| private String name;
|
| @Id
| @Column(name="QUUX_ID")
| @GeneratedValue
| public Long getId() {
| return id;
| }
| public void setId(Long id) {
| this.id = id;
| }
|
| @Column(name="NAME")
| public String getName() {
| System.out.println("Quux.getName():returning:"+name);
| return name;
| }
| public void setName(String name) {
| System.out.println("Quux.setName():setting name to:"+name);
| this.name = name;
| }
|
| @Override
| public String toString() {
| return "Quux[" + name + "]";
| }
|
| }
|
BQManager.java
| package com.orgmob.play;
|
| import javax.ejb.Local;
|
| @Local
| public interface BQManager {
| public void findQuuxen();
| public void findBazs();
| public void stop();
| public void createBaz();
| public void createBazSpecifyingName();
| public void commitQuux();
| public void commitBaz();
| public void deleteBaz();
| public void destroy();
| }
|
persistence.xml
| <persistence>
| <persistence-unit name="orgmobDB">
| <provider>org.hibernate.ejb.HibernatePersistence</provider>
| <jta-data-source>java:/DefaultDS</jta-data-source>
| <properties>
| <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
| <property name="jboss.entity.manager.factory.jndi.name"
| value="java:/EntityManagerFactories/orgmobData" />
| </properties>
| </persistence-unit>
| </persistence>
|
components.xml
| <components>
| <component name="org.jboss.seam.core.init">
| <property name="myFacesLifecycleBug">true</property>
| <property name="jndiPattern">member/#{ejbName}/local</property>
| </component>
| <component class="org.jboss.seam.core.Ejb"
| installed="false"/>
| <component name="orgmobDatabase"
| class="org.jboss.seam.core.ManagedPersistenceContext">
| <property name="persistenceUnitJndiName">java:/EntityManagerFactories/orgmobData</property>
| </component>
| </components>
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3962327#3962327
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3962327
18 years, 6 months
[JBoss jBPM] - Re: Creating a timer doesn't save to the database
by brado
The code which wraps the execution of this business process saves the process instance both before the business process is executed and after. Here is the code:
| JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
| try {
| log.debug("[solicit]: Getting graph session.");
| GraphSession graphSession = jbpmContext.getGraphSession();
| log.debug("[solicit]: Finding process definition: Solicit");
| ProcessDefinition processDefinition = graphSession.findLatestProcessDefinition("Solicit");
| log.debug("[solicit]: Creating new process instance:Solicit");
| ProcessInstance processInstance = new ProcessInstance(processDefinition);
| // set variables
| log.debug("[solicit]: Creating new context instance.");
| ContextInstance ci = processInstance.getContextInstance();
| log.debug("[solicit]: Setting context instance variables.");
| ci.setVariable(PVAR_authenticationToken, securityToken);
| ci.setVariable(PVAR_request, request);
| ci.setVariable(PVAR_returnURL, returnURL);
| ci.setVariable(PVAR_bpparameters, parameters);
| log.debug("[solicit]: Saving process instance: Solicit");
| jbpmContext.save(processInstance);
| log.debug("[solicit]: Executing business process: Solicit");
| processInstance.signal();
| log.debug("[solicit]: Saving process instance: Solicit");
| jbpmContext.save(processInstance);
| String transactionId = (String) processInstance.getContextInstance().getVariable(PVAR_queryResult);
| log.info("[solicit]: Returning transactionId=" + transactionId);
| return transactionId;
| } catch (Exception ex) {
| Throwable cause = ex.getCause();
| if (cause != null && cause instanceof NodeException) {
| throw (NodeException) cause;
| }
| log.error("[solicit]: Unknown error occurred while trying to execute business process: Solicit", ex);
| throw new NodeException("Unknown error occurred while trying to execute business process: Solicit", ex, ErrorCode.Code.E_UNKNOWN_ERROR);
| } finally {
| jbpmContext.close();
| log.debug("[solicit]: Exit.");
| }
|
So I save the process instance prior, the business process which creates the timer and saves it to the scheduler is invoked, and the business process completes, and the process instance is saved again. Shouldn't this save the timer to the database?
Thanks,
Brad
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3962325#3962325
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3962325
18 years, 6 months