Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [leshan-dev] Leshan on Cloud web-server or Wildfy

Hi Giacomo,

do you have any idea why Wildfly "needs" a no args constructor here?

-- 
Mit freundlichen Grüßen / Best regards

Kai Hudalla
Chief Software Architect

Bosch Software Innovations GmbH
Schöneberger Ufer 89-91
10785 Berlin
GERMANY
www.bosch-si.com

Registered office: Berlin, Register court: Amtsgericht Charlottenburg,
HRB 148411 B;
Executives: Dr.-Ing. Rainer Kallenbach, Michael Hahn

On Mon, 2016-11-21 at 17:44 +0000, Giacomo Genovese wrote:
> I found that Wildfly needs a no args constructor and I solved the error
> creating a no args constructor in org.eclipse.leshan.core.json.JsonRootObject
> class: 
>         "public JsonRootObject(){
>                          this.jsonArray = null; } "
> Thanks.
> 
> Il giorno lun 21 nov 2016 alle ore 13:34 Giacomo Genovese <giacogenovese@gmail.
> com> ha scritto:
> > Hi all,
> > I integrated Leshan in my GAE application and I'm testing it using Wildfly8.
> > During my tests I faced problem with Json parsing.
> > I noticed that my application is not able to parse the file oma-objects-
> > spec.json (look at attachment) and, if I make a request using Json I get :
> > 
> > 13:09:07,567 ERROR [io.undertow.request] (default task-31) UT005023:
> > Exception handling request to /api/clients/client1/1/0:
> > java.lang.RuntimeException: Unable to invoke no-args constructor for class
> > org.eclipse.leshan.json.JsonRootObject. Register an InstanceCreator with Gson
> > for this type may fix this problem.
> > 	at
> > com.google.gson.internal.ConstructorConstructor$12.construct(ConstructorConst
> > ructor.java:210) [gson-2.2.4.jar:]
> > 	at
> > com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(Refle
> > ctiveTypeAdapterFactory.java:162) [gson-2.2.4.jar:]
> > 	at com.google.gson.Gson.fromJson(Gson.java:803) [gson-2.2.4.jar:]
> > 	at com.google.gson.Gson.fromJson(Gson.java:768) [gson-2.2.4.jar:]
> > 	at com.google.gson.Gson.fromJson(Gson.java:717) [gson-2.2.4.jar:]
> > 	at com.google.gson.Gson.fromJson(Gson.java:689) [gson-2.2.4.jar:]
> > 	at org.eclipse.leshan.json.LwM2mJson.fromJsonLwM2m(LwM2mJson.java:38)
> > [leshan-core.jar:]
> > 	at
> > org.eclipse.leshan.core.node.codec.json.LwM2mNodeJsonDecoder.decode(LwM2mNode
> > JsonDecoder.java:59) [leshan-core.jar:]
> > 	at
> > org.eclipse.leshan.core.node.codec.DefaultLwM2mNodeDecoder.decode(DefaultLwM2
> > mNodeDecoder.java:67) [leshan-core.jar:]
> > 	at
> > org.eclipse.leshan.core.node.codec.DefaultLwM2mNodeDecoder.decode(DefaultLwM2
> > mNodeDecoder.java:46) [leshan-core.jar:]
> > 	at
> > org.eclipse.leshan.server.californium.impl.LwM2mResponseBuilder.decodeCoapRes
> > ponse(LwM2mResponseBuilder.java:359) [leshan-server-cf.jar:]
> > 	at
> > org.eclipse.leshan.server.californium.impl.LwM2mResponseBuilder.visit(LwM2mRe
> > sponseBuilder.java:122) [leshan-server-cf.jar:]
> > 	at
> > org.eclipse.leshan.core.request.ReadRequest.accept(ReadRequest.java:134)
> > [leshan-core.jar:]
> > 	at
> > org.eclipse.leshan.server.californium.impl.CaliforniumLwM2mRequestSender$1.bu
> > ildResponse(CaliforniumLwM2mRequestSender.java:100) [leshan-server-cf.jar:]
> > 	at
> > org.eclipse.leshan.server.californium.impl.SyncRequestObserver.onResponse(Syn
> > cRequestObserver.java:52) [leshan-server-cf.jar:]
> > 	at
> > org.eclipse.californium.core.coap.Request.setResponse(Request.java:416)
> > [californium-core-2.0.0-M1.jar:]
> > 	at
> > org.eclipse.californium.core.server.ServerMessageDeliverer.deliverResponse(Se
> > rverMessageDeliverer.java:169) [californium-core-2.0.0-M1.jar:]
> > 	at
> > org.eclipse.californium.core.network.stack.CoapStack$StackTopAdapter.receiveR
> > esponse(CoapStack.java:195) [californium-core-2.0.0-M1.jar:]
> > 	at
> > org.eclipse.californium.core.network.stack.AbstractLayer.receiveResponse(Abst
> > ractLayer.java:101) [californium-core-2.0.0-M1.jar:]
> > 	at
> > org.eclipse.californium.core.network.stack.ObserveLayer.receiveResponse(Obser
> > veLayer.java:146) [californium-core-2.0.0-M1.jar:]
> > 	at
> > org.eclipse.californium.core.network.stack.AbstractLayer.receiveResponse(Abst
> > ractLayer.java:101) [californium-core-2.0.0-M1.jar:]
> > 	at
> > org.eclipse.californium.core.network.stack.BlockwiseLayer.receiveResponse(Blo
> > ckwiseLayer.java:322) [californium-core-2.0.0-M1.jar:]
> > 	at
> > org.eclipse.californium.core.network.stack.AbstractLayer.receiveResponse(Abst
> > ractLayer.java:101) [californium-core-2.0.0-M1.jar:]
> > 	at
> > org.eclipse.californium.core.network.stack.ReliabilityLayer.receiveResponse(R
> > eliabilityLayer.java:265) [californium-core-2.0.0-M1.jar:]
> > 	at
> > org.eclipse.californium.core.network.stack.AbstractLayer.receiveResponse(Abst
> > ractLayer.java:101) [californium-core-2.0.0-M1.jar:]
> > 	at
> > org.eclipse.californium.core.network.stack.CoapStack.receiveResponse(CoapStac
> > k.java:138) [californium-core-2.0.0-M1.jar:]
> > 	at
> > org.eclipse.californium.core.network.CoapEndpoint$InboxImpl.receiveMessage(Co
> > apEndpoint.java:747) [californium-core-2.0.0-M1.jar:]
> > 	at
> > org.eclipse.californium.core.network.CoapEndpoint$InboxImpl.access$900(CoapEn
> > dpoint.java:647) [californium-core-2.0.0-M1.jar:]
> > 	at
> > org.eclipse.californium.core.network.CoapEndpoint$InboxImpl$1.run(CoapEndpoin
> > t.java:661) [californium-core-2.0.0-M1.jar:]
> > 	at
> > org.eclipse.californium.core.network.CoapEndpoint$5.run(CoapEndpoint.java:819
> > ) [californium-core-2.0.0-M1.jar:]
> > 	at
> > java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
> > [rt.jar:1.7.0_80]
> > 	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
> > [rt.jar:1.7.0_80]
> > 	at
> > java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$2
> > 01(ScheduledThreadPoolExecutor.java:178) [rt.jar:1.7.0_80]
> > 	at
> > java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Sche
> > duledThreadPoolExecutor.java:292) [rt.jar:1.7.0_80]
> > 	at
> > java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:114
> > 5) [rt.jar:1.7.0_80]
> > 	at
> > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:61
> > 5) [rt.jar:1.7.0_80]
> > 	at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_80]
> > Caused by: java.lang.UnsupportedOperationException: Cannot allocate class
> > org.eclipse.leshan.json.JsonRootObject
> > 	at
> > com.google.gson.internal.UnsafeAllocator$4.newInstance(UnsafeAllocator.java:1
> > 00) [gson-2.2.4.jar:]
> > 	at
> > com.google.gson.internal.ConstructorConstructor$12.construct(ConstructorConst
> > ructor.java:207) [gson-2.2.4.jar:]
> > 	... 36 more
> > 
> > I suppose that the error comes from the bad parsing of jsonString but I don't
> > know why and to solve it.
> > Could you help me?
> > 
> > Thanks a lot.
> > 
> > Giacomo
> > 
> > Il giorno gio 20 ott 2016 alle ore 10:35 Giacomo Genovese <giacogenovese@gmai
> > l.com> ha scritto:
> > > It's exactly what I was trying to do right now.
> > > Your answer give me confidence in keeping working in such direction.
> > > Thanks a lot.
> > > 
> > > Bests, 
> > > Giacomo.
> > > 
> > > Il giorno gio 20 ott 2016 alle ore 10:22 Hudalla Kai (INST/ESY1) <Kai.Hudal
> > > la@xxxxxxxxxxxx> ha scritto:
> > > > Hi Giacomo,
> > > > 
> > > > I am not familiar with Wildfly but my understanding is that you can
> > > > deploy
> > > > arbitrary components there (war, ear, ejb whatever) and there is no
> > > > restriction
> > > > on the port or protocol that your component uses to communicate with the
> > > > outside
> > > > world.
> > > > LWM2M uses UDP (port 5683) or DTLS (5684) for communicating with devices.
> > > > So,
> > > > when you deploy a leshan server as part of a web application, your
> > > > devices should
> > > > still be able to communicate with leshan on these standard ports over
> > > > UDP/DTLS.
> > > > AFAIC there is no need to try to bridge UDP/DTLS to http just in order to
> > > > be able
> > > > to deploy to an application server (like wildfly).
> > > > You should take a look at leshan's demo server implementation and maybe
> > > > alter it
> > > > so that it can be deployed as a war to your application server :-)
> > > > --
> > > > Mit freundlichen Grüßen / Best regards
> > > > 
> > > > Kai Hudalla
> > > > Chief Software Architect
> > > > 
> > > > Bosch Software Innovations GmbH
> > > > Schöneberger Ufer 89-91
> > > > 10785 Berlin
> > > > GERMANY
> > > > www.bosch-si.com
> > > > 
> > > > Registered office: Berlin, Register court: Amtsgericht Charlottenburg,
> > > > HRB 148411 B;
> > > > Executives: Dr.-Ing. Rainer Kallenbach, Michael Hahn
> > > > 
> > > > On Do, 2016-10-13 at 17:01 +0000, Giacomo Genovese wrote:
> > > > > Hi all,
> > > > > I have my IoT-server running on Capedwarf (Jboss Wildfly8). 
> > > > > Actualy I'm not using any standard and I would like to move to Leshan
> > > > in order
> > > > > to use OMA-LwM2M.
> > > > > My problem is how to implement leshan in a HTTP-based environment like
> > > > > Capedwarf. 
> > > > > I saw that nCoAP implement CoAP over Netty/TCP, does Leshan match
> > > > nCoAP?
> > > > >
> > > > > Can Somebody help me?
> > > > >
> > > > > Thanks a lot.
> > > > > Giacomo.
> > > > > _______________________________________________
> > > > > leshan-dev mailing list
> > > > > leshan-dev@xxxxxxxxxxx
> > > > > To change your delivery options, retrieve your password, or unsubscribe
> > > > from
> > > > > this list, visit
> > > > > https://dev.eclipse.org/mailman/listinfo/leshan-dev
> > > > _______________________________________________
> > > > leshan-dev mailing list
> > > > leshan-dev@xxxxxxxxxxx
> > > > To change your delivery options, retrieve your password, or unsubscribe
> > > > from this list, visit
> > > > https://dev.eclipse.org/mailman/listinfo/leshan-dev
> > > > 
> 
> _______________________________________________
> leshan-dev mailing list
> leshan-dev@xxxxxxxxxxx
> To change your delivery options, retrieve your password, or unsubscribe from
> this list, visit
> https://dev.eclipse.org/mailman/listinfo/leshan-dev

Back to the top