我试图从发布到Tridion Broker的组件加载一些Custom Meta.
这是2009 SP1
我可以看到Custom_Meta表中的组件,其查询如下:
SELECT * FROM [Tridion_Broker].[dbo].[CUSTOM_META] WHERE ITEM_ID = 204221
Run Code Online (Sandbox Code Playgroud)
但是使用下面的代码,我在GetMeta的行上得到一个Java Runtime异常.我注意到如果我的queryStringId是一个正确的TCM ID,那么它将抛出excpetion但是如果我只是把项目ID它将返回null.
string queryStringId = HttpUtility.UrlDecode(Request.QueryString["component_uri"]);
string pageId = ((BasePage) Page).PageTcmId;
int publicationId = int.Parse(pageId.Split(':')[1].Split('-')[0]);
using (var cmf = new ComponentMetaFactory(publicationId))
{
IComponentMeta cm = cmf.GetMeta(queryStringId);
if(cm != null)
{
VideoId = cm.CustomMeta.GetValue("video_url").ToString();
}
else
{
litMessage.Visible = true;
}
}
Run Code Online (Sandbox Code Playgroud)
堆栈跟踪:
[RuntimeException]
Codemesh.JuggerNET.NTypeValue.Throw(Int64 inst) +351
Codemesh.JuggerNET.JavaClass.ThrowTypedException(Int64 inst) +1278
Codemesh.JuggerNET.JavaMethod.CallObject(JavaProxy jpo, JavaMethodArguments args) +551
Codemesh.JuggerNET.JavaMethod.CallObject(JavaProxy jpo, Type declaredType, Boolean bLeaf, JavaMethodArguments jargs) +50
Com.Tridion.Meta.ComponentMetaFactory.GetMeta(Int32 componentId) +118
Tridion.ContentDelivery.Meta.ComponentMetaFactory.GetMeta(Int32 componentId) +16
ASP._controls_video_ascx.Page_Load(Object sender, EventArgs args) in c:\Inetpub\wwwroot\borland\us\_controls\Video.ascx:18
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +50
System.Web.UI.Control.LoadRecursive() +141
System.Web.UI.Control.LoadRecursive() +141
System.Web.UI.Control.LoadRecursive() +141
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627
Run Code Online (Sandbox Code Playgroud)
更新 我查看了Broker日志,并在"info"级别启用了日志,并在"Tridion Broker启用"后看不到任何内容.这是配置还是DLL问题?看起来CD根本没有调用服务?
更新2 我尝试过很多东西但仍然没有帮助.这就像代码无法与JVM通信,但是我可以看到JVM在事件日志中启动.
| 归档时间: |
|
| 查看次数: |
529 次 |
| 最近记录: |