Sitecore 6.6 Lucene.Net upgrade issue - sitecore

I recently upgraded my Sitecore installation from 6.5 to 6.6. Part of this upgrade also upgrades the Lucene.Net library from 2.3.1.3 to 2.9.4.1, which introduces some breaking changes. The code base used a lot of custom code around the Lucene.Net search engine, which had to be removed for the installation to work. Now that I've done that, I'm trying to re-implement the search functions, but I can't get the simplest search to compile. For example, this code:
using (var sc = SearchManager.GetIndex("system").CreateSearchContext())
{
var query = new FullTextQuery("health");
SearchHits hits = sc.Search(query);
}
produces this error:
Error 104 The type 'Lucene.Net.Search.Query' is defined in an assembly
that is not referenced. You must add a reference to assembly
'Lucene.Net, Version=2.3.1.3, Culture=neutral,
PublicKeyToken=null'.
I've confirmed that I only have the 2.9.4.1 version of Lucene.Net referenced in my project. Why is this code looking for the 2.3.1.3 version?

#MarkCassidy nailed it - I did the upgrade on the server, but I was developing locally, so my local copy of the Sitecore.Kernal DLL was still at 6.5. Copying the 6.6 version down locally cleared up the compile error and let me know that my code example is obsolete, which is more along the lines of what I was expecting.

Related

How to call tensorflow::NewSession in c++

I am using c++ to load and run tensorflow graph. The tensorflow version is 2.1 cpu. I have included necessary header files and the libary _pywrap_tensorflow_internal.lib
I use
unique_ptr<tensorflow::Session> session_inception(tensorflow::NewSession(SessionOptions()));
to create a new session. The compiling has no error.
But when I build the executable, there is a link error saying that NewSession is an unresolved external symbol. I guess the function "NewSession" is not in the library file "_pywrap_tensorflow_internal.lib".
How to call NewSession in c++ environment? or maybe using new APIs to run the graph (instead of using session)? Thank you very much.
I assume you're using this code from 2016: https://gist.github.com/kyrs/9adf86366e9e4f04addb which I found by googling for "session_inception". This code predates TensorFlow 2.1 and 2.0 (which was released in September 2019).
The TensorFlow 2.1 documentation does not list any function or type named Session or NewSession - I'm not a TensorFlow user but I think ClientSession is the current type you want.
Here's the sample code from the TensorFlow 2.1 documentation
Scope root = Scope::NewRootScope();
auto a = Placeholder(root, DT_INT32);
auto c = Add(root, a, {41});
ClientSession session(root);
std::vector outputs;
Status s = session.Run({ {a, {1}} }, {c}, &outputs);
if (!s.ok()) { ... }
That said, if you want to run this code from March 2016 you should just download the closest version of TensorFlow released around that date, which is version v0.7.1 available here: https://github.com/tensorflow/tensorflow/releases/tag/v0.7.1 - this is probably inadvisable as TensorFlow's documentation website only has documentation for versions released after v1.0
As an aside, I assume you're relatively new to working in C++ because I found this information quickly in a matter of seconds - had you done the same you wouldn't have posted this question to SO. If you are inexperienced working with C++ or TensorFlow then I advise you that it would be a bad idea to go wading around obsolete and unsupported C++ libraries as you'll be SOL if anything goes wrong - and things will go wrong, especially with prelease versions of TensorFlow.

Debugging XSLT with Intellij and Saxon - Unsupported Transformer

I'm currently trying to convert xml files to a completely different format, using IntelliJ Community Edition +Saxon to write and debug the stylesheet.
I have already Saxon-HE 9.7.0-5 as the top-most module dependency.
Running the stylesheets with the XSLT-Runner works just fine, but when I try to debug it, I get some errors.
When I specify no VM arguments I get:
java.lang.UnsupportedOperationException: Unsupported Transformer: net.sf.saxon.jaxp.TransformerImpl
at org.intellij.plugins.xsltDebugger.rt.engine.local.LocalDebugger.prepareTransformer(LocalDebugger.java:98)
at org.intellij.plugins.xsltDebugger.rt.engine.local.LocalDebugger.<init>(LocalDebugger.java:51)
at org.intellij.plugins.xsltDebugger.rt.engine.remote.DebuggerServer$1.<init>(DebuggerServer.java:55)
at org.intellij.plugins.xsltDebugger.rt.engine.remote.DebuggerServer.<init>(DebuggerServer.java:55)
at org.intellij.plugins.xsltDebugger.rt.engine.remote.DebuggerServer.create(DebuggerServer.java:71)
at org.intellij.plugins.xsltDebugger.rt.XSLTDebuggerMain.start(XSLTDebuggerMain.java:53)
at org.intellij.plugins.xslt.run.rt.XSLTRunner.main(XSLTRunner.java:143)
When I specify the VM-Arguments
-Dxslt.transformer.type=saxon
as recommended here, I get the following error:
javax.xml.transform.TransformerException: The URI http://www.w3.org/2005/xpath-functions does not identify an external Java class
Has anyone else experienced this?
IntelliJ IDEA Supports Saxon 9 Debugging up to Saxon 9.3.0.11.
As of Saxon 9.4.0.0 the net.sf.saxon.lib.TraceListener interface introduced braking changes net.sf.saxon.lib.TraceListener#open() => net.sf.saxon.lib.TraceListener#open(Controller) that got never adapted by JetBrains.
Since Maven artifacts for 9.3 are hard to come by you might want to manually get it from from SF.
https://sourceforge.net/projects/saxon/files/Saxon-HE/9.3/
Regarding your stack trace; It has a different story but ultimately results in going back to 9.3.
As of today, 9.3 seems to be the latest version that works with the current IntelliJ 2017.1.2 version.

