Skip to main content

Problems with CDI

  16 posts   Feedicon  
Replies: 15 - Last Post: August 26, 2012 05:10
by: oneminutedistraction
showing 1 - 16 of 16
Posted: August 22, 2012 22:11 by ikac_ikax
Hello there. I appreciate your work, it’s great. I’m using jabberwocky/vorpal for some school project, and I’m having slight problems with CDI, or at least I think.
I’m using NetBeans 7.2 and Glassfish 3.1 and libraries from july.

After making beans.xml, I get two exceptions:

...
OFF: Performing injection with CDI
WARNING: Unable to resolve bean for class java.lang.String
WARNING: Unable to resolve bean for class org.xmpp.packet.JID
INFO: invoke instance:
object class:com.ikac.xmpp.UserAuth, method query
SEVERE: invoke
java.lang.NullPointerException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.kenai.jabberwocky.framework.core.IoCComponentProvider.invoke(IoCComponentProvider.java:204)
at com.kenai.jabberwocky.framework.core.JabberwockyComponent.handleMessage(JabberwockyComponent.java:406)
at com.kenai.jabberwocky.xmppcontainer.AbstractComponent.processMessage(AbstractComponent.java:290)
at com.kenai.jabberwocky.xmppcontainer.AbstractComponent.processQueuedPacket(AbstractComponent.java:142)
at com.kenai.jabberwocky.xmppcontainer.AbstractComponent.processPacket(AbstractComponent.java:121)
at com.kenai.jabberwocky.xmppcontainer.XEP0114ApplicationContainer$2.run(XEP0114ApplicationContainer.java:653)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)

SEVERE: handleMessage
java.lang.reflect.InvocationTargetException
at com.kenai.jabberwocky.framework.core.IoCComponentProvider.invoke(IoCComponentProvider.java:210)
at com.kenai.jabberwocky.framework.core.JabberwockyComponent.handleMessage(JabberwockyComponent.java:406)
at com.kenai.jabberwocky.xmppcontainer.AbstractComponent.processMessage(AbstractComponent.java:290)
at com.kenai.jabberwocky.xmppcontainer.AbstractComponent.processQueuedPacket(AbstractComponent.java:142)
at com.kenai.jabberwocky.xmppcontainer.AbstractComponent.processPacket(AbstractComponent.java:121)
at com.kenai.jabberwocky.xmppcontainer.XEP0114ApplicationContainer$2.run(XEP0114ApplicationContainer.java:653)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.NullPointerException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.kenai.jabberwocky.framework.core.IoCComponentProvider.invoke(IoCComponentProvider.java:204)
... 8 more

OFF: Open conversations: 0
OFF: handle Message time: 26ms

Here is Glassfish server.log:

3T00:06:02.847+0200|INFO|glassfish3.1|com.kenai.jabberwocky.xmppcontainer.XEP0114ApplicationContainer|_ThreadID=24;_ThreadName=Thread-1;|>XXXX appProps key = object-type, value = user|#]

