Announcement Announcement Module
Collapse
No announcement yet.
Integration of Spring 3 and weblogic 10 Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Integration of Spring 3 and weblogic 10

    Hi,

    i am trying to setup a simple helloworld example by using spring 3 and weblogic 10 using eclipse. i am a newbie to weblogic and cant see whats wrong with my config.

    i am trying to run on server of my project. it will hit the error of below.

    Code:
    !ENTRY oracle.eclipse.tools.weblogic 4 4000 2010-12-17 15:03:57.301
    !MESSAGE Error reading weblogic.xml file.
    
    !ENTRY oracle.eclipse.tools.weblogic 4 4000 2010-12-17 15:03:58.317
    !MESSAGE Error reading weblogic.xml file.
    
    !ENTRY oracle.eclipse.tools.weblogic 4 4000 2010-12-17 15:03:58.346
    !MESSAGE Error reading weblogic.xml file.
    
    !ENTRY org.eclipse.core.jobs 4 2 2010-12-17 15:03:58.447
    !MESSAGE An internal error occurred during: "Starting Oracle WebLogic Server 11gR1 at localhost".
    !STACK 0
    java.lang.NullPointerException
    	at oracle.eclipse.tools.weblogic.server.internal.WeblogicServerLaunchConfigurationDelegate.setEnv(WeblogicServerLaunchConfigurationDelegate.java:473)
    	at oracle.eclipse.tools.weblogic.server.internal.WeblogicServerLaunchConfigurationDelegate.launch(WeblogicServerLaunchConfigurationDelegate.java:323)
    	at oracle.eclipse.tools.weblogic.server.internal.WeblogicServerLaunchConfigurationDelegate.launch(WeblogicServerLaunchConfigurationDelegate.java:130)
    	at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:853)
    	at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:703)
    	at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:696)
    	at org.eclipse.wst.server.core.internal.Server.startImpl2(Server.java:3051)
    	at org.eclipse.wst.server.core.internal.Server.startImpl(Server.java:3001)
    	at org.eclipse.wst.server.core.internal.Server$StartJob.run(Server.java:300)
    	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
    
    !ENTRY oracle.eclipse.tools.weblogic 4 4000 2010-12-17 15:03:58.979
    !MESSAGE Error reading weblogic.xml file.
    Below are my configuration files.

  • #2
    web.xml
    Code:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
    
      <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>
        	classpath:applicationContext.xml
        	classpath:applicationContext-security.xml
    	classpath:dataAccessContext.xml
        </param-value>
      </context-param>
    
    	<filter>
    		<filter-name>characterEncodingFilter</filter-name>
    		<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
    		<init-param>
    			<param-name>encoding</param-name>
    			<param-value>UTF-8</param-value>
    		</init-param>
    		<init-param>
    			<param-name>forceEncoding</param-name>
    			<param-value>true</param-value>
    		</init-param>
    	</filter>
    
    	<filter-mapping>
    		<filter-name>characterEncodingFilter</filter-name>
    		<url-pattern>/*</url-pattern>
    	</filter-mapping>
    
    	<filter>
    	    <filter-name>springSecurityFilterChain</filter-name>
    	    <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
    	</filter>
    	<filter-mapping>
    	<filter-name>springSecurityFilterChain</filter-name>
    	    <url-pattern>/*</url-pattern>
    	</filter-mapping>
    
      <listener>
        <listener-class>weblogic.spring.monitoring.WeblogicContextLoaderListener</listener-class>
      </listener>
    
      <servlet>
        <servlet-name>somename</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
      </servlet>
        
      <servlet-mapping>
        <servlet-name>somename</servlet-name>
        <url-pattern>*.html</url-pattern>
      </servlet-mapping>
    
      <welcome-file-list>
        <welcome-file>/WEB-INF/jsp/index.jsp</welcome-file>
      </welcome-file-list>
    
      <context-param>
        <param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name>
        <param-value>messages</param-value>
      </context-param>
    </web-app>
    applicationContext.xml
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans" 
    	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:p="http://www.springframework.org/schema/p" 
        xmlns:aop="http://www.springframework.org/schema/aop" 
        xmlns:dwr="http://www.directwebremoting.org/schema/spring-dwr" 
        xmlns:context="http://www.springframework.org/schema/context" 
        xmlns:jee="http://www.springframework.org/schema/jee"
        xmlns:tx="http://www.springframework.org/schema/tx"
        xmlns:util="http://www.springframework.org/schema/util"    
        xsi:schemaLocation="
          http://www.springframework.org/schema/aop 
          http://www.springframework.org/schema/aop/spring-aop-2.5.xsd...">
    
    	<!-- Auto-detect components -->
    	<context:component-scan base package="com...service"/>
    		
    	<!-- FileUpload-->
    	<bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver" />
    
    	<!-- Scan annotation -->
        <context:annotation-config />
    
    	<bean id="springApplicationContext" class="com...SpringApplicationContext"/>
    
    	<context:property-placeholder location="classpath:jdbc.properties"/>
    	
    </beans>
    applicationContext-security.xml
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    
    <beans:beans xmlns="http://www.springframework.org/schema/security"
        xmlns:beans="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:p="http://www.springframework.org/schema/p" xmlns:context="http://www.springframework.org/schema/context"
        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
          http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd
                            http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.0.xsd">
    
    	
        <global-method-security pre-post-annotations="enabled">
            
        </global-method-security>
    
    	<context:property-placeholder location="classpath:jdbc.properties"/>
    
    	<beans:bean id="dataSource"
    		class="org.springframework.jdbc.datasource.DriverManagerDataSource"
    		p:driverClassName="${jdbc.driverClassName}"
    		p:url="${jdbc.url}"
    		p:username="${jdbc.username}"
    		p:password="${jdbc.password}"
    	/>
    
    </beans:beans>

    dataAccessContext.xml
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:p="http://www.springframework.org/schema/p" xmlns:context="http://www.springframework.org/schema/context"
        xmlns:jee="http://www.springframework.org/schema/jee" xmlns:tx="http://www.springframework.org/schema/tx"
        xsi:schemaLocation="
          http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
          http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd
          http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-2.5.xsd
          http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd" default-lazy-init="true">
    
      <!-- Auto-detect the DAOs -->
      <context:component-scan base-package="com...dao"/>
     
      <bean id="jotm" class="org.springframework.transaction.jta.WebLogicJtaTransactionManager" />
    
      <bean id="dataSource"
            class="org.apache.commons.dbcp.BasicDataSource"
            destroy-method="close"
            p:driverClassName="${jdbc.driverClassName}"
            p:url="${jdbc.url}"
            p:username="${jdbc.username}"
            p:password="${jdbc.password}"
            p:maxActive="${dbcp.maxActive}"
            p:maxIdle="${dbcp.maxIdle}"
            p:maxWait="${dbcp.maxWait}"
      />
    
      <tx:annotation-driven transaction-manager="txnManager"/>
    
      <bean id="txnManager" class="org.springframework.transaction.jta.JtaTransactionManager" autowire="constructor" lazy-init="true">
        <property name="userTransaction">
          <ref local="jotm" />
        </property>
        <property name="transactionManager">
          <ref local="jotm" />
        </property>
      </bean>
    
    
      <bean class="org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor"/>
    
    </beans>
    servlet.xml
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    
    <beans xmlns="http://www.springframework.org/schema/beans" 
    	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p" xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:context="http://www.springframework.org/schema/context" xmlns:dwr="http://www.directwebremoting.org/schema/spring-dwr" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd 
    	http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd http://www.directwebremoting.org/schema/spring-dwr http://www.directwebremoting.org/schema/spring-dwr-2.0.xsd
    	http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd">
    
      <context:component-scan base-package="com...controllers"/>
    
      <bean id="viewResolver"      class="org.springframework.web.servlet.view.InternalResourceViewResolver">
        <property name="prefix" value="/WEB-INF/jsp/"/>
        <property name="suffix" value=".jsp"/>
      </bean>
    
    	<bean id="messageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
     		<property name="basenames">
    			<list>
    				<value>classpath:messages</value>
    			 </list>
    		</property>
    	</bean>
    
    	<mvc:interceptors>
    		<!-- Changes the locale when a 'locale' request parameter is sent; e.g. /?locale=de -->
    		<bean class="org.springframework.web.servlet.i18n.LocaleChangeInterceptor">
    		<property name="paramName" value="locale"/>
    		</bean>	
    	</mvc:interceptors>
    
    	<!-- Saves a locale change using a cookie -->
    	<bean id="localeResolver" class="org.springframework.web.servlet.i18n.CookieLocaleResolver" />		
    </beans>
    weblogic.xml
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <wls:weblogic-web-app xmlns:wls="http://www.bea.com/ns/weblogic/weblogic-web-app"
    	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    	xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd http://www.bea.com/ns/weblogic/weblogic-web-app http://www.bea.com/ns/weblogic/weblogic-web-app/1.0/weblogic-web-app.xsd">
    	<wls:jsp-descriptor>
    		<wls:keepgenerated>true</wls:keepgenerated>
    		<wls:page-check-seconds>60</wls:page-check-seconds>
    		<wls:precompile>true</wls:precompile>
    		<wls:precompile-continue>true</wls:precompile-continue>
    	</wls:jsp-descriptor>
    
    	<wls:container-descriptor>
    		<wls:prefer-web-inf-classes>true</wls:prefer-web-inf-classes>
    		<wls:optimistic-serialization>true</wls:optimistic-serialization>
    		<wls:show-archived-real-path-enabled>true</wls:show-archived-real-path-enabled>
    	</wls:container-descriptor>	
    
    	<wls:charset-params>
    		<wls:input-charset>
    			<wls:resource-path>/*</wls:resource-path>
    			<wls:java-charset-name>UTF-8</wls:java-charset-name>
    		</wls:input-charset>
    	</wls:charset-params>
    
    	<wls:resource-description>
    		<wls:res-ref-name>dataSource</wls:res-ref-name>
    		<wls:jndi-name>csoappsPool</wls:jndi-name>
    	</wls:resource-description>
        <wls:component-factory-class-name>org.springframework.jee.interfaces.SpringComponentFactory</wls:component-factory-class-name>
    
    </wls:weblogic-web-app>
    Last edited by eddytong; Dec 17th, 2010, 02:21 AM.

    Comment


    • #3
      Reply

      This is really a very good thread.





      Nojja567
      Katha

      Comment

      Working...
      X