Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Accessing 3rd party static method from ejb3

 
Norman Davis
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello to all, I've a long time forum browser.

I have a question regarding acessing a static method from within a @Statless bean. The company I work for has close to a dozen seperate systems, and we are attempting to reduce code redundancy by utilizing web services.

The long and short is that I need to "validate" some email addresses that have been a database for 10 + years. I can read the data just fine, but I cannot figure out how to access a static method from org.apache.commons.validator:


This works fine, no questions asked. However, when I try the following:


I get an invocation error and glassfish tells me to go get my shinebox. I'm guessing this has to do with accessing the static method, but I don't know. Please, any help would be enormous.

Thanks.
 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That doesn't look like a static method. I see that you are getting an instance of the validator and invoking on it. So I'm guessing isValid isn't really a static method. Anyway, what error/exception do you see? Please post the entire exception stacktrace.
 
Thiago Alves de Moraes
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Take a look at the code inside initialize method


validator is an reference inside the scope of the method.

you should create a new property of the class


And then it works
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic