我正在嘗試在 weblogic 12c (12.2.1) 上部署一個以 angular 為前端的 spring-boot 應用程序。我的代碼可在 - https://github.com/onkar0777/Angular-SpringBoot-REST-JWT我用 mvn clean install 創建了一場戰爭,它在使用 java -jar 運行時運行良好但是,當我將相同的戰爭部署到 weblogic 時,在點擊http://192.168.1.6:7001/myweb 時出現錯誤(myweb 是上下文根)白標錯誤頁面 此應用程序沒有明確的 /error 映射,因此您將其視為后備。Wed Aug 22 13:28:58 IST 2018 出現意外錯誤(type=Forbidden,status=403)。拒絕訪問我猜想以某種方式 weblogic 沒有將調用定向到 MainControllerpackage com.app.api;import org.springframework.stereotype.*;import org.springframework.web.bind.annotation.*;import springfox.documentation.annotations.*;@ApiIgnore@Controller // Dont use RestController as this method is mapping to a static file not a JSONpublic class MainController { @RequestMapping(value={"/"}) public String index() { return "index.html"; }}主應用程序package com.app;import javax.annotation.Resource;import org.springframework.boot.Banner;import org.springframework.boot.CommandLineRunner;import org.springframework.boot.autoconfigure.SpringBootApplication;import org.springframework.boot.autoconfigure.domain.EntityScan;import org.springframework.boot.builder.SpringApplicationBuilder;import org.springframework.boot.web.support.SpringBootServletInitializer;import org.springframework.data.jpa.repository.config.EnableJpaRepositories;import org.springframework.transaction.annotation.EnableTransactionManagement;import org.springframework.web.WebApplicationInitializer;import com.app.services.StorageService;@SpringBootApplication@EnableJpaRepositories(basePackages ={ "com.app.repo"})@EntityScan(basePackages ={ "com.app.model"})@EnableTransactionManagementpublic class MainApp extends SpringBootServletInitializer implements CommandLineRunner, WebApplicationInitializer { @Resource StorageService storageService; @Override public void run(String... arg) throws Exception { storageService.deleteAll(); storageService.init(); }
添加回答
舉報
0/150
提交
取消