All,
I'm trying to do something very simple.
I have a JNDI URL passed in as a SystemProperty at Weblogic startup.
-Doprisk.weblogic.jndi.url=t3://localhost:9020 weblogic.Server
I'm trying to use this URL in my org.springframework.jndi.JndiTemplate bean. To do this, i have the following spring xml file:
The problem is that PropertyPlaceholderConfigurer throws NullPointerEx.Code:<bean id="asyncJndiTemplate" class="org.springframework.jndi.JndiTemplate"> <property name="environment"> <props> <prop key="java.naming.factory.initial"> weblogic.jndi.WLInitialContextFactory </prop> <prop key="java.naming.provider.url"> ${oprisk.weblogic.jndi.url} <!--t3://localhost:9020--> </prop> </props> </property> </bean> <bean id="propertyPlaceholderConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="searchSystemEnvironment"> <value>false</value> </property> </bean>
If i take away the reference to the PropertyPlaceholderConfigurer and hardcode the JNDI URL in my XML, it works fine. But as soon as I reference the PropertyPlaceholderConfigurer, I start seeing the exception.Code:Caused by: java.lang.NullPointerException at java.lang.StringBuffer.<init>(StringBuffer.java:130) at org.springframework.beans.factory.config.PropertyPlaceholderConfigurer.parseStringValue(PropertyPlaceholderConfigurer.java:270) at org.springframework.beans.factory.config.PropertyPlaceholderConfigurer$PlaceholderResolvingBeanDefinitionVisitor.resolveStringValue(PropertyPlaceholderConfigurer.java:401) at org.springframework.beans.factory.config.BeanDefinitionVisitor.resolveValue(BeanDefinitionVisitor.java:143) at org.springframework.beans.factory.config.BeanDefinitionVisitor.visitPropertyValues(BeanDefinitionVisitor.java:89) at org.springframework.beans.factory.config.BeanDefinitionVisitor.visitBeanDefinition(BeanDefinitionVisitor.java:59) at org.springframework.beans.factory.config.PropertyPlaceholderConfigurer.processProperties(PropertyPlaceholderConfigurer.java:246) at org.springframework.beans.factory.config.PropertyResourceConfigurer.postProcessBeanFactory(PropertyResourceConfigurer.java:75) at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:422) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:334) at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:241) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:184) at org.springframework.web.context.ContextLoaderServlet.init(ContextLoaderServlet.java:82) at javax.servlet.GenericServlet.init(GenericServlet.java:258) at weblogic.servlet.internal.ServletStubImpl$ServletInitAction.run(ServletStubImpl.java:1028) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121) at weblogic.servlet.internal.ServletStubImpl.createServlet(ServletStubImpl.java:904) at weblogic.servlet.internal.ServletStubImpl.createInstances(ServletStubImpl.java:883) at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:822) at weblogic.servlet.internal.WebAppServletContext.preloadServlet(WebAppServletContext.java:3333) at weblogic.servlet.internal.WebAppServletContext.preloadServlets(WebAppServletContext.java:3290) at weblogic.servlet.internal.WebAppServletContext.preloadServlets(WebAppServletContext.java:3276)
I'm sure I'm doing something incredibly stupid, but I can't figure out what it is. Any ideas anybody?
Any help is appreciated. Thanks.


Reply With Quote