使用custom.jsp实现SAP BO免登录失败问题求助
Hey there, let's figure out why your custom.jsp isn't skipping the SAP BO login prompt and get you up and running. Since you're new to SAP BO, I'll walk you through common issues and step-by-step fixes:
First, confirm your custom.jsp is in the exact correct path:SAP BusinessObjects\tomcat\webapps\BOE\WEB-INF\eclipse\plugins\webpath.InfoView\web
- Make sure the filename is spelled correctly (case matters on some OS like Linux)
- Tomcat often caches old files, so delete everything in
SAP BusinessObjects\tomcat\workthen restart Tomcat to force it to load your updatedcustom.jsp
You only shared a snippet of your code, but it's probably missing the full SDK login flow needed to create a valid BOE session. Here's a complete, working template you can adapt:
<%@ page import="com.crystaldecisions.sdk.framework.IEnterpriseSession" %> <%@ page import="com.crystaldecisions.sdk.framework.CrystalEnterprise.getSessionMgr" %> <%@ page import="com.crystaldecisions.sdk.exception.SDKException" %> <% // Replace these with your actual BOE credentials and CMS details String boUsername = "your_bo_username"; String boPassword = "your_bo_password"; String cmsServer = "your_cms_hostname:6400"; // Default CMS port is 6400 String authType = "secEnterprise"; // Use secWinAD for Active Directory, secLDAP for LDAP try { // 1. Create a BOE enterprise session IEnterpriseSession boSession = getSessionMgr().logon(boUsername, boPassword, cmsServer, authType); // 2. Store the session in the HTTP session (BOE needs this to recognize you as logged in) session.setAttribute("InfoViewSession", boSession); // 3. Redirect to the BOE homepage (adjust path based on your BOE version) // For BOE 4.2+, use /BOE/BI; for older versions, try /BOE/InfoViewApp/home.do response.sendRedirect(request.getContextPath() + "/BI"); } catch (SDKException e) { e.printStackTrace(); out.println("Login failed: " + e.getMessage()); } %>
- Don't forget to replace the placeholder values with your actual BOE credentials and CMS server info
- Double-check the homepage path: if
/BIdoesn't work, try/BOE/InfoViewApp/home.dodepending on your BOE version
Make sure the Tomcat service user has read access to your custom.jsp file:
- On Windows: Right-click the file → Properties → Security → Ensure the Tomcat user (or "Everyone" for testing) has Read permissions
- On Linux: Run
chmod 644 custom.jspto set read permissions for all users
Log into the BOE Central Management Console (CMC) to rule out account/configuration issues:
- Confirm your user account is active and not locked
- Ensure the authentication type in your code matches the one configured for your user (e.g., if you're using AD, use
secWinADinstead ofsecEnterprise) - Check if there are any forced password policies that might block auto-login
If you're still stuck, create a simple test JSP to confirm the SDK login works:
<%@ page import="com.crystaldecisions.sdk.framework.IEnterpriseSession" %> <%@ page import="com.crystaldecisions.sdk.framework.CrystalEnterprise.getSessionMgr" %> <%@ page import="com.crystaldecisions.sdk.exception.SDKException" %> <% String boUsername = "your_bo_username"; String boPassword = "your_bo_password"; String cmsServer = "your_cms_hostname:6400"; String authType = "secEnterprise"; try { IEnterpriseSession boSession = getSessionMgr().logon(boUsername, boPassword, cmsServer, authType); out.println("✅ Login successful! Logged in as: " + boSession.getUserInfo().getUserName()); boSession.logoff(); // Clean up after test } catch (SDKException e) { out.println("❌ Login failed: " + e.getMessage()); e.printStackTrace(); } %>
If this test page shows a success message, your SDK setup is good— the issue is likely with session storage or redirect path. If it fails, double-check your credentials/CMS address.
Sometimes browsers cache old login prompts or session data. Test your custom.jsp in incognito/private mode, or clear your browser's cache and cookies before trying again.
内容的提问来源于stack exchange,提问作者Priyabrata