[#|2012-08-23T00:06:02.859+0200|INFO|glassfish3.1|com.kenai.jabberwocky.xmppcontainer.XEP0114Container|_ThreadID=24;_ThreadName=Thread-1;|Registering component My component to subdomain infoservice|#]

[#|2012-08-23T00:06:02.859+0200|INFO|glassfish3.1|com.kenai.jabberwocky.xmppcontainer.XEP0114ApplicationContainer|_ThreadID=24;_ThreadName=Thread-1;|My component: Initialize application with JID = infoservice.boles|#]

[#|2012-08-23T00:06:02.860+0200|INFO|glassfish3.1|com.kenai.jabberwocky.xmppcontainer.XEP0114ApplicationContainer|_ThreadID=24;_ThreadName=Thread-1;|My component: Start application|#]

[#|2012-08-23T00:06:02.860+0200|INFO|glassfish3.1|com.kenai.jabberwocky.xmppcontainer.XEP0114ApplicationContainer|_ThreadID=24;_ThreadName=Thread-1;|Connecting to boles, 5,275, infoservice|#]

[#|2012-08-23T00:06:06.438+0200|OFF|glassfish3.1|com.kenai.jabberwocky.xmppcontainer.AbstractComponent|_ThreadID=25;_ThreadName=Thread-1;|(serving component My component) Processing IQ (packetId 294-159): <iq type="get" id="294-159" from="component.boles" to="infoservice.boles"><query xmlns="http://jabber.org/protocol/disco#info"/></iq>|#]

[#|2012-08-23T00:06:06.438+0200|OFF|glassfish3.1|com.kenai.jabberwocky.framework.core.JabberwockyComponent|_ThreadID=24;_ThreadName=Thread-1;|root dir: /home/ikacikac/NetBeansProjects/Prcoje3/build/web/WEB-INF/classes, packages: |#]

[#|2012-08-23T00:06:06.439+0200|OFF|glassfish3.1|com.kenai.jabberwocky.xmppcontainer.AbstractComponent|_ThreadID=25;_ThreadName=Thread-1;|(serving component My component) Processing IQ request (packetId 294-159).|#]

[#|2012-08-23T00:06:06.439+0200|OFF|glassfish3.1|com.kenai.jabberwocky.framework.core.JabberwockyComponent|_ThreadID=25;_ThreadName=Thread-1;|handle IQ disco#info: <iq type="get" id="294-159" from="component.boles" to="infoservice.boles"><query xmlns="http://jabber.org/protocol/disco#info"/></iq>|#]

[#|2012-08-23T00:06:06.440+0200|WARNING|glassfish3.1|com.kenai.jabberwocky.xmppcontainer.AbstractComponent|_ThreadID=25;_ThreadName=Thread-1;|(serving component 'My component') Unexpected exception while processing IQ stanza: <iq type="get" id="294-159" from="component.boles" to="infoservice.boles"><query xmlns="http://jabber.org/protocol/disco#info"/></iq>
java.lang.NullPointerException
at com.kenai.jabberwocky.framework.core.JabberwockyComponent.getBindings(JabberwockyComponent.java:982)
at com.kenai.jabberwocky.framework.core.JabberwockyComponent.handleDiscoInfo(JabberwockyComponent.java:524)
at com.kenai.jabberwocky.xmppcontainer.AbstractComponent.processIQRequest(AbstractComponent.java:390)
at com.kenai.jabberwocky.xmppcontainer.AbstractComponent.processIQ(AbstractComponent.java:190)
at com.kenai.jabberwocky.xmppcontainer.AbstractComponent.processQueuedPacket(AbstractComponent.java:140)
at com.kenai.jabberwocky.xmppcontainer.AbstractComponent.processPacket(AbstractComponent.java:121)
at com.kenai.jabberwocky.xmppcontainer.XEP0114ApplicationContainer$2.run(XEP0114ApplicationContainer.java:653)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
|#]

[#|2012-08-23T00:06:06.441+0200|OFF|glassfish3.1|com.kenai.jabberwocky.framework.core.JabberwockyApplication|_ThreadID=24;_ThreadName=Thread-1;|Scanning classes directory: /home/ikacikac/NetBeansProjects/Prcoje3/build/web/WEB-INF/classes|#]

[#|2012-08-23T00:06:06.444+0200|INFO|glassfish3.1|com.kenai.jabberwocky.framework.core.JabberwockyComponent|_ThreadID=24;_ThreadName=Thread-1;|Message handlers|#]

[#|2012-08-23T00:06:06.444+0200|INFO|glassfish3.1|com.kenai.jabberwocky.framework.core.JabberwockyComponent|_ThreadID=24;_ThreadName=Thread-1;| MessageHandler ClassNode{handler=com.ikac.xmpp.UserAuth, annotations=@com.kenai.jabberwocky.framework.To(value=query@{__subdomain__}), @com.kenai.jabberwocky.framework.message.Message(valueSmile}|#]

[#|2012-08-23T00:06:06.444+0200|INFO|glassfish3.1|com.kenai.jabberwocky.framework.core.JabberwockyComponent|_ThreadID=24;_ThreadName=Thread-1;|IQ handlers|#]

[#|2012-08-23T00:06:06.444+0200|INFO|glassfish3.1|com.kenai.jabberwocky.framework.core.JabberwockyComponent|_ThreadID=24;_ThreadName=Thread-1;|Presence handlers|#]

[#|2012-08-23T00:06:06.444+0200|OFF|glassfish3.1|com.kenai.jabberwocky.framework.core.JabberwockyComponent|_ThreadID=24;_ThreadName=Thread-1;|CDI enabled: true|#]

[#|2012-08-23T00:06:06.444+0200|OFF|glassfish3.1|com.kenai.jabberwocky.framework.core.JabberwockyComponent|_ThreadID=24;_ThreadName=Thread-1;|Using CDI for component provider|#]

[#|2012-08-23T00:06:06.445+0200|INFO|glassfish3.1|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=34;_ThreadName=Thread-1;|--------- dumping all beans ----------------------|#]

[#|2012-08-23T00:06:06.446+0200|INFO|glassfish3.1|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=34;_ThreadName=Thread-1;|>>> registered bean = null : Implicit Bean [javax.enterprise.inject.spi.InjectionPoint] with qualifiers [@Default]{}[@javax.enterprise.inject.Any(), @javax.enterprise.inject.Default()]|#]

[#|2012-08-23T00:06:06.446+0200|INFO|glassfish3.1|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=34;_ThreadName=Thread-1;|>>> registered bean = null : Extension [class com.kenai.jabberwocky.framework.inject.spi.CDIExtension] with qualifiers [@Default]; jar:fileHmmmhome/ikacikac/NetBeansProjects/Prcoje3/build/web/WEB-INF/lib/vorpal.jar!/META-INF/services/javax.enterprise.inject.spi.Extension@1[com.kenai.jabberwocky.framework.inject.spi.CDIExtension@ae58e9]{}[@javax.enterprise.inject.Any(), @javax.enterprise.inject.Default()]|#]

[#|2012-08-23T00:06:06.446+0200|INFO|glassfish3.1|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=34;_ThreadName=Thread-1;|>>> registered bean = __conversationContext__ : com.kenai.jabberwocky.framework.inject.beans.ConversationContextBean@54288e24{}[@javax.enterprise.inject.Any(), @javax.enterprise.inject.Default(), @javax.inject.Named(value="__conversationContext__")]|#]

[#|2012-08-23T00:06:06.446+0200|INFO|glassfish3.1|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=34;_ThreadName=Thread-1;|>>> registered bean = null : Built-in Bean [javax.transaction.UserTransaction] with qualifiers [@Default]{}[@javax.enterprise.inject.Any(), @javax.enterprise.inject.Default()]|#]

[#|2012-08-23T00:06:06.446+0200|INFO|glassfish3.1|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=34;_ThreadName=Thread-1;|>>> registered bean = null : Built-in Bean [javax.enterprise.inject.spi.BeanManager] with qualifiers [@Default]{}[@javax.enterprise.inject.Any(), @javax.enterprise.inject.Default()]|#]

[#|2012-08-23T00:06:06.447+0200|INFO|glassfish3.1|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=34;_ThreadName=Thread-1;|>>> registered bean = javax.enterprise.context.conversation : org.jboss.weld.bean-WEB-INF/lib/vorpal-Built-in-javax.enterprise.context.Conversation{}[@javax.enterprise.inject.Any(), @javax.enterprise.inject.Default()]|#]

[#|2012-08-23T00:06:06.447+0200|INFO|glassfish3.1|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=34;_ThreadName=Thread-1;|>>> registered bean = null : Implicit Bean [javax.enterprise.inject.Instance] with qualifiers [@Default]{}[@javax.enterprise.inject.Any()]|#]

[#|2012-08-23T00:06:06.447+0200|INFO|glassfish3.1|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=34;_ThreadName=Thread-1;|>>> registered bean = null : Built-in Bean [javax.validator.Validator] with qualifiers [@Default]{}[@javax.enterprise.inject.Any(), @javax.enterprise.inject.Default()]|#]

[#|2012-08-23T00:06:06.447+0200|INFO|glassfish3.1|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=34;_ThreadName=Thread-1;|>>> registered bean = null : com.kenai.jabberwocky.framework.inject.beans.ClientConnectionBean@bf708384{}[@javax.enterprise.inject.Any(), @javax.enterprise.inject.Default()]|#]

[#|2012-08-23T00:06:06.447+0200|INFO|glassfish3.1|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=34;_ThreadName=Thread-1;|>>> registered bean = __threadID__ : com.kenai.jabberwocky.framework.inject.beans.ThreadIDBean@eec0f12d{}[@javax.enterprise.inject.Any(), @javax.enterprise.inject.Default(), @javax.inject.Named(value="__threadID__")]|#]

[#|2012-08-23T00:06:06.447+0200|INFO|glassfish3.1|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=34;_ThreadName=Thread-1;|>>> registered bean = __componentContext__ : NamedBean{typeClass=interface com.kenai.jabberwocky.framework.utils.ComponentContext, namedAnnot=@javax.inject.Named(value="__componentContext__")}{}[@javax.enterprise.inject.Any(), @javax.enterprise.inject.Default(), @javax.inject.Named(value="__componentContext__")]|#]

[#|2012-08-23T00:06:06.448+0200|INFO|glassfish3.1|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=34;_ThreadName=Thread-1;|>>> registered bean = null : Implicit Bean [javax.enterprise.event.Event] with qualifiers [@Default]{}[@javax.enterprise.inject.Any()]|#]

[#|2012-08-23T00:06:06.448+0200|INFO|glassfish3.1|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=34;_ThreadName=Thread-1;|>>> registered bean = null : Built-in Bean [java.security.Principal] with qualifiers [@Default]{}[@javax.enterprise.inject.Any(), @javax.enterprise.inject.Default()]|#]

[#|2012-08-23T00:06:06.448+0200|INFO|glassfish3.1|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=34;_ThreadName=Thread-1;|>>> registered bean = null : Built-in Bean [javax.validator.ValidatorFactory] with qualifiers [@Default]{}[@javax.enterprise.inject.Any(), @javax.enterprise.inject.Default()]|#]

[#|2012-08-23T00:06:06.448+0200|INFO|glassfish3.1|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=34;_ThreadName=Thread-1;|--------------------------------------------------|#]

[#|2012-08-23T00:06:06.448+0200|INFO|glassfish3.1|com.kenai.jabberwocky.framework.core.ReflectionHelper|_ThreadID=24;_ThreadName=Thread-1;|Setting method query accessibility to true|#]

[#|2012-08-23T00:06:06.448+0200|INFO|glassfish3.1|com.kenai.jabberwocky.framework.core.ReflectionHelper|_ThreadID=24;_ThreadName=Thread-1;|Setting constructor com.ikac.xmpp.UserAuth accessibility to true|#]

[#|2012-08-23T00:06:06.449+0200|INFO|glassfish3.1|com.kenai.jabberwocky.framework.core.JabberwockyComponent|_ThreadID=24;_ThreadName=Thread-1;|Component name: My component|#]

[#|2012-08-23T00:06:06.449+0200|INFO|glassfish3.1|com.kenai.jabberwocky.framework.core.JabberwockyComponent|_ThreadID=24;_ThreadName=Thread-1;|Component description: My component description|#]

[#|2012-08-23T00:06:06.451+0200|INFO|glassfish3.1|com.kenai.jabberwocky.framework.core.JabberwockyComponent|_ThreadID=24;_ThreadName=Thread-1;|Conversation provider: Vorpal default conversation provider|#]

[#|2012-08-23T00:06:06.452+0200|INFO|glassfish3.1|com.kenai.jabberwocky.framework.core.JabberwockyComponent|_ThreadID=24;_ThreadName=Thread-1;|Starting Conversation timeout|#]

[#|2012-08-23T00:06:06.453+0200|INFO|glassfish3.1|com.kenai.jabberwocky.framework.core.CalloutQueueManager|_ThreadID=24;_ThreadName=Thread-1;|Scheduling timeout task every 60,000 sec|#]

[#|2012-08-23T00:06:06.453+0200|OFF|glassfish3.1|com.kenai.jabberwocky.framework.core.JabberwockyComponent|_ThreadID=24;_ThreadName=Thread-1;|Firing component lifecycle event: ComponentPreStart|#]

[#|2012-08-23T00:06:06.453+0200|OFF|glassfish3.1|com.kenai.jabberwocky.framework.core.JabberwockyComponent|_ThreadID=24;_ThreadName=Thread-1;|Firing component lifecycle event: ComponentPostStart|#]

[#|2012-08-23T00:06:06.495+0200|INFO|glassfish3.1|javax.enterprise.system.tools.admin.org.glassfish.deployment.admin|_ThreadID=34;_ThreadName=Thread-1;|Prcoje3 was successfully deployed in 4,783 milliseconds.|#]

[#|2012-08-23T00:07:06.429+0200|INFO|glassfish3.1|com.kenai.jabberwocky.xmppcontainer.stats.IncomingPacketProbeProvider|_ThreadID=26;_ThreadName=Thread-1;|incoming message: name=web, from=user1@boles/edcbdab8, to=query@infoservice.boles|#]

[#|2012-08-23T00:07:06.430+0200|OFF|glassfish3.1|com.kenai.jabberwocky.framework.core.JabberwockyComponent|_ThreadID=26;_ThreadName=Thread-1;|handle Message: <message type="chat" id="purple23e41f42" to="query@infoservice.boles" from="user1@boles/edcbdab8"><active xmlns="http://jabber.org/protocol/chatstates"/><body>test</body></message>|#]

[#|2012-08-23T00:07:06.430+0200|OFF|glassfish3.1|com.kenai.jabberwocky.framework.core.JabberwockyComponent|_ThreadID=26;_ThreadName=Thread-1;|Handling Message with CDI|#]

[#|2012-08-23T00:07:06.436+0200|INFO|glassfish3.1|com.kenai.jabberwocky.framework.core.CDIComponentProvider|_ThreadID=26;_ThreadName=Thread-1;|Resolving instance with CDI: class com.ikac.xmpp.UserAuth |#]

[#|2012-08-23T00:07:06.438+0200|WARNING|glassfish3.1|com.kenai.jabberwocky.framework.inject.spi.CDIUtils|_ThreadID=26;_ThreadName=Thread-1;|Unable to resolve bean for class com.ikac.xmpp.UserAuth|#]

[#|2012-08-23T00:07:06.438+0200|INFO|glassfish3.1|com.kenai.jabberwocky.framework.core.JabberwockyComponent|_ThreadID=26;_ThreadName=Thread-1;|Resolved instance type = com.ikac.xmpp.UserAuth|#]

[#|2012-08-23T00:07:06.438+0200|OFF|glassfish3.1|com.kenai.jabberwocky.framework.core.CDIComponentProvider|_ThreadID=26;_ThreadName=Thread-1;|Performing injection with CDI|#]

[#|2012-08-23T00:07:06.440+0200|WARNING|glassfish3.1|com.kenai.jabberwocky.framework.inject.spi.CDIUtils|_ThreadID=26;_ThreadName=Thread-1;|Unable to resolve bean for class java.lang.String|#]

[#|2012-08-23T00:07:06.440+0200|WARNING|glassfish3.1|com.kenai.jabberwocky.framework.inject.spi.CDIUtils|_ThreadID=26;_ThreadName=Thread-1;|Unable to resolve bean for class org.xmpp.packet.JID|#]

[#|2012-08-23T00:07:06.441+0200|INFO|glassfish3.1|com.kenai.jabberwocky.framework.core.IoCComponentProvider|_ThreadID=26;_ThreadName=Thread-1;|invoke instance:
object class:com.ikac.xmpp.UserAuth, method query|#]

[#|2012-08-23T00:07:06.442+0200|SEVERE|glassfish3.1|com.kenai.jabberwocky.framework.core.IoCComponentProvider|_ThreadID=26;_ThreadName=Thread-1;|invoke
java.lang.NullPointerException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.kenai.jabberwocky.framework.core.IoCComponentProvider.invoke(IoCComponentProvider.java:204)
at com.kenai.jabberwocky.framework.core.JabberwockyComponent.handleMessage(JabberwockyComponent.java:406)
at com.kenai.jabberwocky.xmppcontainer.AbstractComponent.processMessage(AbstractComponent.java:290)
at com.kenai.jabberwocky.xmppcontainer.AbstractComponent.processQueuedPacket(AbstractComponent.java:142)
at com.kenai.jabberwocky.xmppcontainer.AbstractComponent.processPacket(AbstractComponent.java:121)
at com.kenai.jabberwocky.xmppcontainer.XEP0114ApplicationContainer$2.run(XEP0114ApplicationContainer.java:653)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
|#]

[#|2012-08-23T00:07:06.442+0200|SEVERE|glassfish3.1|com.kenai.jabberwocky.framework.core.JabberwockyComponent|_ThreadID=26;_ThreadName=Thread-1;|handleMessage
java.lang.reflect.InvocationTargetException
at com.kenai.jabberwocky.framework.core.IoCComponentProvider.invoke(IoCComponentProvider.java:210)
at com.kenai.jabberwocky.framework.core.JabberwockyComponent.handleMessage(JabberwockyComponent.java:406)
at com.kenai.jabberwocky.xmppcontainer.AbstractComponent.processMessage(AbstractComponent.java:290)
at com.kenai.jabberwocky.xmppcontainer.AbstractComponent.processQueuedPacket(AbstractComponent.java:142)
at com.kenai.jabberwocky.xmppcontainer.AbstractComponent.processPacket(AbstractComponent.java:121)
at com.kenai.jabberwocky.xmppcontainer.XEP0114ApplicationContainer$2.run(XEP0114ApplicationContainer.java:653)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.NullPointerException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.kenai.jabberwocky.framework.core.IoCComponentProvider.invoke(IoCComponentProvider.java:204)
... 8 more
|#]

[#|2012-08-23T00:07:06.443+0200|OFF|glassfish3.1|com.kenai.jabberwocky.framework.core.ConversationMap|_ThreadID=26;_ThreadName=Thread-1;|Open conversations: 0|#]

[#|2012-08-23T00:07:06.443+0200|OFF|glassfish3.1|com.kenai.jabberwocky.framework.core.JabberwockyComponent|_ThreadID=26;_ThreadName=Thread-1;|handle Message time: 13ms|#]

And this is message handler:

@RequestScoped
@Message
@To("query@{__subdomain__}")
public class UserAuth {
@PersistenceContext EntityManager em;

@Body("{body}")
public String query(@Bind("body") String message, @From JID jid){
System.out.print("Poceo sam sa ucitavanjem "+message);

return message;
}

}

Please help, I’d be very grateful. Cheers!
Posted: August 23, 2012 00:24 by oneminutedistraction
Hi

I cannot really see any issue with your code except to say that you're using GF 3.1. Can you try with the latest GF 3.1.2.2 or atleast 3.1.2?

Do not use @RequestScoped on XMPP packet handlers. XMPP packet does not really support this; so please remove that and make your handler non-contextual for now.

If you're still having issues send me an email to oneminutedistraction@gmail.com. I'll send you a sample project for you to try.

BTW @Bind is a deprecated annotation. Use @Named instead. I'm aligning all annotations with CDI

HTH

Regards
Posted: August 23, 2012 09:06 by ikac_ikax
Hello,

Thanks for hints. I've switched to GF 3.1.2.2, and now as far as I can see, CDI doesn't start at all.

I get
OFF: CDI enabled: false
in NetBeans GF log.

After that, there are two warnings:

WARNING: Error while processing disco#info
java.lang.ClassCastException: com.kenai.jabberwocky.framework.core.IoCComponentProvider cannot be cast to com.kenai.jabberwocky.framework.core.CDIComponentProvider
at com.kenai.jabberwocky.framework.core.JabberwockyComponent.createPredefinedBindings(JabberwockyComponent.java:938)
at com.kenai.jabberwocky.framework.core.JabberwockyComponent.processIQ(JabberwockyComponent.java:443)
at com.kenai.jabberwocky.framework.core.JabberwockyComponent.handleDiscoInfo(JabberwockyComponent.java:516)
at com.kenai.jabberwocky.xmppcontainer.AbstractComponent.processIQRequest(AbstractComponent.java:390)
at com.kenai.jabberwocky.xmppcontainer.AbstractComponent.processIQ(AbstractComponent.java:190)
at com.kenai.jabberwocky.xmppcontainer.AbstractComponent.processQueuedPacket(AbstractComponent.java:140)
at com.kenai.jabberwocky.xmppcontainer.AbstractComponent.processPacket(AbstractComponent.java:121)
at com.kenai.jabberwocky.xmppcontainer.XEP0114ApplicationContainer$1.run(XEP0114ApplicationContainer.java:596)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)

WARNING: (serving component 'My component') Unexpected exception while processing IQ stanza: <iq type="get" id="832-164" from="component.boles" to="infoservice.boles"><query xmlns="http://jabber.org/protocol/disco#info"><identity category="component" type="generic" name="My component"/><feature var="jabber:iq:last"/><feature var="urn:xmppTongueing"/><feature var="urn:xmpp:time"/><feature var="http://jabber.org/protocol/disco#info"/></query></iq>
java.lang.ClassCastException: com.kenai.jabberwocky.framework.core.IoCComponentProvider cannot be cast to com.kenai.jabberwocky.framework.core.CDIComponentProvider
at com.kenai.jabberwocky.framework.core.JabberwockyComponent.handleDiscoInfo(JabberwockyComponent.java:581)
at com.kenai.jabberwocky.xmppcontainer.AbstractComponent.processIQRequest(AbstractComponent.java:390)
at com.kenai.jabberwocky.xmppcontainer.AbstractComponent.processIQ(AbstractComponent.java:190)
at com.kenai.jabberwocky.xmppcontainer.AbstractComponent.processQueuedPacket(AbstractComponent.java:140)
at com.kenai.jabberwocky.xmppcontainer.AbstractComponent.processPacket(AbstractComponent.java:121)
at com.kenai.jabberwocky.xmppcontainer.XEP0114ApplicationContainer$1.run(XEP0114ApplicationContainer.java:596)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)


And the same two exceptios, like those before.

Thanks for the help.
Cheers!
Posted: August 24, 2012 03:25 by oneminutedistraction
Hi

try the latest Aug bundle. Should work with @RequestScoped. Also see my reply to renclav here.

Regards
Posted: August 23, 2012 09:43 by renclav
Hi,

It seems to be related to the latest library update.

The exact same code works on an older release.

When sending a message, the error response is,

OFF: handle Message: <message from="dylan@dylanpc/Vacuum-IM" to="glossbot@glossbot.dylanpc" type="normal">
<subject>1|0</subject>
<thread>{c416daa8-44eb-49f7-a082-c5afe101a62e}</thread>
<body>jk</body>
</message>
OFF: Handling Message with CDI
INFO: Resolving instance with CDI: class com.indaba.XMPP.GlossaryQuery
WARNING: Unable to resolve bean for class com.indaba.XMPP.GlossaryQuery
INFO: Resolved instance type = com.indaba.XMPP.GlossaryQuery
OFF: Performing injection with CDI
INFO: invoke instance:
object class:com.indaba.XMPP.GlossaryQuery, method handleQuery
SEVERE: invoke
java.lang.NullPointerException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.kenai.jabberwocky.framework.core.IoCComponentProvider.invoke(IoCComponentProvider.java:204)
at com.kenai.jabberwocky.framework.core.JabberwockyComponent.handleMessage(JabberwockyComponent.java:406)
at com.kenai.jabberwocky.xmppcontainer.AbstractComponent.processMessage(AbstractComponent.java:290)
at com.kenai.jabberwocky.xmppcontainer.AbstractComponent.processQueuedPacket(AbstractComponent.java:142)
at com.kenai.jabberwocky.xmppcontainer.AbstractComponent.processPacket(AbstractComponent.java:121)
at com.kenai.jabberwocky.xmppcontainer.XEP0114ApplicationContainer$2.run(XEP0114ApplicationContainer.java:653)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)

SEVERE: handleMessage
java.lang.reflect.InvocationTargetException
at com.kenai.jabberwocky.framework.core.IoCComponentProvider.invoke(IoCComponentProvider.java:210)
at com.kenai.jabberwocky.framework.core.JabberwockyComponent.handleMessage(JabberwockyComponent.java:406)
at com.kenai.jabberwocky.xmppcontainer.AbstractComponent.processMessage(AbstractComponent.java:290)
at com.kenai.jabberwocky.xmppcontainer.AbstractComponent.processQueuedPacket(AbstractComponent.java:142)
at com.kenai.jabberwocky.xmppcontainer.AbstractComponent.processPacket(AbstractComponent.java:121)
at com.kenai.jabberwocky.xmppcontainer.XEP0114ApplicationContainer$2.run(XEP0114ApplicationContainer.java:653)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.NullPointerException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.kenai.jabberwocky.framework.core.IoCComponentProvider.invoke(IoCComponentProvider.java:204)
... 8 more

OFF: Open conversations: 0
OFF: handle Message time: 23ms

In regards to the scope settings, do you mean we should never set them? Example @RequestScoped

Thank You
Posted: August 23, 2012 23:34 by oneminutedistraction
Then I think there are some issues with your NB project. I'm currently using GF 3.1.2.2 with the latest libs. Give me your email and I'll email you a test project.

Regards
Posted: August 24, 2012 03:23 by oneminutedistraction
Please use the latest Aug release for Vorpal. It'll handle @RequestScoped correctly with or without @Inject annotation. It'll also work without and scoped annotations.

But if you're using @ApplicationScoped annotation on your packet handlers then you'll have to use @Inject Vorpal attributes.

I'll blog about this support later today.

Regards
Posted: August 23, 2012 23:40 by oneminutedistraction
Renclav, sorry for all the issues that this latest update is causing. Its a massive change.

1. Can you send me just the handler class strip off all the logic but keep the annotations. I'm curious why its reporting that the handler class is not found, then found.

2. As for the scope annotations, I've made it so that it is inline with CDI. @RequestScope doesn't really have any meaning here. I'll try to add that back it. Seems to be causing lots of heartache.

My aim is to back totally backward compatible. You should not have to change any of your code.

Thanks for your patience.

Regards
Posted: August 24, 2012 09:55 by renclav
Hi,

The handler strip:

@RequestScoped
@Message
@From("{anyone}@" + PredefinedBindings.PARAMETER_DOMAIN + "{*res}")
@To("glossbot@" + PredefinedBindings.PARAMETER_SUBDOMAIN + "{*res}")
public class GlossaryQuery {

/*
* @PersistenceUnit(unitName = "Glossary_Bot_1.1PU") EntityManagerFactory
* emf;
*/
@Bind(PredefinedBindings.PACKET)
org.xmpp.packet.Message message;
String sub;

@From("{any}@{anydomain}")
public org.xmpp.packet.Message handleQuery(@Named("any") String GUID) {
.......
}

Posted: August 25, 2012 03:30 by oneminutedistraction
Renclav

I can not reproduce this bug with the latest bundle.

Here are some comment on your code above

1. If annotations is at the class level like your @From and @To, then its best to avoid capture with the same name {res} in your case. The reason is that capture are now exported as CDI named beans so that might cause issues if you have the same name but tying to inject to different type. Your case above works because {res} is injected/defined as String

2. @Bind is deprecated and will not be supported in the future. Please use @Named. Eg if you want to get the value of {res}, then use @Named("res"). In your case above @Inject Packet will do the job. In general all the predefined bindings you can just use @Inject <Type> with the exception of javax.enterprise.context.Conversation. For Coversation, you must do the following

@Inject @Named(PredefinedBindings.CONVERSATION) Conversation

I'm going to blog about explicit conversation soon.

Keep the comment coming.

Thanks

Regards
Posted: August 23, 2012 10:03 by renclav
note,

com.kenai.jabberwocky.framework.utils.ComponentContext

is no longer available? Does this mean we can only achieve the same results with IQ packet capture?
Posted: August 23, 2012 23:32 by oneminutedistraction
No ComponentContext is available. Please let me know what the issue is.

Thanks
Posted: August 24, 2012 09:59 by renclav
Hi,

I cant seem to get disco query to function correctly.

@IQ
public class IQHandler {

@Query(namespace="http://jabber.org/protocol/disco#info")
public ResponseContext discoInfoResult() {
ResponseContext respc = new ResponseContext(ResponseContext.Type.IQ);
respc.add(org.xmpp.packet.IQ.Type.result).add(new IQChildElement("query", "http://jabber.org/protocol/disco#info")).add(new IdentitySpecification("client", "bot", "TXT-Talk"));
return respc;
}
}

Server log:

OFF: (serving component My component) Processing IQ (packetId sid_75): <iq from="4sw4x29@ptxtest.im/Vacuum-IM" to="glossbot.ptxtest.im" type="get" id="sid_75">
<query xmlns="http://jabber.org/protocol/disco#info"/>
</iq>
OFF: (serving component My component) Processing IQ request (packetId sid_75).
OFF: handle IQ disco#info: <iq from="4sw4x29@ptxtest.im/Vacuum-IM" to="glossbot.ptxtest.im" type="get" id="sid_75">
<query xmlns="http://jabber.org/protocol/disco#info"/>
</iq>
OFF: Handling IQ with CDI
INFO: Resolving instance with CDI: class com.indaba.XMPP.IQHandler
INFO: Resolved instance type = com.indaba.XMPP.IQHandler
OFF: Performing injection with CDI
INFO: invoke instance:
object class:com.indaba.XMPP.IQHandler, method discoInfoResult
OFF: Releasing CDI instance: com.indaba.XMPP.IQHandler
INFO: Releasing @Conversation instance: com.indaba.XMPP.IQHandler
OFF: Open conversations: 1
OFF: open threadId = sid_75
OFF: handle IQ time: 18ms
OFF: Processing conversation for packet:
<iq type="result" id="761-0" from="glossbot.ptxtest.im" to="4sw4x29@ptxtest.im/Vacuum-IM">
<query xmlns="http://jabber.org/protocol/disco#info">
<identity category="client" type="bot" name="TXT-Talk"/>
</query>
</iq>
OFF: End implicit conversation: 761-0
INFO: Sending packet:
<iq type="result" id="761-0" from="glossbot.ptxtest.im" to="4sw4x29@ptxtest.im/Vacuum-IM">
<query xmlns="http://jabber.org/protocol/disco#info">
<identity category="client" type="bot" name="TXT-Talk"/>
</query>
</iq>
OFF: Processing conversation for packet:
<iq type="result" id="sid_75" from="glossbot.ptxtest.im" to="4sw4x29@ptxtest.im/Vacuum-IM">
<query xmlns="http://jabber.org/protocol/disco#info">
<identity category="component" type="generic" name="My component"/>
<feature var="jabber:iq:last"/>
<feature var="urn:xmppTongueing"/>
<feature var="urn:xmpp:time"/>
<feature var="http://jabber.org/protocol/disco#info"/>
</query>
</iq>
OFF: End implicit conversation: sid_75
OFF: Open conversations: 0
OFF: (serving component My component) Responding to IQ (packetId sid_75) with: <iq type="result" id="sid_75" from="glossbot.ptxtest.im" to="4sw4x29@ptxtest.im/Vacuum-IM"><query xmlns="http://jabber.org/protocol/disco#info"><identity category="component" type="generic" name="My component"/><feature var="jabber:iq:last"/><feature var="urn:xmppTongueing"/><feature var="urn:xmpp:time"/><feature var="http://jabber.org/protocol/disco#info"/></query></iq>


For some reason, my response context is using its own ID for the return packet, I think this is the cause.

Regards,

Dylan
Posted: August 25, 2012 03:21 by oneminutedistraction
I've fixed this bug. Please download the latest bundle

Posted: August 25, 2012 10:14 by ikac_ikax
Hi,

I managed to make july bundle work, and everything works just great.

For those who have same problem, here are some tips:
I installed java-7-oracle (maybe that helps, seems that my manual install of java 6 jdk made some problems?)
NetBeans 7.2 bundled with GF server 3.1.2.2
Posted: August 26, 2012 05:10 by oneminutedistraction
Excellent. You should also try with the latest Aug bundle as it has numerous bug fixes some of which involves how Vorpal handles the initial disco#info.

Regards
showing 1 - 16 of 16
Replies: 15 - Last Post: August 26, 2012 05:10
by: oneminutedistraction
 
 
Close
loading
Please Confirm
Close