Jose Ortuno

Ranch Hand
+ Follow
since Nov 10, 2002
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Jose Ortuno

Thanks a lot Jaikiran!

Now it make sense, I will implement your suggestion by using JNDI. I absolutely need to get deeper on EJB 3. :-)

Cheers.


Hi there,

New to EJB 3 and I trying to access a remote EJB from a very simple EE Client deployed on GlassFish 3.
I created a mock bean with a very simple method. It works as long as I inject the EJB using @EJB anotation in the main class. Moving, forward I tried to create a JFrame to prompt for some information, so I can pass it to the remote bean.
When y tried to inject the same EJB in the second class (The form) the reference is always NULL causing a NULL pointer exception.

Here is the relevant code:

Client Class:
public class Main {

@EJB
public static MockBeanRemote mockBean; // Bean is injected


public static void main(String[] args) {

System.out.println( mockBean.tryMe() ) ; // Work just fine displaying a console message

}
}


***** Second Approach ****
Cliente Class:
public class Main {

// @EJB
// public static MockBeanRemote mockBean; <<<< remove injection


public static void main(String[] args) {

new MyFrame(); // Display the Form

}
}


Form Class:

public class MyFrame extends javax.swing.JFrame {

@EJB
public static MockBeanRemote mockBean; // <<<<<< Inject remote bean just like before

...

/** Creates new form and components */
public MyMain() {
initComponents();
}

.....

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { // event is performed
...
// try to call remote method
mockBean.tryMe(); // At this point mockBean is NULL ..! Therefore NullPointerEception is thrown
}

...
}

**************

As a workaround I decide to move injection back to main Class, declare it as public static mockBean and call the method using Main.mockBean() and it works again ......... I know it is a bad approach.
Please let me know what is happening underneath so I can do the right think.

Thanks folks in advance!

Jose
Hello all out there,

I'am trying to get the Sun�s SL-351 Course Student Guide (Business Component Development with Enterprise JavaBeans Technology). I have to make a comparison between EJB 2.0 & EJB 3 and I would like to make it straing from Sun's info.

If any of you would like to share this info I will really appreciate.


Thanks in advance for your kindness.

Cheers,

JOseL
[ June 04, 2008: Message edited by: Jose Ortuno ]
Hi there!

Any help/thoughts/How to/Advice using ProgrammaticLogin from a Swing Client to a Glassfish server?

Thanks
Hi there,

This is very interesting subject I will quote a friend that have the same issue I found crawling the web:


I have EJBs on my server that users of the account will be accessing through a stand-alone Swing application. The first time the software starts, it'll ask the user for an account ID and password (which I believe are represented by the security principal and credentials respectively). From then on, the software should access a stateless EJB using authentication information. I don't have any trouble accessing the stateless EJB, but the biggest part I'm confused about is how I communicate the security principal and password to the server. Where do I set properties in the stand-alone client code?

[...]

I feel extremely lost and confused with the entire authentication concept of Java EE 5! Authorisation has lots of details written about it - using annotations or deployment descriptors to limit the execution of methods to certain roles. There's even pretty good documentation on how to add users to the system via the admin web interface. The only concept that I can't find a single article or example of is making use of it all!

In my mind, it's the simplest of concepts: Joe has an account ID and password. He only has access to one object on the server, which is referenced from the entity persistence database using his account ID. At the moment, it feels like I would have been better off writing this part of the system manually. Whatever happened to KISS?



Seems to me that using ProgrammaticLogin is easier since I do not have to implement a LogingModule and a CallBackHandler --I look at JAAS as an alternative whatsoever.

After reading this article http://java.sun.com/developer/EJTechTips/2006/tt0225.html#2

It looks like ProgrammaticLogin is the simplest and easiest path to follow (of course in my case which is a very simple client).

Cheers fellows!

[ May 25, 2007: Message edited by: Jose Ortuno ]
[ May 25, 2007: Message edited by: Jose Ortuno ]
Thanks you guys for taking the time to answer,

First, my EJBs are not par of a Web app. I am using EJB3 for persistence and session beans for business logic.

Does your JAAS login module reside on the app server or you do authentication on client



Users are authenticated on the client, seems to me that I could do authentcation FROM the client using ProgramaticLogin and still using AppServer security services. I think of JAAS as an alternative.

Perhaps I am wrong and the specification does not support that.

However, I found the follow stand-alone example:



The previous example is not based on EJB3. But again I might be wrong and client authentication is not supported. In that case, I will need to start thinking of using web services.

Again, Thanks a lot for your kindly comments!
Hi there,

Again, all information I found was related to "Securing WEB apps" using JAAS.

No Sucess with Swing Rich client authentication against J2EE servers using JAAS or any other method.

Cheers
Thanks, for answering..~!
I will take a look to the document and will try to find JAAS on GlassFish
Hello folks,

I've been crawling the web trying to find some info that could help me. This is my issue:

As per customer request, We have to implement a Rich client interface that uses/calls EJBs restricted methods.

I tried to find info about JAAS and ProgrammaticLogin with no success.

Some of the info I found, states that ProgrammaticLogin relays on the underlaying AppServer, therefore I lean towards using JAAS -- witch is not supported by all AppServer according to some reading.
However, I planing to deploy on Sun's AppServer, GlassFish and JBoss all of them support JAAS (According to som info I Found).

My core desing is based on Eclipse Rich Client platform authenticating to a GlassFish/JBoss server to gain access to EJB3 restricted (By role) components. I would like to relay on the AppServer Security/Audith system to kepp my desing simple.


Perhaps, this a simpla and silly Q, but I could not find enought info in regards. Additionally, If any of you have any suggestion, I will be willing to try it.

Any help will be really appreciate,

Thanks in advance.
Hello folks,

I've been crawling the web trying to find some info that could help me. This is my issue:

As per customer request, We have to implement a Rich client interface that uses/calls EJBs restricted methods.

I tried to find info about JAAS and ProgrammaticLogin with no success.

Some of the info I found, states that ProgrammaticLogin relays on the underlaying AppServer, therefore I lean towards using JAAS -- witch is not supported by all AppServer according to some reading.
However, I planing to deploy on Sun's AppServer, GlassFish and JBoss all of them support JAAS (According to som info I Found).

My core desing is based on Eclipse Rich Client platform authenticating to a GlassFish/JBoss server to gain access to EJB3 restricted (By role) components. I would like to relay on the AppServer Security/Audith system to kepp my desing simple.


Perhaps, this a simpla and silly Q, but I could not find enought info in regards. Additionally, If any of you have any suggestion, I will be willing to try it.

Any help will be really appreciate,

Thanks in advance.
Thanks you guys for your help/references, this is and excellent starting point.

Cheers!

Hi all out there,
Perhaps this is a silly questions but will help me clarify some issues.

We are working in a human resources/pay roll project. Currently we are at the designing stage and I am facing a problem with the UML/RELATIONAL MODEL mapping.

Here I will show a little part of our class diagram just to keep it ease:

class employee
id
name
lasName
addres
etc
some methods
m1, m2,m3 ...

class secretary inherits from employee
class Clerk inherits from employee
class Manager inherits from employee
...


In my relational model I have:

Table Employee
id
name
lasName
addres
type -> witch maps to EmployeeType.id
etc

Table EmployeeType
id
description
example >>>> 01 Manager
02 Secretary
03 Clerk
04 Etc

My question is:

Should I have a class EmployeeType since it is a entity in my db model?

I am avoiding to have a class so I will add Employee subclasses as we need another employee type. However, that will change my class diagram and will add some NEW code.

From the user perspective, however, it will be just another record in the EmployeeType table that I will associate to an employee later on.

At this point I get confuse because I should not change my model just because a new Type of something appears.

I will like to know the right way to model this situation. So if anybody can point me in the right direction I will really appreciate it.

Thanks in advance!
Jose.

PD: Hope my explanation depicts the problem right.
Hello Guys,

Hope you can help me with this one!

I am using Tiles and validation framework. In my design I am implementing a page where users can type a query to get some results in a different page (tile).
At the beginning the page display just fine, but after submitting the query I am getting tag useAttribute : no tiles context found if the page gets validated.

I had disabled the validation clause to the page and I do not get the error. My idea is that validation framework is causing the problem. Some how, when the page gets submitted it losses the context information .
Here you have some code so you can have a better understanding.

Tile: head.jsp



I double checked my validation.xml file:


Any help will be appreciate
19 years ago
OK,

I am gonna review reg. exp. to eval & replace {$varname} by the value.

Thanks for writting..!!
19 years ago