Monday, October 22, 2012
My PC is slow when I try to shut down
Check your EventViewer and localize the error. This can depends on something is wrong with Windows Update and need to be reparated.
Go to
http://fixitcenter.support.microsoft.com/Portal
and download their tool and run it to fix all possible problems.
Tuesday, October 2, 2012
AssemblyInfo.cs' could not be opened ('Unspecified error ')
Error AssemblyInfo.cs could not be opened
So you open a project in Visual Studio 2010 and get an odd error:
- Within Visual Studio 2010, select Tools > Create GUID
- Click Copy (or New GUID then Copy)
- Click Exit
- Expand the Properties folder in the Solution Explorer (Control + W, S to open)
- Delete the AssemblyInfo.cs file shown with the exclaimation point
- Double click on the Properties folder - this should open the Properties window
- On the Application Tab, click the Application Information... button
- Fill in the application information, paste the GUID you copied into the GUID field - when done click OK
Monday, October 1, 2012
The database could not be exclusively locked to perform the operation. (Microsoft SQL Server, Error: 5030)
When you try to rename a database, you get the following error message:
Problem:
The database could not be exclusively locked to perform the operation. (Microsoft SQL Server, Error: 5030)
This can be resolved by the following:
sp_who
Check which Process id use your database (dbname) and kill the process:
kill 15
Where spid = 15 is the process that lock the database you are trying to have a lock on.
Problem:
The database could not be exclusively locked to perform the operation. (Microsoft SQL Server, Error: 5030)
This can be resolved by the following:
sp_who
Check which Process id use your database (dbname) and kill the process:
kill 15
Where spid = 15 is the process that lock the database you are trying to have a lock on.
Monday, September 17, 2012
NHibernate.MappingException: No persister for:
This can have at least the following reason:
You may forget du add for example HasMany for the persisting class to make a relationship.
HasMany(x => x.myTableId).KeyColumn("mytableID");
Sunday, September 16, 2012
No message body writer has been found for response class
No message body writer has been found for response class
You need to add the following in maven:
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-jaxrs</artifactId>
<version>1.3.0</version>
</dependency>
Error serializing the response, please check the server logs, response class
Add the following:
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-jaxrs</artifactId>
<version>1.9.9</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-xc</artifactId>
<version>1.9.9</version>
</dependency>
You need to add the following in maven:
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-jaxrs</artifactId>
<version>1.3.0</version>
</dependency>
Error serializing the response, please check the server logs, response class
Add the following:
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-jaxrs</artifactId>
<version>1.9.9</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-xc</artifactId>
<version>1.9.9</version>
</dependency>
Tuesday, September 11, 2012
Unit test
[TestMethod]
public void can_save_and_read_pbentity2()
{
object id;
// Save to database using PbPlatsannonsEntity
using ( var tx = CurrentSession.BeginTransaction())
{
id =
CurrentSession.Save(
new PbPlatsannonsEntity
{ Annonsrubrik = "Rubrik annons",
AnnonstextXml = "XML annonstext",
AntalPlatser = 12
});
tx.Commit();
}
CurrentSession.Clear();
//Read from database
using ( var tx = CurrentSession.BeginTransaction() )
{
var pbPlatsannonsEntity = CurrentSession.Get<PbPlatsannonsEntity>(id);
Assert.Equals("Rubrik annons", pbPlatsannonsEntity.Annonsrubrik);
Assert.Equals("XML annonstext", pbPlatsannonsEntity.AnnonstextXml);
Assert.Equals(12, pbPlatsannonsEntity.AntalPlatser);
//Assert.Equals(new DateTime(2000, 1, 1), pbPlatsannonsEntity.Created);
tx.Commit();
}
}
Tuesday, September 4, 2012
Collections.sort java: sorting java object
//Sort aktlist
final Comparator< aktlist > DATE_ORDER =
new Comparator< aktlist >() {
@Override
public int compare( aktlist a1, aktlist a2) {
return a2.getDatum().compareTo(a1.getDatum());
}
};
Collections.sort( aktlist , DATE_ORDER);
More information:
http://docs.oracle.com/javase/tutorial/collections/interfaces/order.html
Subscribe to:
Posts (Atom)