Weblogic Error 403--Forbidden

2019-02-02 13:46发布

I am trying to run a Java EE application on weblogic. The application works fine on Tomcat. I have customized the war file to include weblogic.xml. This file includes the following code:-

<container-descriptor>
    <show-archived-real-path-enabled>true</show-archived-real-path-enabled>
</container-descriptor>

I have also changed the configuration in properties file of the application to reflect the port on which container is listening. server.port=7001 server.modjk.enabled=false

My web.xml file includes the following code:-

<servlet>
    <servlet-name>olatservlet</servlet-name>
    <servlet-class>org.olat.core.servlets.OLATServlet</servlet-class>

    <!-- Set the load order -->
    <load-on-startup>1</load-on-startup>
</servlet>

<servlet-mapping>
    <servlet-name>olatservlet</servlet-name>
    <url-pattern>/</url-pattern>
</servlet-mapping>

<servlet-mapping>
    <servlet-name>olatservlet</servlet-name>
    <url-pattern>/*</url-pattern>
</servlet-mapping>

When I was initially running the war file on weblogic 11g, I was getting a nullpointer exception. However, I could deploy the file when I removed XerceImpl.jar from the lib folder. Now I am able to deploy the application successfully. I name the context root in the weblogic as the name of the war file. When I try to open the link generated by weblogic in its testing tab, I get the following error:-

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 is applicable.

I was wondering if someone could tell me how to resolve this issue.

7条回答
做自己的国王
2楼-- · 2019-02-02 14:21

I had the same issue with one of the service provider I created.

I was trying to access it via my web browser and I couldn't find the reason why I had this error message until I understood that effectively the server really understood the request but in order, for you to have the response, you have to specify the right format (or mediatype) to be able to read it and then the server will give you the response.

To sumarize, the service provider was providing an "application/xml" response while I was asking for an "application/html" until I built my own client consumer that was expecting an "application/xml" and then the server accepted to reply back the response.

查看更多
登录 后发表回答