0

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.

Michael Petch
  • 46,082
  • 8
  • 107
  • 198
Rajkiran
  • 61
  • 2
  • 8

2 Answers2

1

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

Joao Evangelista
  • 2,407
  • 2
  • 26
  • 37
  • Still not working and getting this ugli stuff Error 403--Forbidden From RFC 2068 Hypertext Transfer Protocol -- HTTP/1.1: 10.4.4 403 Forbidden The server understood the request, but is refusing to fulfill it. Authorization will not help and the request SHOULD NOT be repeated. If the request method was not HEAD and the server wishes to make public why the request has not been fulfilled, it SHOULD describe the reason for the refusal in the entity. This status code is commonly used when the server does not wish to reveal exactly why the request has been refused, or when no other response... – Rajkiran Dec 15 '14 at 15:42
  • Looks like an Weblogic issue then, check this out http://stackoverflow.com/questions/11026110/weblogic-error-403-forbidden – Joao Evangelista Dec 15 '14 at 16:01
0

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
Zerg
  • 739
  • 4
  • 11
  • 22