2016-02-26 58 views
0

我嘗試使用ADF中的導航規則的傳統方法,但它不起作用。可能因爲它是jspx而不是​​頁面。導航到新頁面時獲取500錯誤代碼

嗯,我寫了上行動觸發按鈕點擊代碼:下面是bean類的方法的代碼:

FacesContext ctx = FacesContext.getCurrentInstance(); 
JOptionPane.showMessageDialog(null, "2", "InfoBox: " + "Info", JOptionPane.INFORMATION_MESSAGE); 
HttpServletRequest request = (HttpServletRequest)ctx.getExternalContext().getRequest(); 
//Commented as authentication not required: 
/* CallbackHandler handler = new SimpleCallbackHandler(un, pw); 
Subject mySubject = Authentication.login(handler); 
ServletAuthentication.runAs(mySubject, request); 
ServletAuthentication.generateNewSessionID(request);*/ 

String loginUrl = "http://127.0.0.1:7101/ServiceCloudJavaApp/faces/ServiceRequests.jspx"; 
ctx.getViewRoot().getViewId(); 
HttpServletResponse response = (HttpServletResponse) ctx.getExternalContext().getResponse(); 
sendForward(request, response, loginUrl); 

......... 
} 

private void sendForward(HttpServletRequest request, HttpServletResponse response, String loginUrl) { 

    FacesContext ctx = FacesContext.getCurrentInstance(); 
    RequestDispatcher dispatcher = request.getRequestDispatcher(loginUrl); 
    try 
    { 
     dispatcher.forward(request, response); 
    } 
    catch (ServletException se) 
    { 
     JOptionPane.showMessageDialog(null, se.toString(), "InfoBox: " + "Info", JOptionPane.INFORMATION_MESSAGE); 
    } 
    catch (IOException ie) 
    { 
     JOptionPane.showMessageDialog(null, ie.toString(), "InfoBox: " + "Info", JOptionPane.INFORMATION_MESSAGE); 
    } 
    catch (Exception excep) 
    { 
     //JOptionPane.showMessageDialog(null, exep.toString(), "InfoBox: " + "Info", JOptionPane.INFORMATION_MESSAGE); 
     System.out.println("error:" + excep.toString()); 
    } 
    ctx.responseComplete(); 
} 

我收到網頁無法顯示! 錯誤代碼:500

錯誤日誌是here

+0

難道你沒有更多的細節在服務器日誌? – Berger

+0

錯誤代碼500意味着內部服務器錯誤。所以請從您的服務器日誌中提供完整的堆棧跟蹤。 – Anil

+0

好的!我認爲我的代碼有問題,所以想先顯示我的代碼。我會在文本文件中發佈日誌並分享鏈接 –

回答

0

如果您聽到異常java.lang.Exception的:MDSLockedSessionManager已經註冊。無法註冊多個。 at oracle.adf.share.mds.MDSTransManager.registerMDSLockedSessionManagerInst(MDSTransManager.java:131)

這意味着您的描述符中的某個元數據有重複條目。檢查您的元數據XML文件,如weblogic-application.xml或相應的xml文件。

+0

ohk會檢查。謝謝 –

+0

我正在導航到新URL的方式正確嗎? –

+0

沒有運氣先生,我沒有找到任何重複的條目! –