url与oracle webcenter站点11gR1重写会话问题

时间:2012-09-09 19:05:13

标签: url-rewriting webcenter webcenter-sites

我正在尝试将url从“美丽的”人类可读网址重写为webcenter内部表示,反之亦然。我正在使用AssetDataManager将资产ID映射到我在URL中使用的资产描述,反之亦然。这就是我对url程序集所做的:

Session ses = SessionFactory.getSession();
AssetDataManager mgr = (AssetDataManager) ses
   .getManager(AssetDataManager.class.getName());
List<AssetId> assets = new ArrayList<AssetId>();
assets.add(new AssetId()
{
    private long   id   = assetId;
    private String type = "Page";

    @Override
    public String getType()
    {
        return type;
    }

    @Override
    public long getId()
    {
        return id;
    }
});
Iterable<AssetData> assetDataItems = mgr.read(assets);

这是用于网址反汇编:

Session ses = SessionFactory.getSession();
AssetDataManager mgr = (AssetDataManager) ses
  .getManager(AssetDataManager.class.getName());
final String assetType = "Page";

final String subType = null; 
final Condition condition = ConditionFactory.createCondition(
        "description", OpTypeEnum.EQUALS, pageName);
final List<String> desiredAttributes = Arrays.asList("id");
Query query = new SimpleQuery(assetType, subType, condition,
        desiredAttributes);
query.getProperties().setIsBasicSearch(true);

Iterable<AssetData> assetDataItems = mgr.read(query);

两者都在我的自定义汇编程序的上下文中使用,它扩展了QueryAssembler。 程序集工作正常,重用现有会话,但反汇编失败:

COM.FutureTense.Common.ContentServerException: ContentServerException: (Unexpected runtime exception) Error code:GENERIC SERVER ERROR
    at com.openmarket.Satellite.servlet.BaseServlet.doGet(BaseServlet.java:126)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at com.fatwire.wem.sso.cas.filter.CASFilter.doFilter(CASFilter.java:554)
    at com.fatwire.wem.sso.SSOFilter.doFilter(SSOFilter.java:51)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
    at java.lang.Thread.run(Thread.java:619)
Caused by: com.openmarket.Satellite.RequestContext$RequestContextInitializationException: Co-resident Satellite Server failed to capture ICS
    at com.openmarket.Satellite.RequestContext.getICS(RequestContext.java:1030)
    at com.openmarket.Satellite.RequestContext.captureInputCoResident(RequestContext.java:518)
    at com.openmarket.Satellite.RequestContext.<init>(RequestContext.java:428)
    at com.openmarket.Satellite.servlet.BaseServlet.doGet(BaseServlet.java:112)
    ... 18 more
Caused by: java.lang.NullPointerException
    at COM.FutureTense.Common.CS.PushVars(CS.java:217)
    at com.openmarket.framework.objects.ContentCatalog.Lookup(ContentCatalog.java:305)
    at com.openmarket.framework.objects.AbstractContent.Read(AbstractContent.java:510)
    at com.openmarket.framework.objects.AbstractObject.Read(AbstractObject.java:460)
    at com.openmarket.framework.objects.AbstractObject.Read(AbstractObject.java:446)
    at com.openmarket.xcelerate.asset.AssetType.Load(AssetType.java:499)
    at com.fatwire.assetapi.util.AssetUtil.isComplexAsset(AssetUtil.java:125)
    at com.fatwire.assetapi.util.AssetUtil.isFlexAsset(AssetUtil.java:274)
    at com.fatwire.assetapi.data.AssetDataManagerImpl.read(AssetDataManagerImpl.java:79)
    at mypackage.urlassembler.ComplexDisassemblyData.getAssetIdFromPageName(ComplexDisassemblyData.java:189)
    at mypackage.urlassembler.ComplexDisassemblyData.valueOf(ComplexDisassemblyData.java:145)
    at mypackage.urlassembler.MyCustomURLAssembler.getDisassemblyContext(MyCustomURLAssembler.java:79)
    at com.fatwire.cs.core.uri.AbstractAssembler.disassemble(AbstractAssembler.java:418)
    at com.fatwire.cs.core.uri.AssemblerEngine.disassemble(AssemblerEngine.java:242)
    at COM.FutureTense.Servlet.ServletRequest.disassembleURI(ServletRequest.java:852)
    at COM.FutureTense.Servlet.ServletRequest.initializeParameters(ServletRequest.java:1023)
    at COM.FutureTense.Servlet.ServletRequest.getParameters(ServletRequest.java:786)
    at COM.FutureTense.Servlet.FRequestObj.prepInput(FRequestObj.java:1090)
    at COM.FutureTense.Servlet.FRequestObj.init(FRequestObj.java:973)
    at COM.FutureTense.Servlet.FRequestObj.<init>(FRequestObj.java:271)
    at COM.FutureTense.Servlet.FRequestObj.newInstance(FRequestObj.java:231)
    at COM.FutureTense.Servlet.FRequestObj.newInstance(FRequestObj.java:218)
    at COM.FutureTense.CS.Factory.newCS(Factory.java:66)
    at com.openmarket.Satellite.RequestContext.getICS(RequestContext.java:1026)
    ... 21 more

这似乎很奇怪。由于某种原因,它无法使用现有会话。如果我将反汇编会话检索更改为此,它可以正常工作:

Session ses = SessionFactory.newSession(userName, pass);

但是,我当然不希望每次想要解析网址时都创建另一个会话。为什么我会得到例外?处理这个问题的好方法是什么?

1 个答案:

答案 0 :(得分:0)

好吧,显然网址反汇编不能做任何与数据库内容相关的事情,因为它意味着要在没有连接的卫星服务器上执行。对于使用DB的URL汇编很好,但是......

所以基于this,我发现我需要将我的Asset API代码移动到从未缓存的包装器调用的辅助类。从那里它工作正常。