Rajkiran
Rajkiran

Reputation: 61

How to run Spring boot on weblogic 10.3.6

I am trying to run the similar Hello world spring boot WEB application on Weblogic 10.3.6

And like mentioned [here][1] And I have tried both the approaches

  1. Implementing the Application class with implements WebApplicationInitializer and
  2. Writing our own WebInitializer and then copying all the code from SpringBootServletInitializer

Both theses methods are not helping me out to the application, I can deploy it as webapplication on weblogic 10.3.6 but when accessing it gives me same error with error code 403

Can some one please guide me on this.

Upvotes: 0

Views: 3788

Answers (2)

Zerg
Zerg

Reputation: 799

It's been a while since this question was asked but I have encountered the same problem and found a solution:

  1. Main class must implement WebApplicationInitializer
  2. Embedded Tomcat must be excluded
  3. You have to configure web.xml, dispatcher-servlet.xml and weblogic.xml

Upvotes: 0

Joao Evangelista
Joao Evangelista

Reputation: 2465

Try to exclude the embedded tomcat from starter-web pom :

     <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
         <exclusions>
            <exclusion>
              <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-tomcat</artifactId>
             </exclusion>
            </exclusions>
         </dependency>

And change the packaging to war instead of jar.

Then create a configuration class to put your beans and annotations like the classic way but this time extends SpringBootServletInitializer and override configure method, and register your configuration classes like this.

    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
        application.sources(AppConfig.class);
        return application;
    }

#sources(Object... obj)

Hope this helps

Upvotes: 1

Related Questions