My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
GettingStarted  
How to get started
Featured
Updated Mar 16, 2012 by harald.pehl

Modules

Actually Piriti consists of these artifacts:

  • piriti-user: Contains the annotations, classes and interfaces to map JSON and XML to POJOs.
  • piriti-dev: Contains the deferred binding stuff for code generation.
  • piriti-restlet: An extension for the Restlet GWT edition. Contains representations which use the readers from Piriti.

Prerequisites

To use Piriti make sure you have the following dependencies on your classpath:

For maven users add the following dependencies to your pom (Piriti is in Maven Central):

<dependency>
    <groupId>name.pehl</groupId>
    <artifactId>piriti-user</artifactId>
    <version>0.8</version>
    <scope>provided</scope>
</dependency>
<dependency>
    <groupId>name.pehl</groupId>
    <artifactId>piriti-dev</artifactId>
    <version>0.8</version>
    <scope>provided</scope>
</dependency>
<!-- For Restlet support -->
<dependency>
    <groupId>name.pehl</groupId>
    <artifactId>piriti-restlet</artifactId>
    <version>0.8</version>
    <scope>provided</scope>
</dependency>

Usage

To actually use Piriti make sure that you inherit one or all of the following modules:

<inherits name="name.pehl.piriti.json.JSON" />
<inherits name="name.pehl.piriti.xml.XML" />
Comment by samspade79, Jan 19, 2011

I had to add the parent repo in order for maven to find the dependancies that piriti code needs.

<repository>
<id>pehl-parent</id> <url>http://pehl-parent.googlecode.com/svn/repository</url>
</repository>
Comment by michalhe...@gmail.com, Apr 21, 2011

I think it would be much better use standard maven repository not your own. See http://www.thewebsemantic.com/2009/04/11/your-very-own-google-code-maven-repo/ and the discussion.

Comment by ludovic....@gmail.com, May 11, 2011

I also had to add dependencies on commons-lang and commons-lang3

<dependency>
<groupId>commons-lang</groupId> <artifactId>commons-lang</artifactId>
<version>2.6</version>
</dependency>

<dependency>
<groupId>org.apache.commons</groupId> <artifactId>commons-lang3</artifactId>
<version>3.0-SNAPSHOT</version>
</dependency>

Otherwise, there was an exception on Reader / Write generation (because it could not find functions from those packages).

Comment by mark.van...@gmail.com, Jun 13, 2011

For maven I had to put the versions tag too: <version>0.7.0b1</version>

Otherwise it was not working for me and he couldnt find any dependencies at all...

Comment by evan.r...@gmail.com, Jun 27, 2011

I seem to get an inheritance failure. In name.pehl.piriti.json.JSON.gwt.xml it seems to be looking for "name.pehl.totoe.json.JsonParser? (line 11)." In totoe-0.2.4.jar, I can only find name.pehl.totoe.json.JSON.gwt.xml

Is this a version issue?

Comment by fschwi...@makingsense.com, Sep 28, 2011

Hi ..

Is this code supported to serialization?

public class A {

 String name;
 public class state{
        String x;
        String y;
        public state(xx,yy){x=xx, y=yy };
        }
 private State intern = new State("nice","day"); 

.
.
.
}

Regards Facundo

Comment by rich.dic...@gmail.com, Mar 8, 2012

Hi!

I'm getting java.lang.NoClassDefFoundError?: org/apache/velocity/context/Context during the initialization of my READER. Is there another dependency you haven't listed above?

Best Regards, Clark

Comment by alaamu...@gmail.com, Mar 25, 2012

Hi , I'm having a problem running Piriti.

I'm having a problem with XmlReaderGenerator?, I did include the piriti-dev-0.8.jar & piriti-user-0.8.jar also added the other dependencies and the : <inherits name="name.pehl.piriti.xml.XML" /> but still getting error.

This is the error that I'm getting

17:39:31.117 ERROR? [xxxxxxxxx.MainTouch?] Unable to load class 'name.pehl.piriti.rebind.xml.XmlReaderGenerator?' java.lang.ClassNotFoundException?: name.pehl.piriti.rebind.xml.XmlReaderGenerator?

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 sun.misc.Launcher$AppClassLoader?.loadClass(Unknown Source) at java.lang.ClassLoader?.loadClass(Unknown Source) at com.google.gwt.dev.cfg.ModuleDefSchema?$ClassAttrCvt?.convertToArg(ModuleDefSchema?.java:886) at com.google.gwt.dev.util.xml.HandlerArgs?.convertToArg(HandlerArgs?.java:64) at com.google.gwt.dev.util.xml.HandlerMethod?.invokeBegin(HandlerMethod?.java:221) at com.google.gwt.dev.util.xml.ReflectiveParser?$Impl.startElement(ReflectiveParser?.java:294) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(Unknown Source) at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.startElement(Unknown Source) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver?.next(Unknown Source) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source) at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source) at com.google.gwt.dev.util.xml.ReflectiveParser?$Impl.parse(ReflectiveParser?.java:347) at com.google.gwt.dev.util.xml.ReflectiveParser?$Impl.access$200(ReflectiveParser?.java:68) at com.google.gwt.dev.util.xml.ReflectiveParser?.parse(ReflectiveParser?.java:418) at com.google.gwt.dev.cfg.ModuleDefLoader?.nestedLoad(ModuleDefLoader?.java:296) at com.google.gwt.dev.cfg.ModuleDefSchema?$BodySchema?.inherits_begin(ModuleDefSchema?.java:495) at sun.reflect.GeneratedMethodAccessor7?.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl?.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.gwt.dev.util.xml.HandlerMethod?.invokeBegin(HandlerMethod?.java:230) at com.google.gwt.dev.util.xml.ReflectiveParser?$Impl.startElement(ReflectiveParser?.java:294) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(Unknown Source) at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(Unknown Source) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver?.next(Unknown Source) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source) at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source) at com.google.gwt.dev.util.xml.ReflectiveParser?$Impl.parse(ReflectiveParser?.java:347) at com.google.gwt.dev.util.xml.ReflectiveParser?$Impl.access$200(ReflectiveParser?.java:68) at com.google.gwt.dev.util.xml.ReflectiveParser?.parse(ReflectiveParser?.java:418) at com.google.gwt.dev.cfg.ModuleDefLoader?.nestedLoad(ModuleDefLoader?.java:296) at com.google.gwt.dev.cfg.ModuleDefLoader?$1.load(ModuleDefLoader?.java:198) at com.google.gwt.dev.cfg.ModuleDefLoader?.doLoadModule(ModuleDefLoader?.java:324) at com.google.gwt.dev.cfg.ModuleDefLoader?.loadFromClassPath(ModuleDefLoader?.java:156) at com.google.gwt.dev.DevModeBase?.loadModule(DevModeBase?.java:992) at com.google.gwt.dev.DevMode?.loadModule(DevMode?.java:557) at com.google.gwt.dev.DevModeBase?$UiBrowserWidgetHostImpl?.createModuleSpaceHost(DevModeBase?.java:103) at com.google.gwt.dev.shell.OophmSessionHandler?.loadModule(OophmSessionHandler?.java:197) at com.google.gwt.dev.shell.BrowserChannelServer?.processConnection(BrowserChannelServer?.java:525) at com.google.gwt.dev.shell.BrowserChannelServer?.run(BrowserChannelServer?.java:363) at java.lang.Thread.run(Unknown Source)

Comment by wayne.ma...@gmail.com, May 23 (3 days ago)

Above poster: Include the piriti-dev jar also.


Sign in to add a comment
Powered by Google Project Hosting