Skip to content

Instantly share code, notes, and snippets.

@jagregory
jagregory / gist:985963
Created May 22, 2011 22:17
Jersey error
SEVERE: A message body writer for Java class conman.entities.User, and Java type class conman.entities.User, and MIME media type application/json was not found
May 22, 2011 11:17:06 PM com.sun.jersey.spi.container.ContainerResponse write
SEVERE: The registered message body writers compatible with the MIME media type are:
application/json ->
com.sun.jersey.json.impl.provider.entity.JSONJAXBElementProvider$App
com.sun.jersey.json.impl.provider.entity.JSONArrayProvider$App
com.sun.jersey.json.impl.provider.entity.JSONObjectProvider$App
com.sun.jersey.json.impl.provider.entity.JSONRootElementProvider$App
com.sun.jersey.json.impl.provider.entity.JSONListElementProvider$App
*/* ->
SEVERE: Exception starting filter addCacheHeadersFilter
java.lang.ExceptionInInitializerError
at jetbrains.buildServer.web.AddCacheHeadersFilter.<clinit>(AddCacheHeadersFilter.java:6)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at java.lang.Class.newInstance0(Class.java:355)
at java.lang.Class.newInstance(Class.java:308)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:255)
@jagregory
jagregory / Restish.cs
Created May 4, 2011 13:51
Watch out NancyFX!
public class Api : Restish
{
Api()
{
Get("/customers", (req, res) =>
{
return View(new[]
{
new { name = "Charles" }
});
public class MyClassMap: ClassMap<MyClass>
{
public MyClassMap()
{
Id(x => x.Id)
.Column("MyClassId")
.GeneratedBy.HiLo("100");
Map(x => x.Something)
.Length(150);
@Path("/customers")
class CustomerResource {
@GET
@Produces(Array(MediaType.APPLICATION_JSON))
@Path("{id}")
def getJson(@PathParam("id") id: Int) =
"Id requested was: " + id.toString()
}
@Path("/customers")
class CustomerResource {
@GET
def get =
"[{ 'name': 'James' }, { 'name': 'Gregory' }]"
@GET
def get(id) =
"{ 'name': 'James' }"
}
public class MyEnum
{
public static readonly MyEnum Value1 = new MyEnum("value1");
public static readonly MyEnum Value2 = new MyEnum("value2");
readonly string name;
MyEnum(string name)
{
this.name = name;
Establish context = () =>
controller = Container.Resolve<OrderController>();
@jagregory
jagregory / app.coffee
Created January 15, 2011 13:05
Mmmmm node
app.post '/buy', (req, res) ->
googleCheckout.sendInitialOrderRequest req, (redirectUrl) ->
res.redirect redirectUrl
git status:
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# renamed: file -> elif
#
commit: