Link to home
Start Free TrialLog in
Avatar of mte01
mte01Flag for Lebanon

asked on

Problem in creating a service

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("com.tangoe.cmp.enterprise.business.services.preferences.PreferencesManager",
                                                                                                  null);

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??
Avatar of girionis
girionis
Flag of Greece image

It might be a classloader issue. Can you post the full stack trace?
Avatar of mte01

ASKER

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.
java.lang.reflect.InvocationTargetException
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at com.tangoe.cmp.common.business.serviceFactory.SessionBeanServiceFactory.create(SessionBeanServiceFactory.java:68)
      at com.tangoe.cmp.common.business.serviceFactory.BusinessServiceFactory.createService(BusinessServiceFactory.java:205)
      at com.tangoe.cmp.enterprise.ui.profile.EnterpriseSecurityHelper.getPreferences(EnterpriseSecurityHelper.java:232)
      at com.tangoe.cmp.common.ui.profile.Profile.getCurrentLocale(Profile.java:633)
      at com.tangoe.cmp.enterprise.ui.uiservices.scheduler.jobs.EmailNotifyJob.execute(EmailNotifyJob.java:63)
      at org.quartz.core.JobRunShell.run(JobRunShell.java:191)
      at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:516)
Where is your class? do you have all relevant proxy/stub classes you need in the classpath?
ASKER CERTIFIED SOLUTION
Avatar of girionis
girionis
Flag of Greece image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mte01

ASKER

>>girionis

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!
No problem. Please ask for a PAQ/Refund :)