Win a copy of Succeeding with AI this week in the Artificial Intelligence and Machine Learning forum!

Rohit Mehta

Ranch Hand
+ Follow
since Mar 11, 2005
Rohit likes ...
Eclipse IDE Spring Chrome
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
1
Received in last 30 days
0
Total given
7
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Rohit Mehta

Though related, Singleton pattern is described at per class loader level.
Singleton bean scope is per spring container.

http://www.javabench.in/2012/04/difference-between-singleton-design.html
6 years ago
welcome :-)
8 years ago
Enough has been said already - but can't resist myself putting few dots ..

On desktop - yes - MS technologies might be more dominating - but on the server side - what I feel is mostly java.
Millions of web apps (of significant size & traffic) are built over Struts, running successfully. For smaller biz apps - Yes we have things like RubyOnRails which was a hit sometime back & I feel that even today are doing great.
But when we talk of large applications/projects - those with huge set of functionality & complex logic (communicating with multiple host/mainframe systems) - we see mostly Struts, Spring or Seam in action.

Having worked on java for BFSI domain for around 5 yrs for multiple financial clients - I can say that most of the financial websites, banking apps use java due to its security & robustness.
8 years ago
Thanks Tim for your reply. Actually it was not due to "not finding jar" but due to "over finding" of jars.

Don't know how, but somehow from other dependencies - these two (& other geronimo*) jars were pulling & these two were causing issue:

geronimo-activation_1.1_spec-1.0.1.jar
geronimo-javamail_1.4_spec-1.2.jar

I excluded them - & all is well.

8 years ago
From different points - main() within class, outside class & through application logic flow. From everywhere - the logs are same (without those 4/5 lines as mentioned - otherwise smooth) - but no mail.
8 years ago
Hi all, I am using java 6.0, Spring 3.0 & Maven. I am facing a strange problem.

I am trying to send mail from my application, but not able to do so. I checked with debug on, the logs seems fine - no exception/error but the mail doesn't trigger.



POM (relevant):




Logs:

DEBUG SMTP: useEhlo true, useAuth true
DEBUG SMTP: useEhlo true, useAuth true
DEBUG SMTP: trying to connect to host "smtp.myorg.com", port 25, isSSL false
220 droutbound.logix.in ESMTP
DEBUG SMTP: connected to host "smtp.myorg.com", port: 25

EHLO ABCDE1234
250-droutbound.logix.in
250-8BITMIME
250-SIZE 26214400
250-STARTTLS
250-AUTH PLAIN LOGIN
250 AUTH=PLAIN LOGIN
DEBUG SMTP: Found extension "8BITMIME", arg ""
DEBUG SMTP: Found extension "SIZE", arg "26214400"
DEBUG SMTP: Found extension "STARTTLS", arg ""
DEBUG SMTP: Found extension "AUTH", arg "PLAIN LOGIN"
DEBUG SMTP: Found extension "AUTH=PLAIN", arg "LOGIN"
DEBUG SMTP: Attempt to authenticate
AUTH LOGIN
334 VXNl1cm25hbW2U6
c2NjYWRta1W5Ae3mVuc42Fy5Lmlu
334 UGFz7c63dv2cmQ6
WmVuc22Fy5MT7IzIw==
235 #2.0.0 OK Authenticated
DEBUG SMTP: use8bit false
MAIL FROM:<address@myorg.com> AUTH=address@myorg.com
250 sender <address@myorg.com> ok
RCPT TO:<address@myorg.com>
250 recipient <address@myorg.com> ok
DEBUG SMTP: Verified Addresses
DEBUG SMTP: address@myorg.com
DATA
354 go ahead

Body

.
250 ok: Message 325177010 accepted
QUIT
221 droutbound.logix.in


I have tried with other sample programs as well - with or without spring configurations. No error. BUT no mail as well.

IMP - same program(s) work fine if I use them in my other project which doesn't use maven - but otherwise have same configurations.
In those logs there are some more lines in between ..


DATA
354 go ahead

From: address@myorg.com
To: address@myorg.com
Message-ID: <12694833.01327427956033.JavaMail.myid@ABCDE12345>
Subject: Say Hi ..
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Body
.


I am stuck. Is this due to Maven? Please suggest.
8 years ago
Hi all, I am using java 6.0, Spring 3.0 & Maven. I am facing a strange problem.

I am trying to send mail from my application, but not able to do so. I checked with debug on, the logs seems fine - no exception/error but the mail doesn't trigger.



POM (relevant):




Logs:

DEBUG SMTP: useEhlo true, useAuth true
DEBUG SMTP: useEhlo true, useAuth true
DEBUG SMTP: trying to connect to host "smtp.myorg.com", port 25, isSSL false
220 droutbound.logix.in ESMTP
DEBUG SMTP: connected to host "smtp.myorg.com", port: 25

EHLO ABCDE1234
250-droutbound.logix.in
250-8BITMIME
250-SIZE 26214400
250-STARTTLS
250-AUTH PLAIN LOGIN
250 AUTH=PLAIN LOGIN
DEBUG SMTP: Found extension "8BITMIME", arg ""
DEBUG SMTP: Found extension "SIZE", arg "26214400"
DEBUG SMTP: Found extension "STARTTLS", arg ""
DEBUG SMTP: Found extension "AUTH", arg "PLAIN LOGIN"
DEBUG SMTP: Found extension "AUTH=PLAIN", arg "LOGIN"
DEBUG SMTP: Attempt to authenticate
AUTH LOGIN
334 VXNl1cm25hbW2U6
c2NjYWRta1W5Ae3mVuc42Fy5Lmlu
334 UGFz7c63dv2cmQ6
WmVuc22Fy5MT7IzIw==
235 #2.0.0 OK Authenticated
DEBUG SMTP: use8bit false
MAIL FROM:<address@myorg.com> AUTH=address@myorg.com
250 sender <address@myorg.com> ok
RCPT TO:<address@myorg.com>
250 recipient <address@myorg.com> ok
DEBUG SMTP: Verified Addresses
DEBUG SMTP: address@myorg.com
DATA
354 go ahead

Body

.
250 ok: Message 325177010 accepted
QUIT
221 droutbound.logix.in


I have tried with other sample programs as well - with or without spring configurations. No error. BUT no mail as well.

IMP - same program(s) work fine if I use them in my other project which doesn't use maven - but otherwise have same configurations. In those logs there are some more lines in between ..

DATA
354 go ahead

From: address@myorg.com
To: address@myorg.com
Message-ID: <12694833.01327427956033.JavaMail.myid@ABCDE12345>
Subject: Say Hi ..
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Body
.


Have tried other samples from net as well, but no luck. Seems Maven is not OK with something. Any suggestions are welcome.
8 years ago
Hi,

My application need to read file from ftp location, as soon as it is put on there. We are using Tomcat / Spring. I want to know my options..

A) Can I write some trigger/observer sort of which will call my program to read the file - as soon as it comes.
B) Or, I need to write some scheduler, which will keep checking the location on a regular interval, & read/process file in the next schedule check, after the file is placed.

Also for scheduling, which would be better choice - using Concurrent API - OR - some open source scheduler like Cron4j.

Thanks.
8 years ago
As mentioned above - the most important reason - security & thread safety.

Consider a scenario, in a banking application for money transfer - the beneficiary account number is defined in a string as "0789567345".
If by mistake/intentionally this acc. number is changed, money will go to a wrong account.

Another scenario - if someone change the class name anywhere between processing as ..

getClass().getName().subString(0, 5);

The Class loader will simply say 'Class Not Found'
8 years ago

megha Ranjan wrote:This site may be helpful in learning spring.
Even I am new to spring but this site has helped me a lot.

try this :
http://www.vaannila.com/spring/spring-tutorial/spring-tutorial.html

Thanks,



Yes - this is also a good site ..
8 years ago
book - Spring In Action
also a good site to start with - http://www.mkyong.com
8 years ago
Its ok for learning both from a impression perspective .. but I would strongly recommend learning as much modules of Spring as possible, as any new dev project would be using Spring (or there are far more chances of it) rather than EJB. Spring' wide range of Enterprise app areas support is great - its here to stay.
8 years ago