[EJB 3.0] - Resource Injection
by mihochan
Hi,
I am having trouble with resource injection.I have defined a Mail Session
thus,
| <!-- Binds a javax.mail.Session object to JNDI name java:/LeadloaderMail -->
| <mbean code="org.jboss.mail.MailService"
| name="leadloading:service=LeadloaderMail,name=LeadloaderMail">
| <attribute name="JNDIName">LeadloaderMail</attribute>
| <attribute name="User">devcon2</attribute>
| <attribute name="Password">xxxxx</attribute>
| <attribute name="Configuration">
| <configuration>
| <property name="mail.store.protocol" value="imap"/>
| <property name="mail.transport.protocol" value="smtp"/>
| <property name="mail.user" value="devcon2"/>
| <property name="mail.imap.host" value="seth"/>
| <property name="mail.smtp.host" value="seth"/>
| <property name="mail.from" value="someone(a)somewhere.com"/>
| <property name="mail.debug" value="false"/>
| </configuration>
| </attribute>
| </mbean>
|
which I want to inject into an MBean. I have tried numerous variations on a theme but none seem to work. What is worse, they fail silently. What am I doing wrong?
The injection code I am using is thus;
| @Resource (mappedName="LeadloaderMail")
| Session session;
|
Any pointers would be greatly appreciated.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4009837#4009837
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4009837
19Â years, 2Â months
[JBoss Seam] - Identity.login adds a hardcoded message
by fernando_jmt
Hi.
I just try the Seam security, I did an authenticator something like this:
| public boolean authenticate(String username, String password, Set<String> roles) {
| try {
|
| User currentUser = (User) entityManager.createQuery("select u from User u where u.username=:username and u.password=:password")
| .setParameter("username", username)
| .setParameter("password", password)
| .getSingleResult();
|
| if (currentUser.getRoles() != null) {
| for (Role role : currentUser.getRoles())
| roles.add(role.getName());
| }
| facesMessages.addFromResourceBundle("User.loggedIn", new Object[]{currentUser.getFullName()});
| return true;
| }
| catch (NoResultException ex) {
| facesMessages.addFromResourceBundle("Login.error");
| return false;
| }
| }
|
I also created the respective page for this authentication. But when the authentication fails, I am getting two messages:
a) "Login.error" value (messages.properties)
b) Login failed (hardcoded).
Then I saw that in the Identity.java you have:
| public String login()
| {
| try
| {
| authenticate();
| log.debug("Login successful for: " + getUsername());
| return "success";
| }
| catch (LoginException ex)
| {
| log.debug("Login failed for:" + getUsername(), ex);
| FacesMessages.instance().add("Login failed");
| return null;
| }
| }
|
I think the line for "FacesMessages.instance().add("Login failed")" is not useful in the most cases, especially for i18n applications.
I suggest to:
a) remove this hardcode message
b) add the posibility to configure the respective i18n message.
I think the option a) is better. What do you think?
Thanks in advance.
Best regards.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4009822#4009822
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4009822
19Â years, 2Â months
[JBoss Portal] - Jboss Portal Insallation
by deepalip
I am new user of Jboss. I am trying to install the JbossPortal on Jboss AS 4.0.3
My AS seems to work fine as when i logon to
http://localhost:8080/ i see the default page set for the Jboss AS
I have downloded the binary version of the JbossPortal.
Copied the jboss-portal.sar and portal-mysql-ds.xml to the following folder
C:\Program Files\jboss-4.0.3SP1\server\default\deploy\
I have set the environment variable JBOSS_HOME
Now when i open http://localhost:8080/portal i get error
HTTP Status 500 -
--------------------------------------------------------------------------------
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
java.lang.NullPointerException
org.jboss.portal.core.impl.model.portal.PersistentPortalObjectContainer.getObject(PersistentPortalObjectContainer.java:153)
org.jboss.portal.core.impl.model.portal.PersistentPortalObjectContainer.getContext(PersistentPortalObjectContainer.java:171)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:585)
org.jboss.mx.interceptor.AttributeDispatcher.invoke(AttributeDispatcher.java:84)
org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
org.jboss.mx.interceptor.ModelMBeanAttributeInterceptor.invoke(ModelMBeanAttributeInterceptor.java:182)
org.jboss.mx.interceptor.PersistenceInterceptor.invoke(PersistenceInterceptor.java:61)
org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
org.jboss.mx.server.AbstractMBeanInvoker.getAttribute(AbstractMBeanInvoker.java:343)
org.jboss.mx.server.MBeanServerImpl.getAttribute(MBeanServerImpl.java:541)
org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:106)
$Proxy46.getContext(Unknown Source)
org.jboss.portal.core.model.portal.DefaultPortalCommandMapper.doMapping(DefaultPortalCommandMapper.java:86)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:585)
org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:118)
org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:127)
org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
$Proxy50.doMapping(Unknown Source)
org.jboss.portal.core.CoreController.handle(CoreController.java:189)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:585)
org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:118)
org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:127)
org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
org.jboss.mx.util.JMXInvocationHandler.invoke(JMXInvocationHandler.java:273)
$Proxy115.handle(Unknown Source)
org.jboss.portal.server.ServerInvocation.dispatch(ServerInvocation.java:76)
org.jboss.portal.server.invocation.Invocation.invokeNext(Invocation.java:140)
org.jboss.portal.core.aspects.server.SubjectAssociationInterceptor.invoke(SubjectAssociationInterceptor.java:47)
org.jboss.portal.server.ServerInterceptor.invoke(ServerInterceptor.java:38)
org.jboss.portal.server.invocation.Invocation.invokeNext(Invocation.java:130)
org.jboss.portal.core.aspects.server.PolicyAssociationInterceptor.invoke(PolicyAssociationInterceptor.java:52)
org.jboss.portal.server.ServerInterceptor.invoke(ServerInterceptor.java:38)
org.jboss.portal.server.invocation.Invocation.invokeNext(Invocation.java:130)
org.jboss.portal.server.aspects.server.ContentTypeInterceptor.invoke(ContentTypeInterceptor.java:68)
org.jboss.portal.server.ServerInterceptor.invoke(ServerInterceptor.java:38)
org.jboss.portal.server.invocation.Invocation.invokeNext(Invocation.java:130)
org.jboss.portal.core.aspects.server.LocaleInterceptor.invoke(LocaleInterceptor.java:69)
org.jboss.portal.server.ServerInterceptor.invoke(ServerInterceptor.java:38)
org.jboss.portal.server.invocation.Invocation.invokeNext(Invocation.java:130)
org.jboss.portal.core.aspects.server.UserInterceptor.invoke(UserInterceptor.java:184)
org.jboss.portal.server.ServerInterceptor.invoke(ServerInterceptor.java:38)
org.jboss.portal.server.invocation.Invocation.invokeNext(Invocation.java:130)
org.jboss.portal.server.aspects.server.SessionInvalidatorInterceptor.invoke(SessionInvalidatorInterceptor.java:87)
org.jboss.portal.server.ServerInterceptor.invoke(ServerInterceptor.java:38)
org.jboss.portal.server.invocation.Invocation.invokeNext(Invocation.java:130)
org.jboss.portal.core.aspects.server.TransactionInterceptor.invoke(TransactionInterceptor.java:75)
org.jboss.portal.server.ServerInterceptor.invoke(ServerInterceptor.java:38)
org.jboss.portal.server.invocation.Invocation.invokeNext(Invocation.java:130)
org.jboss.portal.server.invocation.Invocation.invoke(Invocation.java:175)
org.jboss.portal.server.servlet.PortalServlet.doGet(PortalServlet.java:221)
javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
What i steh reason for this error?
Is it necessary to have the database to complete the installation
--------Deepali
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4009815#4009815
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4009815
19Â years, 2Â months