ServiceRegistry
![tejaswini tejaswini](https://connect.hyland.com/legacyfs/online/avatars/Blue-user-logo.png)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2010 04:27 AM
thanks in advance.
- Labels:
-
Archive
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2010 04:38 AM
The service registry is a hack for the times when you can't use injection, so you should not need it.
![tejaswini tejaswini](https://connect.hyland.com/legacyfs/online/avatars/Blue-user-logo.png)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2010 06:05 AM
thanks for the quick reply
![tejaswini tejaswini](https://connect.hyland.com/legacyfs/online/avatars/Blue-user-logo.png)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2010 12:18 AM
i am doing something like this—>
class WebSettingBean implements Serializable
{
protected ServiceRegistry serviceRegistry;
//getter and setter methods
public void setActive(ActionEvent event) {
//some actions and System.out.println()s
}
whn i run this code it works fine and i get the output on console
now i am adding two statements to evaluate() as
ApplicationContext cxt = new ClassPathXmlApplicationContext("classpath:alfresco/application-context.xml");
ServiceRegistry serviceRegistry=(ServiceRegistry)cxt.getBean("serviceRegistry");
the bean has configured in someco-action-context.xml as
<bean id="name" class="com.someco.bean.WebSettingsBean">
<property name="serviceRegistry">
<ref bean="ServiceRegistry"/>
</property>
<property name="repository">
<ref bean="JCR.Repository"/>
</property>
</bean>
the web-client-config-custom conatains
<action id="web_enable">
<permissions>
<!– each permission can be an Allow or Deny check –>
<permission allow="true">Write</permission>
</permissions>
<!– new code –>
<evaluator>com.someco.action.evaluator.WebEnableEvaluator</evaluator>
<label-id>enableWeb</label-id>
<image>/images/icons/create_website.gif</image>
<action-listener>#{WebSettingsBean.setActive}</action-listener>
<action>dialog:executeScript</action>
<action-listener>#{BrowseBean.setupSpaceAction}</action-listener>
<params>
<param name="id">#{actionContext.id}</param>
<param name="active">true</param>
</params>
</action>
i am getting exceptions as
javax.faces.el.EvaluationException: Exception while invoking expression #{WebSettingsBean.setActive}
org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:156)
javax.faces.component.UICommand.broadcast(UICommand.java:89)
javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:97)
javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:171)
org.apache.myfaces.lifecycle.InvokeApplicationExecutor.execute(InvokeApplicationExecutor.java:32)
org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:95)
org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:70)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:139)
org.alfresco.web.app.servlet.AuthenticationFilter.doFilter(AuthenticationFilter.java:110)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
org.alfresco.repo.management.subsystems.ChainingSubsystemProxyFactory$1.invoke(ChainingSubsystemProxyFactory.java:122)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
$Proxy196.doFilter(Unknown Source)
org.alfresco.repo.web.filter.beans.BeanProxyFilter.doFilter(BeanProxyFilter.java:88)
org.alfresco.repo.web.filter.beans.NullFilter.doFilter(NullFilter.java:74)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
org.alfresco.repo.management.subsystems.ChainingSubsystemProxyFactory$1.invoke(ChainingSubsystemProxyFactory.java:122)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
$Proxy196.doFilter(Unknown Source)
org.alfresco.repo.web.filter.beans.BeanProxyFilter.doFilter(BeanProxyFilter.java:88)
root cause
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ftsIndexerTrigger' defined in class path resource [alfresco/scheduled-jobs-context.xml]: Invocation of init method failed; nested exception is org.quartz.ObjectAlreadyExistsException: Unable to store Job with name: 'ftsIndexerJobDetail' and group: 'DEFAULT', because one already exists with this identification.
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1175)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:427)
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:249)
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:155)
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:246)
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:291)
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:122)
org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:66)
com.someco.bean.WebSettingsBean.setActive(WebSettingsBean.java:191)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:132)
javax.faces.component.UICommand.broadcast(UICommand.java:89)
javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:97)
javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:171)
org.apache.myfaces.lifecycle.InvokeApplicationExecutor.execute(InvokeApplicationExecutor.java:32)
org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:95)
org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:70)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:139)
org.alfresco.web.app.servlet.AuthenticationFilter.doFilter(AuthenticationFilter.java:110)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
org.alfresco.repo.management.subsystems.ChainingSubsystemProxyFactory$1.invoke(ChainingSubsystemProxyFactory.java:122)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
$Proxy196.doFilter(Unknown Source)
org.alfresco.repo.web.filter.beans.BeanProxyFilter.doFilter(BeanProxyFilter.java:88)
org.alfresco.repo.web.filter.beans.NullFilter.doFilter(NullFilter.java:74)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
org.alfresco.repo.management.subsystems.ChainingSubsystemProxyFactory$1.invoke(ChainingSubsystemProxyFactory.java:122)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
$Proxy196.doFilter(Unknown Source)
org.alfresco.repo.web.filter.beans.BeanProxyFilter.doFilter(BeanProxyFilter.java:88)
hope this will give u an idea of my problem
goodday!!!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2010 05:12 PM
ApplicationContext cxt = new ClassPathXmlApplicationContext("classpath:alfresco/application-context.xml");
ServiceRegistry serviceRegistry=(ServiceRegistry)cxt.getBean("serviceRegistry");
![tejaswini tejaswini](https://connect.hyland.com/legacyfs/online/avatars/Blue-user-logo.png)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2010 11:09 PM
thnks…
so how we can get the ServceRegistry?
if its available then how to access? and if its present then whn i try———–>
System.out.println("service regisrt="+serviceregistry);
why it gives null???
will u pls tell me how to do that?
its very urgent….
goodday!!!
![tejaswini tejaswini](https://connect.hyland.com/legacyfs/online/avatars/Blue-user-logo.png)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2010 12:06 AM
i am still stuck on the same problem and i dont know how to move further. let me know the way by which i can achieve that.
pls hurry up ….
goodday!!!!
![cheffilet cheffilet](https://connect.hyland.com/legacyfs/online/avatars/Blue-user-logo.png)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2010 07:27 AM
This looks like using Alfresco Explorer JSF Client. This means you´re able to use FacesContext instance which is bound to the local thread!
ServiceRegistry serviceRegistry = org.alfresco.web.bean.repository.Repository.getServiceRegistry(FacesContext.getCurrentInstance());
![cheffilet cheffilet](https://connect.hyland.com/legacyfs/online/avatars/Blue-user-logo.png)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2010 07:28 AM
This looks like using Alfresco Explorer JSF Client. This means you´re able to use FacesContext instance which is bound to the local thread!
ServiceRegistry serviceRegistry = org.alfresco.web.bean.repository.Repository.getServiceRegistry(FacesContext.getCurrentInstance());
![bwagner bwagner](https://connect.hyland.com/legacyfs/online/avatars/Blue-user-logo.png)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2010 04:54 AM
final ApplicationContext context = new ClassPathXmlApplicationContext("classpath:alfresco/application-context.xml");final Repository repository = (Repository) context.getBean("JCR.Repository");
which leads to errors
![](/skins/images/A90266AC6EB1934BC937DAFB2842964E/responsive_peak/images/icon_anonymous_message.png)