dhanji / sitebricks Goto Github PK
View Code? Open in Web Editor NEWSitebricks: A fast platform for web development.
Home Page: http://sitebricks.org
License: Apache License 2.0
Sitebricks: A fast platform for web development.
Home Page: http://sitebricks.org
License: Apache License 2.0
file extention just uses .html/.htm, and java class uses annotation like this:
@Show(template="SomePage.html", engine="mvel")
public class SomePage {}
com.google.sitebricks.SitebricksFilter
77~81
if (null == response.getContentType()) {
response.setContentType(respond.getContentType());
}
response.getWriter().write(respond.toString());
com.google.sitebricks.StringBuilderRespond
27
private static final String TEXT_HTML = "text/html";
since utf-8 is most popular charset,should TEXT_HTML set to "text/html;charset=utf-8"?
The SiteBricks webclient does not support HTTPS connection. A ClasCastException is thrown.
See this Gist for sitebricks-acceptance test illustrating the situation https://gist.github.com/2892113 Note that this test will pass by default because the Guice Injector is in DEVELOPMENT stage. The bug only exhibits in Stage.PRODUCTION.
I would like to have one Page handle two URL forms. Really, I want an optional extra path info element. Is there a better way? I did try multiple @get method. I tried no registering the second at call below -- but that only gave me a 404 when requesting "/foo" as I expected.
at("/foo/:arg").show(FooPage.class);
at("/foo").show(FooPage.class);
Given a FooPage that has one @get method. Though certainly it might have more than one @get:
@Get public void fooGetMethod(@Named("arg") String argument) { ... }
In Stage.DEVELOPMENT this works fine. But in production stage I'm being bit by a seemingly disconnect between the PageTuple and the DefaultPageBook. I know that in DEVELOPMENT stage it's working because if the widget is null, it doesn't matter, it's just recompiles per the appropriate template. So... the DefaultPageBook.get(String uri):Page method has:
@Nullable
public Page get(String uri) {
final String key = firstPathElement(uri);
List<PageTuple> tuple = pages.get(key);
Which, in my scenario above results in a List of size 2. But while the ScanAndCompileBootstrapper was, well, bootstrapping, it only compiled the first PageTuple because the equals method is based only on the clazz.
I tested this against sitebricks:0.8.6, and get the following exception to make sure this is not something I introduced with my fork.
java.lang.NullPointerException
at com.google.sitebricks.routing.WidgetRoutingDispatcher.bindAndRespond(WidgetRoutingDispatcher.java:124)
at com.google.sitebricks.routing.WidgetRoutingDispatcher.dispatch(WidgetRoutingDispatcher.java:76)
at com.google.sitebricks.SitebricksFilter.doFilter(SitebricksFilter.java:59)
at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:163)
at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
at com.google.sitebricks.HiddenMethodFilter.doFilter(HiddenMethodFilter.java:75)
at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:163)
at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
at com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipeline.java:118)
at com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:113)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:440)
at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:326)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:926)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:549)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:410)
at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
.idea is generated by IDEA when importing a maven project; .gitignore needs to have .idea added to it so that the IDEA cache files are ignored.
(This has been committed).
The DropBox REST API to upload a file requires that the body of the PUT/POST request be the contents of the file. I cannot find a way to set the body in sitebricks-client.
Allow the template renderers for a Sitebricks application to be specified in the bindings. To begin with remove the hardcoding of the template renderers that already exist and bind those by default.
without @singleton got this error:
First encounter: StatDescriptor{name=movie-hits, description=, statReader=FieldBasedStatReader{field=private final java.util.concurrent.atomic.AtomicInteger com.jdkcn.sandbox.sitebricks.action.WelcomeAction.hists, target=com.jdkcn.sandbox.sitebricks.action.WelcomeAction@620a9239}, statExposerClass=class com.google.sitebricks.stat.StatExposers$InferenceExposer}
Second encounter: StatDescriptor{name=movie-hits, description=, statReader=FieldBasedStatReader{field=private final java.util.concurrent.atomic.AtomicInteger com.jdkcn.sandbox.sitebricks.action.WelcomeAction.hists, target=com.jdkcn.sandbox.sitebricks.action.WelcomeAction@1ae2f8c1}, statExposerClass=class com.google.sitebricks.stat.StatExposers$InferenceExposer}
@stat("movie-hits")
private final AtomicInteger hists = new AtomicInteger();
@get
public void get(@nAmed("id") String id) {
hists.incrementAndGet();
this.movie = movies.get(id);
}
I've been using this implementation of Freemarker for a while (the initial impetus for making the template compilers pluggable) and I'd like to clean it up and make it available as an optional template compiler. I have tests in other project I need to migrate into:
https://github.com/jvanzyl/sitebricks-freemarker
Before calling it complete. It also has the concept of "bricks" but works differently than the standard Sitebricks way so I need to align that.
I want to handle site layout with @decorated and @embedas, but the @embedas page can't be rendered in decorated page.
There should be functionality to install more than one SitebricksModule, like Guice and GuiceModule.
A while back I came upon this: https://code.google.com/p/google-sitebricks/issues/detail?id=39&q=module
I haven't seen any more information published about this.
Has there been any progress on the matter?
I run
mvn archetype:generate -DgroupId=com.zeroturnaround.app -DartifactId=SitebricksExample2 -DarchetypeGroupId=com.google.sitebricks -DarchetypeArtifactId=sitebricks-jetty-archetype -DarchetypeVersion=0.8.6
And I get: http://pastebin.com/JfFgcmnz
In summary - it says
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2.2:generate (default-cli) on project standalone-pom: The defined artifact is not an archetype
In debug I can see how it trying to find archetype.xml file:
[DEBUG] Searching for META-INF/archetype.xml inside /Users/soswow/.m2/repository/com/google/sitebricks/sitebricks-jetty-archetype/0.8.6/sitebricks-jetty-archetype-0.8.6.jar
A decorated page like this:
<html>
<head>
<title>test</title>
@Require
<link rel="stylesheet" href="/assets/css/default.css"></link>
</head>
<body>
page content here.
</body>
</html>
the page rendered @require content without webapp context path (for example: /bricks) , the result is:
<link rel="stylesheet" href="/assets/css/default.css"></link>
and expected result is:
<link rel="stylesheet" href="/bricks/assets/css/default.css"></link>
It would be very nice if you could put sitebricks.org on github too so that we can contribute back some docs to the sitebricks users. I think this could help not only new users, but relief the mailing list FAQs too.
When trying to build sitebricks 0.8.7-SNAPSHOT with maven I get the following error while testing Mail Client:
[INFO] Sitebricks :: Acceptance Tests .................... SUCCESS [43.119s]
[INFO] Sitebricks :: Mail Client ......................... FAILURE [17.261s]
[INFO] Sitebricks :: Options Module ...................... SKIPPED
[INFO] Sitebricks :: Jetty Archetype ..................... SKIPPED
[INFO] Sitebricks :: SLF4J Module ........................ SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2:38.448s
[INFO] Finished at: Thu Nov 22 21:14:56 CET 2012
[INFO] Final Memory: 89M/352M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.10:test (default-test) on project sitebricks-mail: There are test failures.
[ERROR]
[ERROR] Please refer to /home/dimi/local/sdks/maven/sitebricks/sitebricks-mail/target/surefire-reports for the individual test results.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn -rf :sitebricks-mail
I tried to build on ubuntu and windows 7, getting the same error on both platforms.
the template just like this:
${date}
and the model java like this:
private Date date;
//getter and setter below
....
and it throws exception when run:
Problem setting [date] on instance [org.northstar.bricks.web.pages.About@1993773] with value [2012-10-10]
Caused by:
java.lang.RuntimeException: Problem setting [date] on instance [org.northstar.bricks.web.pages.About@1993773] with value [2012-10-10]
at com.google.sitebricks.binding.MvelRequestBinder.addContextAndThrow(MvelRequestBinder.java:98)
at com.google.sitebricks.binding.MvelRequestBinder.bind(MvelRequestBinder.java:91)
at com.google.sitebricks.routing.WidgetRoutingDispatcher.bindAndRespond(WidgetRoutingDispatcher.java:93)
at com.google.sitebricks.routing.WidgetRoutingDispatcher.dispatch(WidgetRoutingDispatcher.java:76)
at com.google.sitebricks.DebugModeRoutingDispatcher.dispatch(DebugModeRoutingDispatcher.java:56)
at com.google.sitebricks.SitebricksFilter.doFilter(SitebricksFilter.java:59)
at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:163)
at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
at com.google.sitebricks.HiddenMethodFilter.doFilter(HiddenMethodFilter.java:70)
at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:163)
at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
at org.northstar.bricks.core.orientdb.OrientdbFilter.doFilter(OrientdbFilter.java:36)
at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:163)
at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
at com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipeline.java:118)
at com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:113)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1295)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:440)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:131)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:524)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:225)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1033)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:369)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:186)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:967)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:129)
at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:250)
at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:149)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:111)
at org.eclipse.jetty.server.Server.handle(Server.java:358)
at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:452)
at org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:894)
at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:948)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:851)
at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)
at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:77)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:622)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:46)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:603)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:538)
at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.IllegalArgumentException: Invalid date format
at com.google.sitebricks.conversion.DateConverters$DateStringConverter.from(DateConverters.java:79)
at com.google.sitebricks.conversion.DateConverters$DateStringConverter.from(DateConverters.java:57)
at com.google.sitebricks.conversion.StandardTypeConverter.typeSafeFrom(StandardTypeConverter.java:162)
at com.google.sitebricks.conversion.StandardTypeConverter.convert(StandardTypeConverter.java:121)
at com.google.sitebricks.conversion.MvelConversionHandlers$SitebricksConversionHandler.convertFrom(MvelConversionHandlers.java:56)
at org.mvel2.DataConversion.convert(DataConversion.java:129)
at org.mvel2.PropertyAccessor.set(PropertyAccessor.java:346)
at org.mvel2.PropertyAccessor.set(PropertyAccessor.java:135)
at org.mvel2.MVEL.setProperty(MVEL.java:1088)
at com.google.sitebricks.MvelEvaluator.write(MvelEvaluator.java:64)
at com.google.sitebricks.binding.MvelRequestBinder.bind(MvelRequestBinder.java:77)
... 39 more
Caused by: java.text.ParseException: Unparseable date: "2012-10-10"
at java.text.DateFormat.parse(DateFormat.java:357)
at com.google.sitebricks.conversion.DateConverters$DateStringConverter.from(DateConverters.java:76)
... 49 more
Are there any plans sitebricks to use in the future dagger 2 instead of Guice?
I am getting a test failure due to date format, it looks like the name of the timezone is different.
The Mail Client subproject fails with the following test:
Failed tests:
MessageStatusExtractorTest.testTypicalGmailInboxHeaders:387 expected:<MessageStatus{imapUid=1001, messageUid='<[email protected]>', receivedDate=Sat Apr 09 16:12:09 EST 2011, subject='Get Gmail on your mobile phone', inReplyTo='null', from=["Gmail Team" [email protected]], sender=["Gmail Team" [email protected]], to=["imap test" [email protected]], cc=null, bcc=null, replyTo=["Gmail Team" [email protected]], flags=[], internalDate=Sat Apr 09 16:12:09 EST 2011, size=2439}> but was:<MessageStatus{imapUid=1001, messageUid='<[email protected]>', receivedDate=Sat Apr 09 16:12:09 AEST 2011, subject='Get Gmail on your mobile phone', inReplyTo='null', from=["Gmail Team" [email protected]], sender=["Gmail Team" [email protected]], to=["imap test" [email protected]], cc=null, bcc=null, replyTo=["Gmail Team" [email protected]], flags=[], internalDate=Sat Apr 09 16:12:09 AEST 2011, size=2439}>
This looks like the same issue that was reports as issue #44.
I am using Windows 7 with Java 8u31 64bit.
(the same issue shows when using Ubuntu with Java 8u31)
The documentation page of sitebricks.org is currently down. While there is still the wiki at code.google.com, Google Code will be deprecated and shut down.
Is anybody using the email module? I am having issues with the watch command.
Also it would be good to get some general idea of what the best practices are for implementing an imap mail client.
When I use a protocol-relative URL in my HTML such as (from HTML5 Boilerplate):
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
The webapp's context path get's stuck to the start of the URL:
<script src="/mywebapp//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
Instead of the latter, these should be left as is.
Conversion succeeds, but objects stored in ids
list are String instances "1", "2", "3" not 1L, 2L, 3L.
private Form {
List<Long> ids = Lists.newArrayList();
.. setters, getters
}
<form>
<input type="text" name="ids" value="1" />
<input type="text" name="ids" value="2" />
<input type="text" name="ids" value="3" />
</form>
An exception is raise when a @embedas widget with no parameters is used with empty brackets
For example, for this widget:
@EmbedAs("MyWidget")
public class MyWidget{
}
An exception is raised when using with brackets like this,
@MyWidget()
<div></div>
And it works ok, when used without brackets, like this
@MyWidget
<div></div>
This is the stack trace of the exception raised
java.lang.IllegalArgumentException: Object must not be null
at org.jsoup.helper.Validate.notNull(Validate.java:16)
at org.jsoup.nodes.Attribute.<init>(Attribute.java:23)
at org.jsoup.nodes.Attributes.put(Attributes.java:42)
at org.jsoup.nodes.Node.attr(Node.java:96)
at org.jsoup.nodes.TextNode.attr(TextNode.java:155)
at com.google.sitebricks.compiler.AnnotationNode.annotation(AnnotationNode.java:49)
at com.google.sitebricks.compiler.AnnotationNode.<init>(AnnotationNode.java:32)
at com.google.sitebricks.compiler.HtmlParser.parseTextNode(HtmlParser.java:375)
at com.google.sitebricks.compiler.HtmlParser.parse(HtmlParser.java:116)
at com.google.sitebricks.compiler.HtmlParser.parse(HtmlParser.java:90)
at com.google.sitebricks.compiler.HtmlTemplateCompiler.compile(HtmlTemplateCompiler.java:83)
at com.google.sitebricks.TemplateLoader.compile(TemplateLoader.java:47)
at com.google.sitebricks.compiler.StandardCompilers.compilePage(StandardCompilers.java:105)
at com.google.sitebricks.DebugModePageBook.reload(DebugModePageBook.java:118)
at com.google.sitebricks.DebugModePageBook.forName(DebugModePageBook.java:61)
at com.google.sitebricks.rendering.control.DecorateWidget.render(DecorateWidget.java:52)
at com.google.sitebricks.rendering.control.ProceedingWidgetChain.render(ProceedingWidgetChain.java:21)
at com.google.sitebricks.rendering.control.XmlWidget.render(XmlWidget.java:79)
at com.google.sitebricks.rendering.control.ProceedingWidgetChain.render(ProceedingWidgetChain.java:21)
at com.google.sitebricks.rendering.control.XmlWidget.render(XmlWidget.java:79)
at com.google.sitebricks.rendering.control.ProceedingWidgetChain.render(ProceedingWidgetChain.java:21)
at com.google.sitebricks.routing.WidgetRoutingDispatcher.bindAndRespond(WidgetRoutingDispatcher.java:158)
at com.google.sitebricks.routing.WidgetRoutingDispatcher.dispatch(WidgetRoutingDispatcher.java:91)
at com.google.sitebricks.DebugModeRoutingDispatcher.dispatch(DebugModeRoutingDispatcher.java:56)
at com.google.sitebricks.SitebricksFilter.doFilter(SitebricksFilter.java:62)
at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:163)
at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
at com.google.sitebricks.HiddenMethodFilter.doFilter(HiddenMethodFilter.java:70)
at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:163)
at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
at com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipeline.java:118)
at com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:113)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at com.google.appengine.api.socket.dev.DevSocketFilter.doFilter(DevSocketFilter.java:74)
I noticed there was a closed issue regarding the PATCH method but I don't see it in 0.8.6. I am guessing that version is not published. Should I just clone this repo and make it to get latest changes in?
java.lang.StringIndexOutOfBoundsException: String index out of range: 98
java.lang.AbstractStringBuilder.deleteCharAt(AbstractStringBuilder.java:762)
java.lang.StringBuilder.deleteCharAt(StringBuilder.java:258)
com.google.sitebricks.StringBuilderRespond.chew(StringBuilderRespond.java:81)
com.google.sitebricks.rendering.control.EmbeddedRespond.chew(EmbeddedRespond.java:100)
com.google.sitebricks.rendering.control.XmlWidget.writeOpenTag(XmlWidget.java:115)
com.google.sitebricks.rendering.control.XmlWidget.render(XmlWidget.java:72)
com.google.sitebricks.rendering.control.ProceedingWidgetChain.render(ProceedingWidgetChain.java:21)
com.google.sitebricks.rendering.control.XmlWidget.render(XmlWidget.java:79)
com.google.sitebricks.rendering.control.ProceedingWidgetChain.render(ProceedingWidgetChain.java:21)
com.google.sitebricks.rendering.control.EmbedWidget.render(EmbedWidget.java:66)
com.google.sitebricks.rendering.control.ProceedingWidgetChain.render(ProceedingWidgetChain.java:21)
com.google.sitebricks.rendering.control.XmlWidget.render(XmlWidget.java:79)
com.google.sitebricks.rendering.control.ProceedingWidgetChain.render(ProceedingWidgetChain.java:21)
com.google.sitebricks.rendering.control.DecorateWidget.render(DecorateWidget.java:57)
com.google.sitebricks.rendering.control.ProceedingWidgetChain.render(ProceedingWidgetChain.java:21)
com.google.sitebricks.rendering.control.XmlWidget.render(XmlWidget.java:79)
com.google.sitebricks.rendering.control.ProceedingWidgetChain.render(ProceedingWidgetChain.java:21)
com.google.sitebricks.rendering.control.XmlWidget.render(XmlWidget.java:79)
com.google.sitebricks.rendering.control.ProceedingWidgetChain.render(ProceedingWidgetChain.java:21)
com.google.sitebricks.rendering.control.XmlWidget.render(XmlWidget.java:79)
com.google.sitebricks.rendering.control.ProceedingWidgetChain.render(ProceedingWidgetChain.java:21)
com.google.sitebricks.routing.WidgetRoutingDispatcher.bindAndRespond(WidgetRoutingDispatcher.java:121)
com.google.sitebricks.routing.WidgetRoutingDispatcher.dispatch(WidgetRoutingDispatcher.java:75)
com.google.sitebricks.SitebricksFilter.doFilter(SitebricksFilter.java:59)
com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:163)
com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
com.google.sitebricks.HiddenMethodFilter.doFilter(HiddenMethodFilter.java:70)
com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:163)
com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipeline.java:118)
com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:113)
Guice 4 just released, does sitebricks has plan to support Guice 4? I try sibebricks v0.8.9 with Guice 4, it report
java.lang.NoClassDefFoundError, the class com/google/inject/internal/util/$ImmutableList has been removed from Guice 4
java.lang.NoClassDefFoundError: Lcom/google/inject/internal/util/$ImmutableList;
at java.lang.Class.getDeclaredFields0(Native Method)
at java.lang.Class.privateGetDeclaredFields(Class.java:2436)
at java.lang.Class.getDeclaredFields(Class.java:1806)
at com.google.inject.spi.InjectionPoint.getInjectionPoints(InjectionPoint.java:675)
at com.google.inject.spi.InjectionPoint.forInstanceMethodsAndFields(InjectionPoint.java:380)
at com.google.inject.spi.InjectionPoint.forInstanceMethodsAndFields(InjectionPoint.java:399)
at com.google.inject.internal.BindingBuilder.toProvider(BindingBuilder.java:110)
at com.google.inject.internal.BindingBuilder.toProvider(BindingBuilder.java:100)
at com.google.inject.internal.BindingBuilder.toProvider(BindingBuilder.java:43)
at com.google.inject.multibindings.Multibinder$RealMultibinder.configure(Multibinder.java:269)
at com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:340)
at com.google.inject.multibindings.Multibinder.newSetBinder(Multibinder.java:115)
at com.google.inject.multibindings.Multibinder.newSetBinder(Multibinder.java:124)
at com.google.sitebricks.SitebricksModule.configure(SitebricksModule.java:82)
at com.google.inject.AbstractModule.configure(AbstractModule.java:62)
at com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:340)
at com.google.inject.spi.Elements.getElements(Elements.java:110)
at com.google.inject.internal.InjectorShell$Builder.build(InjectorShell.java:138)
at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:104)
at com.google.inject.Guice.createInjector(Guice.java:96)
at com.google.inject.Guice.createInjector(Guice.java:84)
....
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4992)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5490)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:649)
at org.apache.catalina.startup.HostConfig.manageApp(HostConfig.java:1763)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:301)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:618)
at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:565)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:301)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1487)
at javax.management.remote.rmi.RMIConnectionImpl.access$300(RMIConnectionImpl.java:97)
at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1328)
at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1420)
at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:848)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:322)
at sun.rmi.transport.Transport$1.run(Transport.java:177)
at sun.rmi.transport.Transport$1.run(Transport.java:174)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:173)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:556)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:811)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:670)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassNotFoundException: com.google.inject.internal.util.$ImmutableList
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1720)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1571)
... 67 more
I am attempting to create a web service that receives a HTTP Post whose message body is XML. Using the PostableRestfulWebService example I have been able to get a service working that receives Form data. But I get errors when I try send XML data. It seems the problem is that com.google.sitebricks.headless.Request expects data to be submitted as Form data. Is there an alternate to this Request interface that I can specify here to be able to accept alternate data formats? Or other mechanism for receiving non-form data?
Currently the Content-Type header is not being taken from the transport forcing the user to add a Content-Type header to requests requests. The headers should be inspected to make sure we don't clobber any specific Content-Type being set by the client, but if not the Content-Type as specified by the Transport.contentType() should be used.
In some circumstances guice enhances classes. DecorateWidget.embedNameFor() is called with the original class. By the time rendering takes place, the class name might be something like MyClass$$EnhancerByGuice. That causes the embedNameFor to return a different name, and decoration to fail (and result in an NPE when looking up the page in the page book).
Decorate seems quite brittle overall, and probably needs to be replaced with something else (@surround, perhaps) that will fully support nesting, and not be vulnerable to the enhancer issue noted above.
When in the same sitebricks service class
@At("/r/address/streets") @Service
have two services like :
@At("/search") @Post
@At("/:id") @Delete
The client gets 404 r/address/streets/search not found But there should not have problems for separation between both URLs, because two different HTTP methods.
If use:
@At("/search") @Post
@At("/delete/:id") @Delete
everything works fine
I followed the Getting Started guide on your Website but I keep getting the following Error:
Jan 10, 2013 1:41:01 PM com.google.apphosting.utils.jetty.JettyLogger info
INFO: Logging to JettyLogger(null) via com.google.apphosting.utils.jetty.JettyLogger
Jan 10, 2013 1:41:02 PM com.google.apphosting.utils.config.AppEngineWebXmlReader readAppEngineWebXml
INFO: Successfully processed C:\Users\Dimi\workspace\sitebricks\sitebricks\war\WEB-INF/appengine-web.xml
Jan 10, 2013 1:41:02 PM com.google.apphosting.utils.config.AbstractConfigXmlReader readConfigXml
INFO: Successfully processed C:\Users\Dimi\workspace\sitebricks\sitebricks\war\WEB-INF/web.xml
Jan 10, 2013 1:41:02 PM com.google.appengine.tools.development.SystemPropertiesManager setSystemProperties
INFO: Overwriting system property key 'java.util.logging.config.file', value 'C:\Users\Dimi\Documents\Seminar\sitebricks\appengine-java-sdk-1.7.4\config\sdk\logging.properties' with value 'WEB-INF/logging.properties' from 'C:\Users\Dimi\workspace\sitebricks\sitebricks\war\WEB-INF\appengine-web.xml'
Jan 10, 2013 1:41:04 PM com.google.apphosting.utils.jetty.JettyLogger info
INFO: jetty-6.1.x
Jan 10, 2013 1:41:12 PM com.google.apphosting.utils.jetty.JettyLogger warn
WARNING: failed com.google.appengine.tools.development.DevAppEngineWebAppContext@194e059{/,C:\Users\Dimi\workspace\sitebricks\sitebricks\war}: java.lang.NoClassDefFoundError: [Lorg/aopalliance/intercept/MethodInterceptor;
Jan 10, 2013 1:41:12 PM com.google.apphosting.utils.jetty.JettyLogger warn
WARNING: failed JettyContainerService$ApiProxyHandler@1a83d23: java.lang.NoClassDefFoundError: [Lorg/aopalliance/intercept/MethodInterceptor;
Jan 10, 2013 1:41:12 PM com.google.apphosting.utils.jetty.JettyLogger warn
WARNING: Error starting handlers
java.lang.NoClassDefFoundError: [Lorg/aopalliance/intercept/MethodInterceptor;
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
at java.lang.Class.getDeclaredMethods(Unknown Source)
at com.google.inject.internal.ProviderMethodsModule.getProviderMethods(ProviderMethodsModule.java:81)
at com.google.inject.internal.ProviderMethodsModule.configure(ProviderMethodsModule.java:73)
at com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:223)
at com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:232)
at com.google.inject.AbstractModule.install(AbstractModule.java:118)
at com.google.inject.servlet.ServletModule.configure(ServletModule.java:50)
at com.google.inject.AbstractModule.configure(AbstractModule.java:59)
at com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:223)
at com.google.inject.AbstractModule.install(AbstractModule.java:118)
at com.google.sitebricks.SitebricksModule.configure(SitebricksModule.java:72)
at com.google.inject.AbstractModule.configure(AbstractModule.java:59)
at com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:223)
at com.google.inject.spi.Elements.getElements(Elements.java:101)
at com.google.inject.internal.InjectorShell$Builder.build(InjectorShell.java:133)
at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:103)
at com.google.inject.Guice.createInjector(Guice.java:95)
at com.google.inject.Guice.createInjector(Guice.java:72)
at com.google.inject.Guice.createInjector(Guice.java:62)
at org.sitebricks.example.AppConfig.getInjector(AppConfig.java:11)
at com.google.inject.servlet.GuiceServletContextListener.contextInitialized(GuiceServletContextListener.java:45)
at org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:548)
at org.mortbay.jetty.servlet.Context.startContext(Context.java:136)
at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)
at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517)
at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:467)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
at org.mortbay.jetty.Server.doStart(Server.java:224)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at com.google.appengine.tools.development.JettyContainerService.startContainer(JettyContainerService.java:205)
at com.google.appengine.tools.development.AbstractContainerService.startup(AbstractContainerService.java:232)
at com.google.appengine.tools.development.DevAppServerImpl.start(DevAppServerImpl.java:157)
at com.google.appengine.tools.development.DevAppServerMain$StartAction.apply(DevAppServerMain.java:333)
at com.google.appengine.tools.util.Parser$ParseResult.applyArgs(Parser.java:48)
at com.google.appengine.tools.development.DevAppServerMain.(DevAppServerMain.java:269)
at com.google.appengine.tools.development.DevAppServerMain.main(DevAppServerMain.java:245)
Caused by: java.lang.ClassNotFoundException: org.aopalliance.intercept.MethodInterceptor
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at com.google.appengine.tools.development.IsolatedAppClassLoader.loadClass(IsolatedAppClassLoader.java:213)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 41 more
Jan 10, 2013 1:41:12 PM com.google.apphosting.utils.jetty.JettyLogger info
INFO: Started [email protected]:8888
Jan 10, 2013 2:41:12 PM com.google.appengine.tools.development.DevAppServerImpl start
INFO: The server is running at http://localhost:8888/
Jan 10, 2013 2:41:12 PM com.google.appengine.tools.development.DevAppServerImpl start
INFO: The admin console is running at http://localhost:8888/_ah/admin
Did I miss anything or could it be some kind of bug?
I have some html template code like this:
<!--[if lt IE 9]>
<script src="/assets/js/ie/html5.js"></script>
<script src="/assets/js/ie/respond.min.js"></script>
<![endif]-->
These codes is removed by SB. Is it right?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.