<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    Chan Chen Coding...

    Add morphia into Play 2.0

    There are two ways of adding morphia jar file into play 2.0.
    Demo source code can be found at: https://github.com/czihong/playMongoDemo

    1. Unmanaged dependencies 
    1.1 download morphia jar file from http://code.google.com/p/morphia/downloads/list
    1.2 save morphia-0.99.jar into your {playProjectDIr}/lib
    1.3 add this jar file to your project classpath

    2. Managed Dependencies
    Modified the Build.scala file
    import sbt._
    import Keys._
    import PlayProject._

    object ApplicationBuild extends Build {

        val appName         = "stdtlk"
        val appVersion      = "1.0-SNAPSHOT"

        val appDependencies = Seq(
                // Add your project dependencies here,
            "com.google.code.morphia" % "morphia" % "0.99"
        )

        val main = PlayProject(appName, appVersion, appDependencies, mainLang = JAVA).settings(
                // Add your own project settings here    
                resolvers += "Maven repository" at "http://morphia.googlecode.com/svn/mavenrepo/"
        )
    }

    Some Exception may Occur
    FactoryBean threw exception on object creation; nested exception is java.lang.IllegalArgumentException: can't parse argument number: interface com.google.code.morphia.annotations.Id=@com.google.code.morphia.annotations.Id():
    java.lang.IllegalArgumentException: can't parse argument number: interface com.google.code.morphia.annotations.Id=@com.google.code.morphia.annotations.Id()
        at java.text.MessageFormat.makeFormat(MessageFormat.java:1356)
        at java.text.MessageFormat.applyPattern(MessageFormat.java:475)
        at java.text.MessageFormat.<init>(MessageFormat.java:367)
        at java.text.MessageFormat.format(MessageFormat.java:828)
        at org.slf4j.bridge.SLF4JBridgeHandler.getMessageI18N(SLF4JBridgeHandler.java:233)
        at org.slf4j.bridge.SLF4JBridgeHandler.callLocationAwareLogger(SLF4JBridgeHandler.java:191)
        at org.slf4j.bridge.SLF4JBridgeHandler.publish(SLF4JBridgeHandler.java:267)
        at java.util.logging.Logger.log(Logger.java:498)
        at java.util.logging.Logger.doLog(Logger.java:520)
        at java.util.logging.Logger.logp(Logger.java:689)
        at com.google.code.morphia.logging.jdk.JDKLogger.log(JDKLogger.java:107)
        at com.google.code.morphia.logging.jdk.JDKLogger.debug(JDKLogger.java:38)
        at com.google.code.morphia.mapping.MappedClass.<init>(MappedClass.java:113)
        at com.google.code.morphia.mapping.Mapper.addMappedClass(Mapper.java:141)
        at com.google.code.morphia.Morphia.map(Morphia.java:55)
        at com.google.code.morphia.Morphia$map.call(Unknown Source)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
        at com.bakersoftware.providerIntegrator.domain.DbFactoryBean.getObject(DbFactoryBean.groovy:22)

    Comment 1 by br@nesbot.com, Nov 26, 2011
    I saw this error occur as well.  I am using Scala but the same error occured at the same location.  I see you have included the slf4j library in your classpath.

    Did you take a look at http://code.google.com/p/morphia/wiki/SLF4JExtension ?
    You need to include the extension in your classpath and then ensure you call the following code at start-up to register the logger extension and the error disappears.  You can put it in a static {} block if you prefer.

    For the explain, see the build system of play 2.0 document.
    refer to: https://github.com/playframework/Play20/wiki/SBTDependencies

    -----------------------------------------------------
    Silence, the way to avoid many problems;
    Smile, the way to solve many problems;

    posted on 2012-04-11 22:23 Chan Chen 閱讀(670) 評論(0)  編輯  收藏 所屬分類: Play Framework 2.0


    只有注冊用戶登錄后才能發表評論。


    網站導航:
     
    主站蜘蛛池模板: 伊人婷婷综合缴情亚洲五月| 亚洲高清视频在线观看| 国产成人无码精品久久久免费 | 美女视频黄a视频全免费| 亚洲youwu永久无码精品| 亚洲码国产精品高潮在线| 青青视频观看免费99| 又大又硬又粗又黄的视频免费看| 亚洲AV日韩AV永久无码下载| 最近免费中文字幕大全| a级毛片免费播放| 亚洲av日韩aⅴ无码色老头| 亚洲A∨无码一区二区三区| 永久黄网站色视频免费观看| 久操视频免费观看| 免费播放美女一级毛片| 自怕偷自怕亚洲精品| 日韩亚洲国产综合久久久| 麻花传媒剧在线mv免费观看| 一级中文字幕免费乱码专区| 亚洲avav天堂av在线网爱情| 国产偷v国产偷v亚洲高清| 国产又大又粗又硬又长免费| 真实国产乱子伦精品免费| 乱淫片免费影院观看| 亚洲午夜精品久久久久久app | 国产成A人亚洲精V品无码| 在线A级毛片无码免费真人| 99re6免费视频| 亚洲综合av一区二区三区不卡 | 黄色网址免费观看| 岛国精品一区免费视频在线观看| 一本色道久久88—综合亚洲精品 | 亚洲一区二区三区免费观看| 亚洲开心婷婷中文字幕| 免费在线不卡视频| 成年女人午夜毛片免费看| 99精品视频在线视频免费观看| 一级免费黄色大片| 国产亚洲情侣久久精品| 中国亚洲呦女专区|