Giter Club home page Giter Club logo

blade-demos's Introduction

blade-demos's People

Contributors

hellokaton avatar psh686868 avatar retuenepz avatar vileneera avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

blade-demos's Issues

blade-websocket,报错Blade Invoke Error java.lang.ClassCastException: io.netty.handler.codec.http.LastHttpContent$1 cannot be cast to io.netty.handler.codec.http.FullHttpRequest

Blade Invoke Error java.lang.ClassCastException: io.netty.handler.codec.http.LastHttpContent$1 cannot be cast to io.netty.handler.codec.http.FullHttpRequest
at io.netty.handler.codec.http.websocketx.WebSocketServerProtocolHandshakeHandler.channelRead(WebSocketServerProtocolHandshakeHandler.java:64)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
at io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:86)
at io.netty.handler.codec.http.HttpServerExpectContinueHandler.channelRead(HttpServerExpectContinueHandler.java:95)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:438)
at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:323)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:297)
at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:253)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1434)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:965)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:644)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:579)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:496)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:458)
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:897)
at java.lang.Thread.run(Thread.java:748)

How to run the examples?

Which is the right way to run the examples?
Apart from the Hello World one, the other seems to be not working out of the box.

Are they only code, which need to be copied and pasted elsewhere?
Or are they supposed to be runnable from where they are?

Unable to make simple app to work with templates

I have been struggling with creating simple blade app with templates. Tried copying your template example and the thing is not working. Using JDK 1.8 and maven 3.8

Here is the repo https://github.com/kiklop74/ltisample

Can you tell me what I'm doing wrong here?

This is how it looks when started from NetBeans

--- exec-maven-plugin:3.1.0:exec (default-cli) @ ltisample ---
2023/04/07 09:37:22  INFO [          _(:3??)_ ]             c.h.b.s.NettyServer : app.env          => default
2023/04/07 09:37:22  INFO [          _(:3??)_ ]             c.h.b.s.NettyServer : app.pid          => 24096
2023/04/07 09:37:22  INFO [          _(:3??)_ ]             c.h.b.s.NettyServer : app.devMode      => true
2023/04/07 09:37:22  INFO [          _(:3??)_ ]             c.h.b.s.NettyServer : jdk.version      => 1.8.0_362
2023/04/07 09:37:22  INFO [          _(:3??)_ ]             c.h.b.s.NettyServer : user.dir         => C:\Users\Darko Miletic\Documents\NetBeansProjects\ltisample
2023/04/07 09:37:22  INFO [          _(:3??)_ ]             c.h.b.s.NettyServer : java.io.tmpdir   => C:\Users\DARKOM~1\AppData\Local\Temp\
2023/04/07 09:37:22  INFO [          _(:3??)_ ]             c.h.b.s.NettyServer : user.timezone    => America/Buenos_Aires
2023/04/07 09:37:22  INFO [          _(:3??)_ ]             c.h.b.s.NettyServer : file.encoding    => Cp1252
2023/04/07 09:37:22  INFO [          _(:3??)_ ]             c.h.b.s.NettyServer : app.classpath    => C:/Users/Darko Miletic/Documents/NetBeansProjects/ltisample/target/classes/

                                         __, _,   _, __, __,
                                         |_) |   /_\ | \ |_
                                         |_) | , | | |_/ |
                                         ~   ~~~ ~ ~ ~   ~~~
                                     :: Blade :: (v2.1.2.RELEASE) 

2023/04/07 09:37:22  INFO [          _(:3??)_ ]          c.h.b.m.r.RouteMatcher : Add route  GET     /
2023/04/07 09:37:22  INFO [          _(:3??)_ ]          c.h.b.m.r.RouteMatcher : Add route  GET     /login
2023/04/07 09:37:22  INFO [          _(:3??)_ ]             c.h.b.s.NettyServer : Register bean: [com.moodleus.ltisample.IndexController@72d23c93, com.hellokaton.blade.Environment@290caead, com.moodleus.ltisample.Bootstrap@314d18c4, com.moodleus.ltisample.Bootstrap@314d18c4]
2023/04/07 09:37:22  INFO [          _(:3??)_ ]             c.h.b.s.NettyServer : Use NioEventLoopGroup
2023/04/07 09:37:23  INFO [          _(:3??)_ ]             c.h.b.s.NettyServer : Blade initialize successfully, Time elapsed: 629 ms
2023/04/07 09:37:23  INFO [          _(:3??)_ ]             c.h.b.s.NettyServer : Blade start with  0.0.0.0:9000 
2023/04/07 09:37:23  INFO [          _(:3??)_ ]             c.h.b.s.NettyServer : Open browser access http://127.0.0.1:9000 ?

2023/04/07 09:37:31  INFO [   worker@thread-1 ]       c.h.b.s.HttpServerHandler :  200    14ms  GET    /login
2023/04/07 09:37:50  INFO [   worker@thread-2 ]       c.h.b.s.HttpServerHandler :  200     1ms  GET    /
2023/04/07 09:37:50  WARN [   worker@thread-2 ] c.h.b.m.h.DefaultExceptionHandler :  404          GET    /favicon.ico
2023/04/07 09:38:03  INFO [   worker@thread-2 ]       c.h.b.s.HttpServerHandler :  200     0ms  GET    /login

The pages open but they are empty

ajax example seems to be outdated or wrong

`jQuery.Deferred exception: $(...).bootstrapTable is not a function @http://127.0.0.1:9000/ajax:1:44
j@https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js:2:29997
g/</k<@https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js:2:30313
 undefined
jquery.min.js:2:31569
TypeError: $(...).bootstrapTable is not a function

and yes. i'm using just the demo, nothing changed in the index html, just renamed

Lattice demo throws IllegalStateException

I tried run the bade-lattice module example but this exception is thrown. Here is the full stacktrace:

Connected to the target VM, address: '127.0.0.1:51577', transport: 'socket'
2024/06/12 18:02:56  INFO [          _(:3」∠)_ ]             c.h.b.s.NettyServer : app.env          => default
2024/06/12 18:02:57  INFO [          _(:3」∠)_ ]             c.h.b.s.NettyServer : app.pid          => 9748
2024/06/12 18:02:57  INFO [          _(:3」∠)_ ]             c.h.b.s.NettyServer : app.devMode      => true
2024/06/12 18:02:57  INFO [          _(:3」∠)_ ]             c.h.b.s.NettyServer : jdk.version      => 17.0.8
2024/06/12 18:02:57  INFO [          _(:3」∠)_ ]             c.h.b.s.NettyServer : user.dir         => E:\Programas\Labs\java\Frameworks\Blade\blade-demos
2024/06/12 18:02:57  INFO [          _(:3」∠)_ ]             c.h.b.s.NettyServer : java.io.tmpdir   => C:\Users\user\AppData\Local\Temp\
2024/06/12 18:02:57  INFO [          _(:3」∠)_ ]             c.h.b.s.NettyServer : user.timezone    => America/Mexico_City
2024/06/12 18:02:57  INFO [          _(:3」∠)_ ]             c.h.b.s.NettyServer : file.encoding    => UTF-8
2024/06/12 18:02:57  INFO [          _(:3」∠)_ ]             c.h.b.s.NettyServer : app.classpath    => E:/Programas/Labs/java/Frameworks/Blade/blade-demos/blade-lattice/target/classes/

                                         __, _,   _, __, __,
                                         |_) |   /_\ | \ |_
                                         |_) | , | | |_/ |
                                         ~   ~~~ ~ ~ ~   ~~~
                                     :: Blade :: (v2.1.1.RELEASE) 

2024/06/12 18:02:57  INFO [          _(:3」∠)_ ]          c.h.b.m.r.RouteMatcher : Add route  POST    /admin/deleteUser
2024/06/12 18:02:57  INFO [          _(:3」∠)_ ]          c.h.b.m.r.RouteMatcher : Add route  GET     /admin/deleteUser
2024/06/12 18:02:57  INFO [          _(:3」∠)_ ]          c.h.b.m.r.RouteMatcher : Add route  GET     /
2024/06/12 18:02:57  INFO [          _(:3」∠)_ ]          c.h.b.m.r.RouteMatcher : Add route  GET     /login
2024/06/12 18:02:57  INFO [          _(:3」∠)_ ]          c.h.b.m.r.RouteMatcher : Add route  GET     /admin/index
2024/06/12 18:02:57  INFO [          _(:3」∠)_ ]             c.h.b.s.NettyServer : Register bean: [com.bladejava.lattice.controller.IndexController@715a8342, com.hellokaton.blade.Environment@4ed2e7e9, com.hellokaton.lattice.LatticeMiddleware@1f998488, com.bladejava.lattice.controller.AdminController@5b43cc49, com.hellokaton.lattice.LatticeMiddleware@1f998488, com.bladejava.lattice.bootstrap.Bootstrap@7ea604f0, com.bladejava.lattice.bootstrap.Bootstrap@7ea604f0]
2024/06/12 18:02:57 ERROR [          _(:3」∠)_ ]                     c.h.b.Blade : Start blade failed java.lang.RuntimeException: java.lang.IllegalStateException: Can't inject bean: com.hellokaton.lattice.Lattice for field: private com.hellokaton.lattice.Lattice com.hellokaton.lattice.LatticeMiddleware.lattice
	at com.hellokaton.blade.ioc.bean.FieldInjector.injection(FieldInjector.java:43)
	at com.hellokaton.blade.kit.IocKit.lambda$initInjection$4(IocKit.java:113)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
	at com.hellokaton.blade.kit.IocKit.initInjection(IocKit.java:111)
	at com.hellokaton.blade.server.NettyServer.lambda$initIoc$1(NettyServer.java:169)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
	at com.hellokaton.blade.server.NettyServer.initIoc(NettyServer.java:168)
	at com.hellokaton.blade.server.NettyServer.start(NettyServer.java:128)
	at com.hellokaton.blade.Blade.lambda$start$2(Blade.java:707)
	at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.lang.IllegalStateException: Can't inject bean: com.hellokaton.lattice.Lattice for field: private com.hellokaton.lattice.Lattice com.hellokaton.lattice.LatticeMiddleware.lattice
	at com.hellokaton.blade.ioc.bean.FieldInjector.injection(FieldInjector.java:39)
	... 9 more

Disconnected from the target VM, address: '127.0.0.1:51577', transport: 'socket'

I did not modify anything just cloned the repo and run the LatticeApplication class

@EnumMapping Example

I'm look in most of folders and not found any references to @EnumMapping. In fact, no documentation inside the class (when you push Documentation's Key(s)). Can you explain me how to use? I'd loved this framework (Newbie detected)

Some code

public class User extends Model {

    @EnumMapping(value = "profile")
    enum Profile {
        ADMIN,
        OTHERS
    }

    private Integer id;
    private String name;
    private Profile profile;

   // getters and setters

}

Error:

java.lang.RuntimeException: io.github.biezhi.anima.exception.AnimaException
	at org.sql2o.Query.converterValue(Query.java:154)
	at org.sql2o.Query.withParams(Query.java:131)
	at io.github.biezhi.anima.core.AnimaQuery.save(AnimaQuery.java:1211)
	at io.github.biezhi.anima.Model.save(Model.java:28)
	at com.ananke.controllers.UsuarioController.saveUser(UserController.java:20)
	at com.ananke.controllers.UsuarioControllerMethodAccess.invoke(Unknown Source)
	at com.blade.reflectasm.MethodAccess.invoke(MethodAccess.java:43)
	at com.blade.server.netty.RouteMethodHandler.routeHandle(RouteMethodHandler.java:256)
	at com.blade.server.netty.RouteMethodHandler.handle(RouteMethodHandler.java:87)
	at com.blade.server.netty.HttpServerHandler.executeLogic(HttpServerHandler.java:158)
	at java.util.concurrent.CompletableFuture.uniApply(CompletableFuture.java:616)
	at java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:591)
	at java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:456)
	at io.netty.util.concurrent.AbstractEventExecutor.safeExecute$$$capture(AbstractEventExecutor.java:163)
	at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java)
	at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:404)
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:462)
	at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:897)
	at java.lang.Thread.run(Thread.java:748)
Caused by: io.github.biezhi.anima.exception.AnimaException
	at org.sql2o.converters.DefaultEnumConverterFactory$1.toDatabaseParam(DefaultEnumConverterFactory.java:79)
	at org.sql2o.converters.DefaultEnumConverterFactory$1.toDatabaseParam(DefaultEnumConverterFactory.java:49)
	at org.sql2o.Query.converterValue(Query.java:152)
	... 18 more
Caused by: java.lang.NoSuchFieldException: profile
	at java.lang.Class.getDeclaredField(Class.java:2070)
	at org.sql2o.converters.DefaultEnumConverterFactory$1.toDatabaseParam(DefaultEnumConverterFactory.java:75)
	... 20 more

Error occurs because I don't know how to use @EnumMapping. I'm doing a POST request to this object and trying to save().

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.