[Security & JAAS/JBoss] - Basic question: what should LoginModule.login() return?
by SmokingAPipe
Looking at the javadocs for LoginModule.login(), it says it returns: "true if the authentication succeeded, or false if this LoginModule should be ignored."
Ok, this is quite ambiguous to me. "Authentication succeeded" could mean, "I was able to process the information correctly" or "I processed the information correctly, and the user is in fact authorized". I'm guessing the former, not the later, because it goes on to say, return false if this module is to be ignored.
It sounds like the login() method should ALWAYS return true from this. Then the commit() method can put no roles into the Subject, and in that case the user may be logged in but have no roles, so it can't do anything.
Or should the login() method return false? I have many methods of my beans that users can access without logging in. If my login method returns false will they still be able to access?
I'm confused by some of the docs on this.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4008190#4008190
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4008190
19 years, 2 months
[JBossWS] - A service endpoint interface should extend Remote
by erkinda
hi
I try to publish ejb as webservice
ide: JBossIDE-200701290313-nightly-ALL.zip
project: ejb3
ejb3 code (generated by wizard!):
package main;
import javax.ejb.Stateless;
import main.LoanProcessor;
public @Stateless class LoanProcessorBean implements LoanProcessor {
public String processApplication(String socialSecurityNumber, String applicantName, String applicantAddress, String applicantEmailAddress, int applicantAge, String applicantGender, float annualSalary, float amountRequested)
{
...
}
}
interface:
package main;
import javax.ejb.Remote;
@Remote
public interface LoanProcessor {
public String processApplication(String socialSecurityNumber, String applicantName, String applicantAddress, String applicantEmailAddress, int applicantAge, String applicantGender, float annualSalary, float amountRequested);
}
result:
Running JBossWS wstools for [LoanProcessor]
directory: C:\jboss\projects\ide\loanProcessing\LoanProcessor
command: cmd.exe /C C:\jboss\as-4.0.4.GA\bin\wstools.bat -cp bin -config c:\temp\wstools-config47877.xml -dest C:\jboss\projects\ide\loanProcessing\LoanProcessor\src
========================================================================="
.
WSTools Environment
.
JBOSS_HOME: C:\jboss\as-4.0.4.GA\bin\\..
.
JAVA: c:\jdk1.6.0_01\bin\java
.
JAVA_OPTS:
.
========================================================================="
.
Exception in thread "main" org.jboss.ws.WSException: A service endpoint interface should extend Remote
help me solve this problem, please
thanks
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4008187#4008187
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4008187
19 years, 2 months
Debug EJB3 component
by Roman Kasianenko
Hello, everybody.
I am developing web-application that needs to access EJB3 component that
is deployed to JBoss AS.
This bean uses few 3rd party libs, that are packed into the same jar as
bean is, under "/lib" path.
In the JBoss console i see message:
[EJBContainer] STARTED EJB: nuntia.ejb.CRFacadeBean ejbName: CRFacadeBean
So, it looks like bean is deployed successfully.
From web-app (from struts action actually) i try to get bean instance
as follows:
Properties properties = new Properties();
properties.setProperty("java.naming.factory.initial",
"org.jnp.interfaces.NamingContextFactory");
properties.setProperty("java.naming.factory.url.pkgs",
"org.jboss.naming:org.jnp.interfaces");
properties.setProperty("java.naming.provider.url", "localhost:1099");
CRFacade crFacade = (CRFacade) new
InitialContext(properties).lookup("CRFacadeBean/local");
Here, CRFacade is @Local interface, and CRFacadeBean is an
implementation class (@Stateless bean).
Instance seems to be successfully created (i see that while debugging),
but as soon as first of its methods is called, i got an
InvocationTargetException:
[PropertiesFactoryBean] Loading properties file from class path resource
[alfresco/domain/hibernate-cfg.properties]
So it seems that there's some problem either in bean or in the way how
libs are loaded (PropertiesFactoryBean class is actually part of
spring.jar that is one of the libs i'm bundling with my bean's jar).
Note, that class does his job well when used standalone (not as bean).
So, i would like to debug bean to find out what the reason of failure
is. I'm using Eclipse and JBossIDE, my project is configured properly,
sources are attached to the classes, and i can navigate throuhg them,
but still, i can't catch breakpoint that is set in the body of
constructor of my bean, so it seems like debugging is not working this
way...
And, finally, questions:
1) do i pack/deploy my EJB3 component correctly?
2) is there any way to debug deployed EJB3 component?
P.S. I am new to EJB3, so sorry for dumb questions (if any) ;)
Thanks in advance!
Cheers,
R. Kasianenko
19 years, 2 months
[JCA/JBoss] - Re: How to connect my EJB to Firebird database?
by g_zaspa
OK, I try to run the simplest EJB working with Firebird DB. I'll try to describe you as short and as full as I can. If any other information is necessary, please, ask.
I put firebird-ds.xml in deploy folder and corrected it. I seem it was deployed OK - in JMX console in jboss.jca part I see:
name='jaybird-2.1.1.rar',service=RARDeployment
name='jboss-ha-local-jdbc.rar',service=RARDeployment
...
name=DefaultDS,service=DataSourceBinding
name=DefaultDS,service=LocalTxCM
name=DefaultDS,service=ManagedConnectionFactory
name=DefaultDS,service=ManagedConnectionPool
name=FIrebirdDS,service=ConnectionFactoryBinding
name=FIrebirdDS,service=ManagedConnectionFactory
name=FIrebirdDS,service=ManagedConnectionPool
name=FIrebirdDS,service=TxCM
...
Then, I have a Java EE project with one EJB. I include persistence.xml in META-INF of the project, in which I write:
<?xml version="1.0" encoding="UTF-8"?>
<persistence-unit name="order" transaction-type="JTA">
<jta-data-source>java:/FIrebirdDS</jta-data-source>
</persistence-unit>
My EJB begins with:
@Stateless
@RemoteBinding(jndiBinding="ejb/Person")
public class PersonBean implements Person {
//@PersistenceContext EntityManager em;
When I deploy my .ear with this EJB, I get an error message in JBoss console with the last part:
--- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
ObjectName: jboss.jca:name=FIrebirdDS,service=DataSourceBinding
State: NOTYETINSTALLED
Depends On Me:
persistence.units:ear=EJB3Test.ear,jar=EJB3Test.jar,unitName=order
persistence.units:ear=EJB3Test.ear,jar=EJB3Test.jar,unitName=order
persistence.units:ear=EJB3Test.ear,jar=EJB3Test.jar,unitName=order
But nevertheless .ear is deployed and I can reach my PersonBean EJB from a remote client on JNDI name and call it's business method. But as soon as I uncomment
//@PersistenceContext EntityManager em;
and redeploy my .ear, I cannot reach PersonBean EJB any more -
Object ref = context.lookup("ejb/Person"); in my client generates NameNotFoundException.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4008166#4008166
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4008166
19 years, 2 months