yocto - using gdb with externalsrc

We’re extending an existing Yocto project. We’d like to be able to selectively modify components of the project and build using the local modifications, then debug those modifications with gdb.
We’ve added these features to get gdb and the debug symbol packages into the image:
EXTRA_IMAGE_FEATURES = "debug-tweaks tools-debug"
IMAGE_FEATURES = "ssh-server-openssh dbg-pkgs"
We’ve added these variables to build from the local component code:
INHERIT += "externalsrc"
EXTERNALSRC_pn-[component] = “[local source code path]/[component]”
All seems well, as the build succeeds and the component in the image reflects local code changes. However, the component source code never makes it into the image, so it can’t be referenced in gdb.
Is there a secret to using dbg-pkgs and EXTERNALSRC together?
I believe this was due to a bug that was resolved in the 2.1 release, though I never pinpointed which commit actually resolved the issue. There's a bugzilla entry covering the issue - if you are still experiencing this with 2.1 please do let me know.

Firebreath plugin on windows fails to load in chrome

I am busy converting by existing firebreath plugin here to use gpgme instead of making calls via the OS and the gpg binary.
I have managed to get the code to compile in windows using VS 2010 on a x32 system but after loading the plugin into chrome I can not access the npapi code at all. Even simple version calls fails.
When loading the plugin I get no visible errors but when using sawbuck log viewer for chrome I get the erorr messages below.
.\renderer\webplugin_delegate_proxy.cc 347 PluginMsg_Init returned false
..\plugins\npapi\webplugin_impl.cc 271 Couldn't initialize plug-in
I have tried to use my code with both firebreath 1.4 and 1.6 and neither versions work. After some simple debugging it seems that using any code provided by gpgme (whether its called or not) causes the plugin to break.
I came to this conclusion by doing the following.
Created a new project with firebreath (versions 1.4 and 1.6)
Add the gpgme.h headers to gmailGPGAPI.cpp and changed nothing else aside from adding the required reference paths to the project.
Build the project to create the dll (this generates the dll fine).
Replace the existing ddl in my project with the dll in step 2 and test it with the following piece of code
plugin = document.createElement('object'); plugin.id = 'plugin';
plugin.type = 'application/x-gmailtest';
document.body.appendChild(plugin);
console.log("my plugin returned: "+ plugin.valid);
console.log("my plugin returned: " + plugin.version);
This returns valid = true and the version returns what ever i set it to.
I then modified gmailGPGAPI.cpp to now return the gpg version by calling gpgme_check_version(NULL) in the version method. I used that method because its probably the simplest returning function that I could test with.
Build the plugin and copy dll to chrome extension as in step 3-4. The plugin builds fine again as expected.
Load the plugin and try to execute the code in step 4 at which point it now just returns undefined for any property or method i try to access on the plugin. No errors are printed to the console or anywhere else in chrome except for the error logged to sawbuck.
I have got no idea where to look or what to try since I cant seem to get an actionable error to work against. I have also reduced by test code to the point where its just a new project with a one line change to make it easier to find the problem.
I should note the code in the repo builds fine in linux/OSX and loads into chrome correctly so I know at some level my code does work.
Two possible paths:
You may have a DLL dependency that isn't available which keeps the plugin from loading; if you run regsvr32 on it in the state where it doesn't work on chrome, does it work?
Your plugin may be loading and then crashing. Start chrome with --plugin-startup-dialog and then when it pops up a dialog warning you that a plugin is about to be loaded attach to that process and see if the process crashes. At this point you can also set breakpoints to try to figure out how far it gets.
Double check your metadata in PluginConfig.cmake as well; sometimes unusual characters in some fields can cause issues like this.

CFbuilder cfscript Unresolved Components

I just upgraded to cfbuilder 2 and I am noticing some weird issues with the IDE. Namely that native components to ColdFusion are not recognized as valid components with in cfbuilder.
On such issue is with StoredProc(com.adobe.coldfusion.storedproc).
I should be able to do something like below and get full code complete on the variable spService. However this does not work at all, I get the warning Unresolved Component StoredProc.
Anyone know if this is a known issue?
var spService = new StoredProc();
Works fine for me. Version 2.0.0 Build: 277745
Not sure if this is the cause, but did you add CFIDE as Linked Resources?
Project Properties -> Linked Resources.