problem when developing a web service consuming dfs
I am creating a web service which is going to do full-text search and some query on the repository.
I am using the code from the sdk examples.
When I run the code as a java application on eclipse, it works fine.
But when I expose the class to a web service, the code fail while not throwing exception
After some checking, I found that the code stopped running or just stuck when setting the context at the following line:
ContextFactory contextFactory = ContextFactory.getInstance(); // <---
serviceContext = contextFactory.newContext();
RepositoryIdentity repoId = new RepositoryIdentity();
repoId.setRepositoryName(defaultRepositoryName);
repoId.setUserName(userName);
repoId.setPassword(password);
I try to guess the reason, I wonder if my web service have occupy some resouces (e.g. jar) that was running in an single thread
so that the getInstance wait for the notification.
Is there any other problem with this or any other way to get a ContextFactory.
Thanks,
Alex
Comments
-
I couldn't find anything that would block execution in "ContextFactory.getInstance()". Could you please create a plain "Hello world" service and make sure it works? If it does, could you please create a new service with this single "ContextFactory.getInstance()" statement in it and let me know if it hangs or not?
0 -
Try wrapping the failing call in a try...catch, but catch a throwable.
I have had this in a number of other Java based applications over the years that at startup, or whilst running, throw a runtimeexception, or a plain throwable, and normally these are not caught all that well.
My guess would be that if it works in Eclipse but not standalone then it is possibly either a classpath or java version issue.
0
Categories
- All Categories
- 111 Developer Announcements
- 49 Articles
- 102 General Questions
- 123 IM Services
- 40 OpenText Hackathon
- 31 Developer Tools
- 20.6K Analytics
- 4.1K AppWorks
- 8.9K Extended ECM
- 898 Cloud Fax and Notifications
- 77 Digital Asset Management
- 9.3K Documentum
- 29 eDOCS
- 124 Exstream
- 39.8K TeamSite
- 1.7K Web Experience Management
- 1 XM Fax