Laurence Yip

Greenhorn
+ Follow
since Sep 21, 2012
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
1
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Laurence Yip

hi all,

glad to see so many replies....greatly appreciate yours helps....and hope to see you all again in next question soon....Laurence
10 years ago
Hi Henry,

i post it again....it works....


Laurence
10 years ago
hi Sanaulla,

Thanks for your reply first!

But i still found confused and suppose i amended the doIt() as follows:


provided that guardian stays intact in the Parent class, the corresponding output becomes:


My first wonder is how come Parent class's guardian's finalizer is invoked prior to Child class's finalizer when child1 falls out of scope after calling doIt()!? Sorry for my poor insight for sequence of parent-child finalizer invocation!

Thanks a lot again!

Laurence
10 years ago
Hi all,

I have a problem about understanding of inheritance and finalizer



The output is :


if i remove the code snippet for finalizer guardian, the output would become....


For my basic java knowledge, since child1, child2 and parent1 objects will become out of scope after calling doIt() method and they will also become eligible to be collected from VM after calling System.gc() in main().
But i don't understand what the scenario working behind the outputs especially the differences between the two outputs when taking out 'finalizer guardian', anyone can help!?

thanks in advance!

Rgds,

Laurence
10 years ago

Ranganathan Kaliyur Mannar wrote:The idea is to have the business logic in a POJO and use CDI/Spring to inject and use them as needed. So, in this case, Tomcat with Spring/CDI would do.



hi mannar,

i'd also like to ask which version of Spring should i start if i'm just in JEE 1.5!?...More, i've just found that CDI/Spring come from JEE6, should i need to pick up JEE6 first before touching CDI/Spring....!?

LAW

Ranganathan Kaliyur Mannar wrote:Hi Hayato,
No, I don't think JEE 5 is not outdated (and from 1.5, J2EE is called as JEE).

It is difficult to provide a timeframe for learning JEE 6 - since you already know 5, you can build on it.
Also, its quite hard to talk about the Job market. The recent trend has been to move away from Enterprise containers, so EJBs may not be much in demand, but JSP/Servlet/JSF remains in demand.



Hi Mannar,

Thanks for your reply first, i have one more follow-up question: for 'The recent trend has been to move away from Enterprise containers' you mentioned, what stuffs will be used instead to write the business layer for a multi-tier web application!? any substituent the market use to write the business logic or they are all implemented by ' JSP/Servlet/JSF' instead.....!?

Thanks for your kindly reply again,

LAW
hi all,

i've just finished j2ee 1.5 tutorial study from oracle java web site, am i qualified enough to seek for j2ee related jobs!?

Has j2ee 1.5 been outdated in the software market market!?

Will it be difficult or easy to study j2ee 1.6 further in a short time, since i 've been using 7-months to study j2ee 1.5 tutorial completely!?

my background is my previous working field is enginerering, and just got a bit j2se development experiences!?

Hope anyone can discuss with me


Thanks in advance,

LA
hi all,

i've been trying my best to modify the ejb client code but i still failed to access the ejb bean code and....
on client side console, acc always complains "....EJBAcessException:Caller unauthorized" and....
on server console, "anonymous" was always dumped out after executing ctx.getCallerPrincipal() in bean code !?........
Actually, i'd like to know:
For 'anonymous'
i) does it mean the authentiation/authorization has failed in ejb-container or!?....
ii) my principal/credential set in client application got failed to be propagated to ejb-container...!?

/*****ejb client application class **********/


/*********sample_jaas.conf *****/



/********session bean class *********/



/*****jboss.xml*******/




/*********login-config.xml ********/



/******datasource file********/



/*****SQL schema and commands******/






i've been spending a couple of weeks for making the codes work....but got failed but the worst is nobody would like to offer a help or discussion although i understand it is just voluntary......LAW
11 years ago
dear all,

after browsing the old threads for a few days, some amendments i have taken:

i've done a client login from the client code:.............


i eventually know that 'no dialog box' will be prompted but a config file does to be required for fowarding the 'username' to ejb-container...........as 'principal' for further authentication as well as authorization....




HOWEVER...STILL NOT OK....!???

PRBOLEM I): javax.ejb.EJBAccessException: Caller unauthorized
at org.jboss.ejb3.security.RoleBasedAuthorizationInterceptorv2.invoke(RoleBasedAuthorizationInterceptorv2.java:199)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.security.Ejb3AuthenticationInterceptorv2.invoke(Ejb3AuthenticationInterceptorv2.java:186)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:41)........

PRBOLEM II):2012-12-03 17:57:04,249 INFO [STDOUT] (WorkerThread#0[127.0.0.1:3177]) anonymous.......


Logically, the class " org.jboss.security.ClientLoginModule required" passed to callbackhandler should be propagating the 'username' to the ejb container after logging in, however, when i call session_ctx.getCallerPrincipal() in ejb code, 'anonymous' was dumped out instead.... of the 'username' i entered in client application....!?

Question:
i) since 'anonymous' was dumped out in the server side, does it mean authentication as well as authorization has been taken place in server side!?
ii) since the class "org.jboss.security.ClientLoginModule required" fowarded the username(principal) to server side(ejb container) from client-login, do i also need to send the password(credential) to ejb container as well, but how..(actually i did passed the password to the callbackHandler)...!?

For my guessing......my 'username' did passed to the ejb container...but it may not be authenticated succesfully...since ejb-container found nothing about the 'password'(credential) hardcoded in the client application...and CallBackHandler found no way to help the password propagation to ejb-container...!?..am i correct......!?...hope somebody can help me like a candle before the christmas coming.....A BILLION thanks in advance...

LAW

LAW
11 years ago
hi all,

i am stilling playing j2ee1.5 tutorial about securing session bean accessed by standalone application client but i get failed to make the code example working, let's see the codes and descriptors first:




/**** runtime deployment descriptor for GlassFish ****/


I'd like to translate the above sun-specific descriptor to jboss version....jboss.xml

/*******jboss.xml********/


/******%jboss_home%/server/default/conf/login-config.xml****/



/****%jboss_home%/server/default/deploy/mysql_realm-ds.xml****/


then...i tried to run the standalone client ....however, no login dialog box invoked to prompt me to enter anything ....but just the following error messages echoed out...!???



I think my concept about JAAS security deployment on jboss is vague, anyone can help!?......thanks in advance.....LAW
11 years ago

Mark Spritzler wrote:You can use any version you want in any version of JBoss. Spring is POJO based and runs the same no matter the deployment environment.

Unlike Java EE where you have to have a compliant version of the app server to match the Java EE version you are using.

Mark



Ooooo.....very clear....thanks a lot..........LAW
11 years ago
hi,

i'm a newbie of j2ee and i've been digging into j2ee 1.5 tutorial for several months, and i'd like to learn one application framwork such as Spring. As far as i know, Spring has many version such as 2.5, 3.0 and 3.1, any differences between those versions!? For running j2ee1.5/JBOSS AS 5.1.0, which version should i use (i'm using jboss as 5.1.0. )!?....


Thanks in advance


LAW
11 years ago
hi all,

It's my first time to post my questions on javaranch and please indicate any format/standard mismatch during my question asking!

I've just started to learning on-line j2ee1.5 tutorial from oracle sun and i 'd like to use JBOSS AS 5.1.0 to run their code examples, but unfortunatley encountered many much problems....

From running simple JMS standalone client for producer-consumer example, i've tried to set the code-specified jms topic & queue on jboss by adding a new file to: %JBOSS_HOME%\server\default\deploy\messaging....

/*%JBOSS_HOME%\server\default\deploy\messaging\my-destinations-service.xml*/



/*%JBOSS_HOME%\server\default\deploy\messaging\connection-factories-service.xml(without any changed here)*/

/* Producer.java */


/* SynchConsumer.java */


Below is my capture for server.log


But when i tried to run the producer.jar:
> java -jar producer.jar queue 3
the following exception occured:
java.lang.NoClassDefFoundError: javax/jms/JMSException
Caused by: java.lang.ClassNotFoundException: javax.jms.JMSException
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
Could not find the main class: Producer. Program will exit.
Exception in thread "main"

Anyone can help....thanks in advance....LAW
11 years ago