Hi I have copied my Solr config from a working windows server to a new one, and it can't seem to run an import.
They're both using win server 2008 and SQL 2008R2. This is the data import config:
<dataConfig>
<dataSource type="JdbcDataSource" name="ds1"
driver="com.microsoft.sqlserver.jdbc.SQLServerDriver"
url="jdbc:sqlserver://localhost;databaseName=DB"
user="Solr"
password="pwd"/>
<document name="datas">
<entity name="data" dataSource="ds1" pk="key"
query="EXEC SOLR_COMPANY_SEARCH_DATA"
deltaImportQuery="SELECT * FROM Company_Search_Data WHERE [key]='${dataimporter.delta.key}'"
deltaQuery="SELECT [key] FROM Company_Search_Data WHERE modify_dt > '${dataimporter.last_index_time}'">
<field column="WorkDesc_Comments" name="WorkDesc_Comments_Split" />
<field column="WorkDesc_Comments" name="WorkDesc_Comments_Edge" />
</entity>
</document>
</dataConfig>
I can use MS SQL Profiler to watch the Solr user log in successfully, but then nothing. It doesn't seem to even try and execute the stored procedure. Any ideas why this would be working one server and not on another?
FTR the only thing in the tomcat catalina log is:
org.apache.solr.handler.dataimport.JdbcDataSource$1 call
INFO: Creating a connection for entity data with URL: jdbc:sqlserver://localhost;databaseName=CATLive
UPDATE:
Me and Yavar Husain from the Solr Mailing list both came up with the solution of replacing the MS JDBC Driver with an open source one - this seems to work, and means this must be a compatibility problem between the latest versions of Java, the DIH and the MS JDBC driver.
UPDATE 2:
Issues have been reported with Java 1.6.0_29 - which I am running!
http://blogs.msdn.com/b/jdbcteam/archive/2011/11/07/supported-java-versions-november-2011.aspx
This looks to have been caused by a release of Java 1.6.0_29 - which I was running:
http://blogs.msdn.com/b/jdbcteam/archive/2011/11/07/supported-java-versions-november-2011.aspx
Seeing as the problem could only be with the JDBC drivers or their config, I have worked around this issue by replacing them with the jTDS Open Source JDBC driver. My config ended up like this when I got it working with that:
<dataConfig>
<dataSource type="JdbcDataSource"
driver="net.sourceforge.jtds.jdbc.Driver"
url="jdbc:jtds:sqlserver://localhost;databaseName=DBName"
user="Solr"
password="password" name="ds1"/>
<document>
<entity dataSource="ds1" name="sometext"
query="SELECT * FROM mytable">
</entity>
</document>
</dataConfig>
HTH someone - but I'm not marking this as the answer because I can't see why I can't use the MS drivers...
I guess you are missing this
url="jdbc:mysql://localhost/dbname"
dbname -> \SQL2008
I presume when you copied your Solr config to the new server you've taken the index file too. I suspect the problem is due to the fact that Solr has already indexed this data. Your query states that you only want to index files that have changes since the last index.
Does this make sense?
The issue appears to occur only on very specific releases of the java runtime, and affects applications beyond just solr. This leads me to believe that the root cause is an incompatibility or bug between the Java runtime and Microsoft SQL Server JDBC drivers rather than being a Solr issue.
In my particular case we had two groups consisting of 3 servers each. One group showed no symptoms of this problem, and the other group all exhibited issues. All servers were running Solr 3.4.0, and the same release of SQL Server JDBC drivers 3.0. All servers were also running JRE 1.6.0_20, but upon closer inspection it was identified that the problem servers were using a slightly newer package for 1.6.0_20 (a different RPM distributed via yum for CentOS).
By downgrading the problem servers to the exact version of java on the known-good servers the problem immediately went away.
Specifically,
working:
http://pkgs.org/centos-5-rhel-5/centos-rhel-x86_64/java-1.6.0-openjdk-1.6.0.0-1.22.1.9.8.el5_6.x86_64.rpm.html
non-working:
http://pkgs.org/centos-5-rhel-5/centos-rhel-updates-x86_64/java-1.6.0-openjdk-src-1.6.0.0-1.23.1.9.10.el5_7.x86_64.rpm.html
Related
My Visual Studio 2012 Professional is having problems with a three project solution.
I have been struggling all day with a LinqToMySQL.edmx file and getting a MySQL data connection option to appear in Server Explorer.
For this I have tried installing EFTools6.1.0ForVS2012. The mysql connector I have tried is mysql-connector-net-6.7.4. This worked at one point but other problems with MySQL dll versions means I am back to square one (when I got the latest version of the DLL which I got from nuGet 6.8.3, it was still looking for 6.7.4). I have since got 6.7.4 and added the reference to the dll for all project. I've also tried editing machine.config to look for the correct mysql data provider. Still no joy.
But now...
For each solution the app.config or web.config files can't be read when trying to access Properties > Settings.
An error occurred while reading the app.config file. The file might be
corrupted or contain invalid XML
All files seem valid when checked under an XML validator.
When opening a project in VS2012 I get the error:
Microsoft Visual Studio
The ProviderPackage package did not load correctly.
The problem may have been caused by a configuration change
or by the installation of another extension. You can get more
information by examining the file
t:\Users\John\AppData\Roaming\Microsoft\VisualStudio\11.0\A
ctivityLog.xml.
When trying to create a new project I get:
Failed to create a 'ImageSource' from the text
'..\lmages\Medium.png'.
After re-installing Visual Studio the problem persists.
In the activity log the last errors are:
<entry>
<record>235</record>
<time>2014/03/25 10:28:31.202</time>
<type>Warning</type>
<source>Microsoft.VisualStudio.CommonIDE.ExtensibilityHosting.VsShellComponentModelHost</source>
<description>The catalog cache file is not up-to-date and has to be regenerated:</description>
<path>C:\Users\John\AppData\Local\Microsoft\VisualStudio\11.0\ComponentModelCache\Microsoft.VisualStudio.Default.cache</path>
</entry>
<entry>
<record>236</record>
<time>2014/03/25 10:28:31.211</time>
<type>Error</type>
<source>VisualStudio</source>
<description>SetSite failed for package [Visual Studio Component Model Host Package]</description>
<guid>{49D12072-378B-4FFA-A09E-40E0B5D097CC}</guid>
<hr>80131902</hr>
<errorinfo>Configuration system failed to initialize</errorinfo>
</entry>
<entry>
<record>237</record>
<time>2014/03/25 10:28:31.241</time>
<type>Error</type>
<source>VisualStudio</source>
<description>End package load [Visual Studio Component Model Host Package]</description>
<guid>{49D12072-378B-4FFA-A09E-40E0B5D097CC}</guid>
<hr>80131902</hr>
<errorinfo>Configuration system failed to initialize</errorinfo>
</entry>
Looks like most of these errors were caused by malformed XML in the machine.config file in the framework folder. The machine.config file in framework64 was fine which must have caused me confusion. That's what editing with notepad gets you!
Still having problems with the mysql connector but that's a separate issue.
I've tried every solution I've found on the web with no success. I continually get the error:
Running transformation: System.InvalidOperationException: The SSDL generated by the activity
called 'CsdlToSsdlAndMslActivity' is not valid and has the following errors:
No Entity Framework provider found for the ADO.NET provider with invariant name
'MySql.Data.MySqlClient'. Make sure the provider is registered in the 'entityFramework'
section of the application config file. See http://go.microsoft.com/fwlink/?LinkId=260882 for
more information.
I have an empty Console project and a very basic model to test this with. Through the NuGet Package Console I'd executed: Install-Package MySQL.Data.Entities which installed EF6, MySQL.Data and MySQL.Data.Entities and hooked up all the references and copied the relevant DLL's into the bin/Debug folder.
I wired up the provider in the following (entire config file listed)
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
<provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.Entity.EF6"></provider>
</providers>
</entityFramework>
</configuration>
As far as I can tell I have the provider registered. I have the latest MySQL connector updated as well. Where am I going wrong?
To support full functionality EF Designer requires 3 things:
EF runtime provider (you seem to have it)
DDEX provider for your database - DDEX is the way VS abstracts databases and as a result can talk to any database. Note that this is not something that is EF specific but EF Designer relies on it (again you seem to have it otherwise you would not be able to select MySQL connection)
Additional components (T4 templates/Workflow activities) required to support Model First flow - these are EF specific but typically installed as part of the DDEX provider - you seem to be missing this or you did not select the T4 template/workflow specific to your provider (open the edmx file and go to the properties window there are two options there that are interesting from DDL generation perspective - the "Database Generation Workflow" and the "DDL Generation Template". Click the dropdowns to see if you can select something that is MySQL specific)
Because you don't seem to have or use the workflow/T4 for MySQL (note I don't know if this is because you did not select the correct T4/workflow (see above) or MySQL DDEX does not support this or the installation is for whatever reason broken) EF Designer is using the default workflow which is for Sql Server. The default workflow relies on being able to find EF providers (for SqlServer and SqlServerCe) in the default path but the provider for MySQL is not there - hence the error. Note that the workflow and T4 templates for creating DDL are provider specific so even if you copied the MySQL provider to the default path it would not really work - you would get a peculiar result of SQL Server specific SQL Script using MySQL types.
We have a bug on improving this a little bit by providing a better guidance instead of just invoking the default DDL generation which we know will not work. You can also find some details in this bug.
I would suggest checking if MySQL components you are using do support Model First. An alternative would be just to move to Code First which only requires the EF runtime provider you already have to generate the DDL.
The other answer already kind of says this, but it's buried in his long post.
Notice that the error message refers to SSDLToSQL10.tt. You don't want that .tt file, you want the MySQL one. In the EF designer properties window, find the DDL Generation Template property and change it from SSDLToSQL10.tt to SSDLToMySQL.tt.
I have an ASP.NET application that I would like to upload to a host that offers a MySQL database. I am using Visual Studio 2012, .NET 4.5, Entity Framework 5.0, and I have installed MySQL for Visual Studio 1.0.2. I have been trying to connect to a local MySQL server, but I have encountered some problems.
At first I referenced MySql.Data and MySql.Data.Entity at version 6.6.5.0 in my project. But when I tried to do Update-Database in the package manager console, I got the following error:
System.DateTime System.Data.Entity.Migrations.Model.InsertHistoryOperation.get_CreatedOn()
This seems to be a problem with Entity Framework 5.0 and earlier versions of Connector/.Net - the MySQL connector for visual studio. Since the process was one of discovery, I unfortunately can't recall how my project came to reference MySql.Data and MySql.Data.Entity version 6.6.5.0.
I deleted the references, and then downloaded and referenced the same assemblies in version 6.7.4.0, using NuGet. This solved the error I got before, but now Update-Database gives me the following error:
Could not load file or assembly 'MySql.Data, Version=6.6.5.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d' or one of its dependencies.
The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
I have solved this problem by including a specific DbProviderFactory in my Web.Config file:
<system.data>
<DbProviderFactories>
<remove invariant="MySql.Data.MySqlClient" />
<add name="MySQL Data Provider"
invariant="MySql.Data.MySqlClient"
description=".Net Framework Data Provider for MySQL"
type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.7.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
</DbProviderFactories>
</system.data>
If I leave out the remove tag, I get the error:
Column 'InvariantName' is constrained to be unique. Value 'MySql.Data.MySqlClient' is already present.
I think this means that somehow my project still has a DbProviderFactory that serves version 6.6.5.0 of the MySQL libraries. But when I search the text files of my project, I can't find the string 6.6.5.0 anywhere.
At the moment this solution lets me connect to my local MySQL server, but when I publish the project to my hosting provider and go to the web site in my browser, I just get an error message. I would like to know how to remove the implicit 6.6.5.0-serving DbProviderFactory, both as part of my learning and because I think my workaround could be the reason that my web site doesn't work at my hosting provider.
As a clue in finding a solution, I find it suspicious that when I try to add a reference, I can only see (several versions of) 6.6.5.0:
But when I go to the NuGet manager, I only have version 6.7.4.0 installed:
Hope this helps.
I wrote a blog post on this subject, my project is available for download at the bottom of this paper.
I had to install (as noted in my article) MySqlDataEntity -Pre, which install the beta version 6.7.2 beta, to get good compatibility with EF 5, but I see that now the current version is noted 6.7.4, so I updated my project accordingly, and it works just as well, so I also updated the project to download from my blog.
Hope this can help you to start with EF and MySql.
BTW, in case this is not clear, you have to install, from NuGet, MySql.Data.Entities, which will also install MYSql.Data, as Entities is depending on it.
I'm using Mono/MonoDevelop on Mac OS, and I want an example for using SqlMetal (DbLinq version included with Mono) for LINQ-to-SQL with MySQL database.
Oddly, I found many examples for SQLite, but none for MySQL. Examples found for MySQL seems to refer to the Microsoft's SqlMetal.exe.
I tried to arrange my sqlmetal command from SQLite to adapt it for MySQL, but I have this message:
sqlmetal: Could not load databaseConnectionType type 'ByteFX.Data.MySqlClient.MySqlConnection, ByteFX.Data'. Try using the --with-dbconnection=TYPE option.
Help is appreciated! Thank you.
Find and edit your sqlmetal.exe.config and replace the settings not to use ByteFX (LONG unsupported) and use MySql.Data.
Remember to include the fully qualified assembly name, in my case that line looks like:
provider name="MySQL" dbLinqSchemaLoader="DbLinq.MySql.MySqlSchemaLoader, System.Data.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" databaseConnection="MySql.Data.MySqlClient.MySqlConnection, MySql.Data, Version=6.2.3.0, Culture=neutral, PublicKeyToken=2f3544035097bf97"
(I have MySql Connector installed with that version and token)
Regards
Download and install MySQL Connector/Net as per http://www.mono-project.com/MySQL
cd path_to_your MySql.Data.dll assembly
gacutil -i MySql.Data.dll
Browse to /Library/Frameworks/Mono.framework/Versions/2.10.12/lib/mono/gac/MySql.Data (or change the version number to match the version you're using) and you should see directories such as 6.6.5.0__c5687fc88969c44d
Open /Library/Frameworks/Mono.framework/Versions/2.10.12/lib/mono/4.0/sqlmetal.exe.config (or equivalent for the version you're using) and edit the databaseConnection attribute of the <provider name="MySQL" node as per BlackR2D's answer, using the properties from the folder in step 2 e.g. Version=6.6.5.0 and PublicKeyToken=c5687fc88969c44d
Make sure the path to the project you're running doesn't have a space in it or you may get a 'MonoDevelop.Database.Sql.SqlMetalExecException: sqlmetal: Could not find file' error
When you select 'Generate Linq Class' change the language to C# rather than C#2 otherwise you may get a 'MonoDevelop.Database.Sql.SqlMetalExecException: sqlmetal: Object reference not set to an instance of an object' error
I can then generate Output.cs, but still get an error if trying to generate DBML (Output.dbml):
'MonoDevelop.Database.Sql.SqlMetalExecException: sqlmetal: Access to the path "//Output.dbml" is denied'
I got this working on mono 2.10.2:
[mono-] ~ # sqlmetal /namespace:MonoService /provider:MySql "/conn:Server=[server];Database=[db];Uid=[name];Pwd=[pass];" /code:ProxyContext.cs --with-dbconnection="MySql.Data.MySqlClient.MySqlConnection, MySql.Data, Version=6.3.7.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d"
Before I put MySql.Data into the gac:
gacutil -i MySql.Data.dll
I have a site running MVC and Nhibernate (not fluent) using standard session per request in an http module, runs fine locally (also with mysql) but after a move to a hosting provider no update statements are being issued.
I can insert but not update, no exceptions are raised, I have the 'show_sql' option switched on which locally shows the update statements being issued but on the server no update statements are logged.
I don't think NHProf is an option for me as I can only run asp.net apps on my shared server, are there any other methods of diagnosing NH issues like this ?
Anyone had a similar issue ?
Cheers,
A
The issue was that I had moved from my local dev environment with IIS5 to a shared server with IIS7, IIS7 has a different syntax for registering http modules so my NHibernate session module was not firing which caused the behaviour originally described.
To fix this problem I added the modules section in the web.config under system.web to system.webServer, you can add the validation validateIntegratedModeConfiguration="false" key to the system.webServer section which will allow your config to have the module registered under both sections so you can have the same config for IIS5/IIS7.
NHProf is an option for you!
You can have it log to a file, then pick that file up later. This is the log4net config you need:
<log4net>
<appender name="NHProfAppender"
type="HibernatingRhinos.Profiler.Appender.NHibernate.NHProfOfflineAppender,
HibernatingRhinos.Profiler.Appender" >
<file value="nhprof_output.nhprof" />
</appender>
<logger name="HibernatingRhinos.Profiler.Appender.NHibernate.NHProfAppender.Setup">
<appender-ref ref="NHProfAppender"/>
</logger>
</log4net>
Alternatively, if you don't have an NHProf license, you can log the NHibernate stuff to a file in order to see what's happening.