Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Problem in creating a service

Posted on 2006-06-28
6
Medium Priority
?
270 Views
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("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??
0
Comment
Question by:mte01
[X]
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
6 Comments
 
LVL 35

Expert Comment

by:girionis
ID: 17000283
It might be a classloader issue. Can you post the full stack trace?
0
 
LVL 3

Author Comment

by:mte01
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.
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)
0
 
LVL 35

Expert Comment

by:girionis
ID: 17000368
Where is your class? do you have all relevant proxy/stub classes you need in the classpath?
0
The top UI technologies you need to be aware of

An important part of the job as a front-end developer is to stay up to date and in contact with new tools, trends and workflows. That’s why you cannot miss this upcoming webinar to explore the latest trends in UI technologies!

 
LVL 35

Accepted Solution

by:
girionis earned 1500 total points
ID: 17000384
Also make sure you have *all* jars needed in the classpath.
0
 
LVL 3

Author Comment

by:mte01
ID: 17000959
>>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!
0
 
LVL 35

Expert Comment

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

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
This video teaches viewers about errors in exception handling.
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
Suggested Courses

670 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