Problem in creating a service

Posted on 2006-06-28
Last Modified: 2010-05-18
Hey experts,

 I am changing a small section in the code of huge java web application (based on struts & EJBs), and I am having a problem in a service creation. This piece of code:

PreferencesManager preferencesManager = null;
preferencesManager = (PreferencesManager)BusinessServiceFactory.getInstance().createService("",

is working fine in several places of the application, but when I tried to call it from a class of mine, it caused a ServiceNotFoundException (due to an Invocation Target Exception - trying to call the create method); why do you think a service creation would be successful in a class of the application and won't work in a class of mine??
Question by:mte01
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
LVL 35

Expert Comment

ID: 17000283
It might be a classloader issue. Can you post the full stack trace?

Author Comment

ID: 17000340
2006-06-28 15:12:55,546 ERROR SessionBeanServiceFactory - (create) InvocationTargetException caught while invoking the create() method on the home interface. Service cannot be created.
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(
      at java.lang.reflect.Method.invoke(
      at com.tangoe.cmp.enterprise.ui.profile.EnterpriseSecurityHelper.getPreferences(
      at com.tangoe.cmp.common.ui.profile.Profile.getCurrentLocale(
      at org.quartz.simpl.SimpleThreadPool$
LVL 35

Expert Comment

ID: 17000368
Where is your class? do you have all relevant proxy/stub classes you need in the classpath?
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

LVL 35

Accepted Solution

girionis earned 500 total points
ID: 17000384
Also make sure you have *all* jars needed in the classpath.

Author Comment

ID: 17000959

It turned out it's a security/login issue (in lower level methods).....the userId wasn't available for the invoker of the method...thanks for your help!
LVL 35

Expert Comment

ID: 17000976
No problem. Please ask for a PAQ/Refund :)

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
how to see all occupied ports on windows 10 laptop 15 94
throw exception 21 78
passing enum to a method 4 51
Java List 4 76
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
The viewer will learn how to implement Singleton Design Pattern in Java.
Suggested Courses

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question