3

I am trying to load some Custom Meta from a component which is published into the Tridion Broker.

This is 2009 SP1

I can see the component in the Custom_Meta table with a query like:

SELECT * FROM [Tridion_Broker].[dbo].[CUSTOM_META] WHERE ITEM_ID = 204221

However using the below code, I get a Java Runtime exception on the line where I do GetMeta. I have noticed that if my queryStringId is a proper TCM ID then it will throw the excpetion but if I just put the item Id it will return 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;
    }
}

Stack trace:

[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

Update I have looked in the Broker log with the log enabled on "info" level and am seeing nothing after "Tridion Broker is enabled". Is this a configuration or DLL problem? It looks like the CD is not calling the service at all?

Update 2 I have tried a lot of things and still no help. It's like the code is not able to communicate with the JVM, however I can see the JVM being started in the event log.

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
Rob Stevenson-Leggett
  • 35,279
  • 21
  • 87
  • 141

2 Answers2

9

Are you using Java 1.6? I think you may be using the JDBC driver is for Java 1.5, if so download the latest driver from here

Also double check all your bindings in broker config!

Rob Stevenson-Leggett
  • 35,279
  • 21
  • 87
  • 141
Chris Morgan
  • 700
  • 6
  • 19
4

Typically when I had this kind of error, it was because one of the following:

  • the Java run-time was not installed or available to the web-app (from previous comments I see this is not the case for you). Have you checked the event viewer (either Tridion or Tridion Content Manager) for errors? Something like 'Unable to locate JVM'...

  • missing JAR - a Tridion or 3rd party JAR is missing from your classpath (which could be under your webroot/bin/lib);

  • configuration error (Tridion config is wrong, somewhere in webroot/bin/config);

  • missing license file (check the webroot/bin/config/cd_licenses.xml or maybe your config files point to another cd_licenses.xml, which might not be available or accessible to the web app app-pool user). A missing license is maybe the trickiest. All you see in the log is a subtle mention stating that due to missing/expired license, the Broker has reverted to 'file system'. This means no communication with the CD DB will be made -- for Custom meta this is a no go;

The last 3 errors will be somewhat present in a log file. So make sure you have the log level debug enabled and look for any stack traces in the cd_core and cd_broker logs.

Last but not least, make sure your website app-pool is unique to the Tridion website (do not reuse in other website). Check the .net version used (recommend 4.0) and check the user running it (recommend Network Service).

Mihai Cădariu
  • 2,407
  • 14
  • 17