[JBoss Seam] - Re: SEAM don't can find session bean !!
by JohnBat26
I try recreate my project again. But SEAM don't find session bean afresh ! :(((((((((
This is my local interface:
--------------------------------
package org.it.itMail.service;
/**
* Local component interface for the UserManagerBean session bean.
*
*/
public interface UserManagerLocal
{
// ----------- Accessors For Constants ------------
// ------------ Business Methods -----------------
/**
*
*/
public java.util.List loadUsers();
}
-------------------------------------
This is my PARENT BEAN for session bean:
-------------------------------------
package org.it.itMail.service;
/**
* Autogenerated EJB session bean base class UserManagerBean.
*
*
*/
@javax.ejb.TransactionAttribute(javax.ejb.TransactionAttributeType.REQUIRED)
@javax.ejb.Local({org.it.itMail.service.UserManagerLocal.class})
@javax.ejb.Remote({org.it.itMail.service.UserManagerRemote.class})
public abstract class UserManagerBase
implements org.it.itMail.service.UserManagerLocal, org.it.itMail.service.UserManagerRemote
{
// ------ Session Context Injection ------
@javax.annotation.Resource
protected javax.ejb.SessionContext context;
// ------ Persistence Context Definitions --------
/**
* Inject persistence context itMail
*/
@javax.persistence.PersistenceContext(unitName = "itMail")
protected javax.persistence.EntityManager emanager;
// ------ DAO Injection Definitions --------
/**
* Inject DAO UserDao
*/
@javax.ejb.EJB
private org.it.itMail.domain.UserDao userDao;
// --------------- Constructors ---------------
public UserManagerBase()
{
super();
}
// ------ DAO Getters --------
/**
* Get the injected DAO UserDao
*/
protected org.it.itMail.domain.UserDao getUserDao()
{
return this.userDao;
}
// -------- Business Methods --------------
/**
*
*/
@javax.ejb.TransactionAttribute(javax.ejb.TransactionAttributeType.REQUIRED)
@org.jboss.seam.annotations.Begin
public java.util.List loadUsers()
{
try
{
return this.handleLoadUsers();
}
catch (Throwable th)
{
throw new org.it.itMail.service.UserManagerException(
"Error performing 'org.it.itMail.service.UserManager.loadUsers()' --> " + th,
th);
}
}
/**
* Performs the core logic for {@link #loadUsers()}
*/
protected abstract java.util.List handleLoadUsers()
throws java.lang.Exception;
// -------- Lifecycle Callbacks --------------
}
-------------------------------------
This is my session bean directly:
--------------------------------------
package org.it.itMail.service;
import java.util.List;
import org.it.itMail.domain.*;
import org.jboss.seam.annotations.datamodel.DataModel;
/**
* @see org.it.itMail.service.UserManagerBean
*/
/**
* Do not specify the javax.ejb.Stateless annotation
* Instead, define the session bean in the ejb-jar.xml descriptor
* @javax.ejb.Stateless
*/
/**
* Uncomment to enable webservices for UserManagerBean
*(a)javax.jws.WebService(endpointInterface = "org.it.itMail.service.UserManagerWSInterface")
*/
@javax.ejb.Stateless
@org.jboss.seam.annotations.Name("userManager")
public class UserManagerBean
extends org.it.itMail.service.UserManagerBase
{
// --------------- Constructors ---------------
@DataModel
private List < User > userList;
public UserManagerBean()
{
super();
}
// -------- Business Methods Impl --------------
/**
* @see org.it.itMail.service.UserManagerBase#loadUsers()
*/
protected java.util.List handleLoadUsers()
throws java.lang.Exception
{
userList = (List < User >) this.getUserDao().loadAll();
return null;
}
// -------- Lifecycle Callback Implementation --------------
}
---------------------------------------
This is piece JNDI view from JMX console:
-----------------------------------
+- itMail-0.1.0-SNAPSHOT (class: org.jnp.interfaces.NamingContext)
| +- Dispatcher (class: org.jnp.interfaces.NamingContext)
| | +- local (proxy: $Proxy106 implements interface org.jboss.seam.core.LocalDispatcher,interface org.jboss.ejb3.JBossProxy,interface javax.ejb.EJBLocalObject)
| +- UserDao (class: org.jnp.interfaces.NamingContext)
| | +- local (proxy: $Proxy95 implements interface org.it.itMail.domain.UserDao,interface org.jboss.ejb3.JBossProxy,interface javax.ejb.EJBLocalObject)
| +- UserManagerBean (class: org.jnp.interfaces.NamingContext)
| | +- local (proxy: $Proxy100 implements interface org.it.itMail.service.UserManagerLocal,interface org.jboss.ejb3.JBossProxy,interface javax.ejb.EJBLocalObject)
| | +- remote (proxy: $Proxy98 implements interface org.it.itMail.service.UserManagerRemote,interface org.jboss.ejb3.JBossProxy,interface javax.ejb.EJBObject)
| +- TransactionListener (class: org.jnp.interfaces.NamingContext)
| | +- localStatefulProxyFactory (class: org.jboss.ejb3.stateful.StatefulLocalProxyFactory)
| | +- local (class: java.lang.Object)
-----------------------------------
This is my xhtml:
------------------------------
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:s="http://jboss.com/products/seam/taglib"
xmlns:c="http://java.sun.com/jstl/core">
<h:form>
<h:outputText value="Welcome to JBoss SEAM+ Ajax4jsf+RichFaces"/>
<h:commandButton value="???????? ?????????????" action="#{userManager.loadUsers}"/>
</h:form>
------------------------------
This is piece log from JBoss:
-------------------------------------
...
01:38:32,384 INFO [Component] Component: userManager, scope: STATELESS, type: STATELESS_SESSION_BEAN, class: org.it.itMail.service.UserManagerBean, JNDI: itMail-0.1.0-SNAPSHOT/UserManagerBean/local
01:38:32,397 INFO [Lifecycle] starting up: org.jboss.seam.servlet.multipartFilter
01:38:32,398 INFO [Lifecycle] starting up: org.jboss.seam.servlet.exceptionFilter
01:38:32,402 INFO [Lifecycle] starting up: org.jboss.seam.ui.graphicImage.dynamicImageResource
01:38:32,402 INFO [Lifecycle] starting up: org.jboss.seam.servlet.redirectFilter
01:38:32,403 INFO [Lifecycle] starting up: org.jboss.seam.ui.resource.webResource
01:38:32,406 INFO [Initialization] done initializing Seam
01:38:32,466 ERROR [STDERR] 30.03.2007 1:38:32 com.sun.faces.config.ConfigureListener contextInitialized
INFO: Initializing Sun's JavaServer Faces implementation (1.2_04-b10-p01) for context 'it-mail'
01:38:32,834 ERROR [STDERR] 30.03.2007 1:38:32 com.sun.faces.spi.InjectionProviderFactory createInstance
INFO: JSF1048: PostConstruct/PreDestroy annotations present. ManagedBeans methods marked with these annotations will have said annotations processed.
01:38:33,695 INFO [SeamFilter] Initializing filter: org.jboss.seam.servlet.multipartFilter
01:38:33,695 INFO [SeamFilter] Initializing filter: org.jboss.seam.servlet.redirectFilter
01:38:33,695 INFO [SeamFilter] Initializing filter: org.jboss.seam.servlet.exceptionFilter
01:38:33,730 INFO [EARDeployer] Started J2EE application: file:/home/jee/jboss-4.0.5.GA/server/default/deploy/itMail-0.1.0-SNAPSHOT.ear/
01:38:33,792 INFO [Http11BaseProtocol] Starting Coyote HTTP/1.1 on http-0.0.0.0-8080
01:38:33,860 INFO [ChannelSocket] JK: ajp13 listening on /0.0.0.0:8009
01:38:33,873 INFO [JkMain] Jk running ID=0 time=0/37 config=null
01:38:33,880 INFO [Server] JBoss (MX MicroKernel) [4.0.5.GA (build: CVSTag=Branch_4_0 date=200610162339)] Started in 26s:257ms
...
1:39:12,257 ERROR [STDERR] 30.03.2007 1:39:12 com.sun.faces.lifecycle.InvokeApplicationPhase execute
WARNING: value of context variable is not an instance of the component bound to the context variable: userManager
java.lang.IllegalArgumentException: value of context variable is not an instance of the component bound to the context variable: userManager
at org.jboss.seam.Component.getInstance(Component.java:1655)
at org.jboss.seam.Component.getInstance(Component.java:1610)
at org.jboss.seam.Component.getInstance(Component.java:1604)
at org.jboss.seam.jsf.SeamELResolver.getValue(SeamELResolver.java:49)
at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:143)
at com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:64)
at com.sun.el.parser.AstIdentifier.getValue(AstIdentifier.java:68)
at com.sun.el.parser.AstValue.getTarget(AstValue.java:63)
at com.sun.el.parser.AstValue.invoke(AstValue.java:153)
at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:283)
at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:77)
at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:91)
at javax.faces.component.UICommand.broadcast(UICommand.java:383)
at org.ajax4jsf.framework.ajax.AjaxViewRoot.processEvents(AjaxViewRoot.java:180)
at org.ajax4jsf.framework.ajax.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:158)
at org.ajax4jsf.framework.ajax.AjaxViewRoot.processApplication(AjaxViewRoot.java:329)
at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:97)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:96)
at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:220)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:63)
at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:57)
at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
------------------------------------
HELP, PLEASE ...
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4032952#4032952
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4032952
17Â years, 9Â months
[JBossWS] - Re: WS-Security: keystores and truststores
by PeterJ
Another question. Let's say that Bob runs the web service and Alice has a client that uses the web service. Now John would also like to use the web service. John would create:
johns.keystore
----------------
john - keyPair (pub+priv)
bob - trustedCertEntry (pub)
johns.truststore
----------------
john - trustedCertEntry (just john's public key)
In addition, Bob's keystore would be updated to:
bobs.keystore
----------------
bob - keyPair (public + private key)
alice - trustedCertEntry (just alice's public key)
john - trustedCertEntry (just john's public key)
This does not pose a problem for encrypting the request from the client side since both Alice and John use Bob's public key to encrypt the message, and Bob of course uses his pirvate key to decrypt the message. But how is the response message encrypted? Bob would have to know who he is responding to and encrypt accordingly, but how would one specify this?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4032946#4032946
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4032946
17Â years, 9Â months
[JNDI/Naming/Network] - Re: JBOSS, datasource jndi?In the init() mothod of HttpServle
by jvorpahl
I know everyone who posted on this thread is probably long gone (since the thread was dated 2005) but I want to thank you guys for posting this. My company wanted to switch from a standalone Tomcat servlet container to JBoss because of the clustering package and the ability to go beyond 1 GB of memory for the JVM. This post is actually a thank you to the posters and a rant on the piss-poor qualiy of official documents and books that are out there for JBoss.
I started here 3 weeks ago in a developer/project management position and my large task was to set up 12 machines to run our Production and Staging environments. But the problem is I have exclusively used Web Sphere for the past 5 years, zero JBoss experience. To say the least, I was a bit nervous. I installed JBoss on Monday but the documentation is so rotten for JBoss (even the books written by the JBoss people) that it took me until today to get my JNDI lookups working. My boss thought I was useless, but nowhere did I ever come across a tag mentioned.
Everywhere they said just create this and that and everything will work. Nowhere did it say "if you can't bind to the DataSource you might want to make sure the DataSource is being deployed before your application is deployed by using the tag."
The books drill down to such details of other things, but totally skim over the details of initial configuration. They need to go into detail on the complicated things, but also go into detail about problems getting started. I'm sure if I would have read the whole book I would have came across this eventually, but really, when I find a document from HP (http://docs.hp.com/en/5991-5569/index.html) that is more informative and written better than the Official books, there is a problem.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4032945#4032945
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4032945
17Â years, 9Â months
[JBoss Portal] - JSF and Portal
by kreilly
In my portlet's edit mode, I let a user make some configuration selections. This is done using JSF. When the user submits the form, I would like to save that data using the PortalPreferences object. The problem I'm having is with JSF, I do not have a request object when my form is submitted (a plain method off a managed bean is called). Without a request object I can not get to the PortalPreferences object for this user. So my question is:
How do I get to JSF managed beans from the actionPerformed method?
Or
How do I get a request object from a method managed by JSF?
Or, if you know of a better way to handle JFS/Portal edit mode, feel free to offer suggestions.
Thanks.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4032942#4032942
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4032942
17Â years, 9Â months