Screencast – Developing XMPP Services with Jabberwocky and Vorpal

I’ve decided to move to the 21st century by recording my first screencast. After hunting and testing various Linux tools, I’ve settled on recordMyDesktop.

The following 2 screencast on this blog are my effort.

So what’s the screencast about? I’ve blog extensively about XMPP and the two framework that I’ve been working on, Jabberwocky and Vorpal. I thought it’ll be nice to show how to use these frameworks.

Part 1 of the screencast talks about the various ways you can develop XMPP services.
These includes service bots, server plugin and external component. The
second segment of this part describes a use case for querying a
database using XMPP.

In part 2 of the screencast, I will show how to implement the use case described above with Jabberwocky and Vorpal along with JavaEE services including CDI and JPA.

The source for the code from part 2 can be found here.

Please provide your comments and feedbacks. Till next time.

About these ads

9 Responses to Screencast – Developing XMPP Services with Jabberwocky and Vorpal

  1. alp patel says:

    Getting following error, though I am able to send message but not hitting CustomerQueryHandler class.

    SEVERE: Module not started com.kenai.jabberwocky.xmppcontainer.XEP0114ApplicationContainer@1966ccf
    SEVERE: Exception while invoking class com.kenai.jabberwocky.xmppcontainer.XEP0114ApplicationContainer start method
    java.lang.Exception: Module not started com.kenai.jabberwocky.xmppcontainer.XEP0114ApplicationContainer@1966ccf
    at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:271)
    at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:294)
    at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:462)
    at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240)
    at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:382)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:355)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:370)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1064)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:96)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1244)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1232)
    at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:459)
    at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:209)
    at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:168)
    at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:117)
    at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:238)
    at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:828)
    at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:725)
    at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1019)
    at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225)
    at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
    at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
    at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
    at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
    at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
    at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
    at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
    at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
    at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
    at java.lang.Thread.run(Thread.java:722)

    SEVERE: Exception while loading the app
    INFO: XXXX unload: C:\Users\bhalalaa\Documents\NetBeansProjects\Xyz\build\web
    INFO: XXXX clean: C:\Users\bhalalaa\Documents\NetBeansProjects\Xyz\build\web
    WARNING: Exception while cleaning module ‘org.glassfish.internal.data.EngineRef@136a191’java.lang.IllegalStateException: WEB9031: WebappClassLoader unable to load resource [META-INF/services/javax.xml.parsers.SAXParserFactory], because it has not yet been started, or was already stopped
    java.lang.IllegalStateException: WEB9031: WebappClassLoader unable to load resource [META-INF/services/javax.xml.parsers.SAXParserFactory], because it has not yet been started, or was already stopped
    at org.glassfish.web.loader.WebappClassLoader.findResourceInternal(WebappClassLoader.java:2075)
    at org.glassfish.web.loader.WebappClassLoader.findResource(WebappClassLoader.java:1036)
    at org.glassfish.web.loader.WebappClassLoader.findResource(WebappClassLoader.java:1020)
    at org.glassfish.web.loader.WebappClassLoader.getResourceAsStream(WebappClassLoader.java:1264)
    at javax.xml.parsers.SecuritySupport$4.run(SecuritySupport.java:94)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.xml.parsers.SecuritySupport.getResourceAsStream(SecuritySupport.java:87)
    at javax.xml.parsers.FactoryFinder.findJarServiceProvider(FactoryFinder.java:248)
    at javax.xml.parsers.FactoryFinder.find(FactoryFinder.java:221)
    at javax.xml.parsers.SAXParserFactory.newInstance(SAXParserFactory.java:126)
    at javax.xml.bind.helpers.AbstractUnmarshallerImpl.getXMLReader(AbstractUnmarshallerImpl.java:115)
    at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:172)
    at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:177)
    at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:186)
    at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:204)
    at com.kenai.jabberwocky.xmppcontainer.XARDeployer.clean(XARDeployer.java:75)
    at org.glassfish.internal.data.EngineInfo.clean(EngineInfo.java:129)
    at org.glassfish.internal.data.EngineRef.clean(EngineRef.java:175)
    at com.sun.enterprise.v3.server.ApplicationLifecycle$1.actOn(ApplicationLifecycle.java:303)
    at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:466)
    at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240)
    at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:382)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:355)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:370)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1064)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:96)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1244)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1232)
    at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:459)
    at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:209)
    at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:168)
    at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:117)
    at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:238)
    at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:828)
    at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:725)
    at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1019)
    at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225)
    at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
    at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
    at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
    at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
    at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
    at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
    at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
    at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
    at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
    at java.lang.Thread.run(Thread.java:722)

    SEVERE: Exception while loading the app : Module not started com.kenai.jabberwocky.xmppcontainer.XEP0114ApplicationContainer@1966ccf

  2. alp patel says:

    Posted my comment here. http://java.net/projects/jabberwocky/forums/message-forum/topics/31388-Could-not-run-the-example

    But short answer to all your questions is: yes.

  3. Mike says:

    I am receiving a different error while trying to run the latest jabberwocky container code – again environment is Winows 7, GlassFish 3.1.1 and OpenFire 3.7.1.

    I have downloaded – xmpp_container_cny_2012-01-19_12.25.40.zip.

    1. Yes, I did create a subdomain for the external component.
    2. Yes, I did.
    3. Yes, I installed jabberwocky.jar and jabberwocky_support.jar to the modules.

    I received a classnotfound exception for the jabberwocky framework classes so, I also added vorpal.jar to the modules directory.

    Now, when I try to deploy through NetBeans, I am receiving the following WARNING: WARNING: Error while trying to load Bean Class com.kenai.jabberwocky.framework.inject.spi.CDIExtension : java.lang.NoClassDefFoundError: javax/enterprise/inject/spi/Extension

    and here is the full output from the GlassFish server:

    INFO: XEP-0114 container started
    OFF: XXXX container: com.kenai.jabberwocky.xmppcontainer.XEP0114Container@1aad75
    INFO: Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
    INFO: XXXX prepare: C:\Users\mike\Documents\NetBeansProjects\CustomerQuery\build\web
    INFO: WELD-000900 ${parsedVersion (osgiVersion})
    WARNING: Error while trying to load Bean Class com.kenai.jabberwocky.framework.inject.spi.CDIExtension : java.lang.NoClassDefFoundError: javax/enterprise/inject/spi/Extension
    INFO: Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
    INFO: XXXX load: C:\Users\mike\Documents\NetBeansProjects\CustomerQuery\build\web
    INFO: XXXX source dir – name: web
    INFO: XXXX source dir – absolute path: C:\Users\mike\Documents\NetBeansProjects\CustomerQuery\build\web
    INFO: XXXX class = index.jsp
    INFO: XXXX class = META-INF
    INFO: XXXX class = WEB-INF
    INFO: XXXX class = WEB-INF/beans.xml
    INFO: XXXX class = WEB-INF/classes
    INFO: XXXX class = WEB-INF/classes/.netbeans_automatic_build
    INFO: XXXX class = WEB-INF/classes/.netbeans_update_resources
    INFO: XXXX class = WEB-INF/classes/com
    INFO: XXXX class = WEB-INF/classes/com/acme
    INFO: XXXX class = WEB-INF/classes/com/acme/xmpp
    INFO: XXXX class = WEB-INF/classes/com/acme/xmpp/CustomerQueryHandler.class
    INFO: XXXX class = WEB-INF/classes/com/acme/xmpp/model
    INFO: XXXX class = WEB-INF/classes/com/acme/xmpp/models
    INFO: XXXX class = WEB-INF/classes/com/acme/xmpp/models/Customer.class
    INFO: XXXX class = WEB-INF/classes/com/acme/xmpp/models/Customer.rapt
    INFO: XXXX class = WEB-INF/classes/com/acme/xmpp/models/Customer_.class
    INFO: XXXX class = WEB-INF/classes/com/acme/xmpp/models/DiscountCode.class
    INFO: XXXX class = WEB-INF/classes/com/acme/xmpp/models/DiscountCode.rapt
    INFO: XXXX class = WEB-INF/classes/com/acme/xmpp/models/DiscountCode_.class
    INFO: XXXX class = WEB-INF/classes/com/acme/xmpp/models/MicroMarket.class
    INFO: XXXX class = WEB-INF/classes/com/acme/xmpp/models/MicroMarket.rapt
    INFO: XXXX class = WEB-INF/classes/com/acme/xmpp/models/MicroMarket_.class
    INFO: XXXX class = WEB-INF/classes/META-INF
    INFO: XXXX class = WEB-INF/classes/META-INF/persistence.xml
    INFO: XXXX class = WEB-INF/classes/resouces.res
    INFO: XXXX class = WEB-INF/glassfish-web.xml
    INFO: XXXX class = WEB-INF/lib
    INFO: XXXX class = WEB-INF/lib/vorpal.jar
    INFO: XXXX class = WEB-INF/web.xml
    INFO: XXXX class = WEB-INF/xep-0114.xml
    INFO: key = location, value = file:/C:/Users/mike/Documents/NetBeansProjects/CustomerQuery/build/web/
    INFO: key = directory-deployed, value = true
    INFO: key = context-root, value = /CustomerQuery
    INFO: key = defaultAppName, value = web
    INFO: key = object-type, value = user
    INFO: key = org.glassfish.persistence.app_name_property, value = CustomerQuery
    SEVERE: Exception while loading the app
    INFO: XXXX unload: C:\Users\mike\Documents\NetBeansProjects\CustomerQuery\build\web
    INFO: XXXX clean: C:\Users\mike\Documents\NetBeansProjects\CustomerQuery\build\web
    SEVERE: Exception while deploying the app [CustomerQuery]
    SEVERE: The log message is null.
    java.lang.ExceptionInInitializerError
    at com.sun.xml.bind.v2.model.impl.RuntimeTypeInfoSetImpl.(RuntimeTypeInfoSetImpl.java:65)
    at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.createTypeInfoSet(RuntimeModelBuilder.java:133)
    at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.createTypeInfoSet(RuntimeModelBuilder.java:85)
    at com.sun.xml.bind.v2.model.impl.ModelBuilder.(ModelBuilder.java:156)
    at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.(RuntimeModelBuilder.java:93)
    at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:450)
    at com.sun.xml.bind.v2.runtime.JAXBContextImpl.(JAXBContextImpl.java:298)
    at com.sun.xml.bind.v2.runtime.JAXBContextImpl.(JAXBContextImpl.java:141)
    at com.sun.xml.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(JAXBContextImpl.java:1157)
    at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:145)
    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 javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:263)
    at javax.xml.bind.ContextFinder.find(ContextFinder.java:428)
    at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:652)
    at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:599)
    at com.kenai.jabberwocky.xmppcontainer.XARDeployer.clean(XARDeployer.java:73)
    at org.glassfish.internal.data.EngineInfo.clean(EngineInfo.java:129)
    at org.glassfish.internal.data.EngineRef.clean(EngineRef.java:175)
    at com.sun.enterprise.v3.server.ApplicationLifecycle$1.actOn(ApplicationLifecycle.java:303)
    at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:466)
    at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240)
    at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:382)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:355)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:370)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1064)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:96)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1244)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1232)
    at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:459)
    at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:209)
    at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:168)
    at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:117)
    at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:238)
    at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:828)
    at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:725)
    at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1019)
    at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225)
    at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
    at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
    at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
    at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
    at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
    at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
    at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
    at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
    at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
    at java.lang.Thread.run(Thread.java:662)
    Caused by: java.lang.IllegalStateException: WEB9031: WebappClassLoader unable to load resource [META-INF/services/javax.xml.datatype.DatatypeFactory], because it has not yet been started, or was already stopped
    at org.glassfish.web.loader.WebappClassLoader.findResourceInternal(WebappClassLoader.java:2075)
    at org.glassfish.web.loader.WebappClassLoader.findResource(WebappClassLoader.java:1036)
    at org.glassfish.web.loader.WebappClassLoader.findResource(WebappClassLoader.java:1020)
    at org.glassfish.web.loader.WebappClassLoader.getResourceAsStream(WebappClassLoader.java:1264)
    at javax.xml.datatype.SecuritySupport$4.run(SecuritySupport.java:92)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.xml.datatype.SecuritySupport.getResourceAsStream(SecuritySupport.java:85)
    at javax.xml.datatype.FactoryFinder.findJarServiceProvider(FactoryFinder.java:250)
    at javax.xml.datatype.FactoryFinder.find(FactoryFinder.java:223)
    at javax.xml.datatype.DatatypeFactory.newInstance(DatatypeFactory.java:131)
    at com.sun.xml.bind.v2.model.impl.RuntimeBuiltinLeafInfoImpl.init(RuntimeBuiltinLeafInfoImpl.java:903)
    at com.sun.xml.bind.v2.model.impl.RuntimeBuiltinLeafInfoImpl.(RuntimeBuiltinLeafInfoImpl.java:899)
    … 50 more

    INFO: XXXX unload: C:\Users\mike\Documents\NetBeansProjects\CustomerQuery\build\web
    INFO: XXXX clean: C:\Users\mike\Documents\NetBeansProjects\CustomerQuery\build\web
    SEVERE: Could not initialize class com.sun.xml.bind.v2.model.impl.RuntimeBuiltinLeafInfoImpl

    Any thoughts?

  4. ikacikax says:

    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. After making beans.xml, I get two exceptions:

    SEVERE: invoke
    java.lang.NullPointerException

    and

    SEVERE: handleMessage
    java.lang.reflect.InvocationTargetException

    I’m using NetBeans 7.2 and Glassfish 3.1 and libraries from july. Please help, I’d be very grateful. Cheers!

    • Hi can you please repost your question to the forum. The reason is that I want to capture all the issues that people are having.

      Can you also post the entire stact trace of the NPE and the handleMessage error. Also if you can also post the your message handler class (strip off the logic if you like).

      Thanks

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: