dimanche 25 juin 2017

Can't find target body after run a Jfinal web app with kotlin

IDE:IntelliJ IDEA

I try to run a Jfinal web app which is wrote by Kotlin. And Run with Tomcat Run Configurations Picture

But all the class in the target folder don't have function body.

WebConfig.class in target folder

// IntelliJ API Decompiler stub source generated from a class file
// Implementation of methods is not available

package common

public final class WebConfig public constructor() : com.jfinal.config.JFinalConfig {
    public open fun configConstant(constants: com.jfinal.config.Constants?): kotlin.Unit { /* compiled code */ }

    public open fun configEngine(engine: com.jfinal.template.Engine?): kotlin.Unit { /* compiled code */ }

    public open fun configHandler(handlers: com.jfinal.config.Handlers?): kotlin.Unit { /* compiled code */ }

    public open fun configInterceptor(interceptors: com.jfinal.config.Interceptors?): kotlin.Unit { /* compiled code */ }

    public open fun configPlugin(plugins: com.jfinal.config.Plugins?): kotlin.Unit { /* compiled code */ }

    public open fun configRoute(routes: com.jfinal.config.Routes?): kotlin.Unit { /* compiled code */ }
}

WebConfig.kt in src folder

package common

import api.ApiController
import api.HelloController
import com.jfinal.config.*
import com.jfinal.kit.PropKit
import com.jfinal.plugin.activerecord.ActiveRecordPlugin
import com.jfinal.plugin.activerecord.SqlReporter
import com.jfinal.plugin.druid.DruidPlugin
import com.jfinal.template.Engine
import model._MappingKit

/**
 * Created by tjliqy on 2017/6/23.
 */
class WebConfig : JFinalConfig() {


    override fun configConstant(constants: Constants?) {
        PropKit.use("common.properties")
    }

    override fun configRoute(routes: Routes?) {
//        routes.add(ApiRoutes())
        routes?.add("/api",ApiController::class.java)
        routes?.add("/", HelloController::class.java)
    }

    override fun configEngine(engine: Engine?) {

    }

    override fun configPlugin(plugins: Plugins?) {
        val druidPlugin = DruidPlugin(PropKit.get("jdbcUrl"), PropKit.get("user"), PropKit.get("password").trim())
        plugins?.add(druidPlugin)

        val activeRecordPlugin = ActiveRecordPlugin(druidPlugin)
        activeRecordPlugin.setShowSql(true)
        SqlReporter.setLog(true)

        _MappingKit.mapping(activeRecordPlugin)
        plugins?.add(activeRecordPlugin)
    }

    override fun configInterceptor(interceptors: Interceptors?) {

    }

    override fun configHandler(handlers: Handlers?) {

    }
}

How to fix this?




Aucun commentaire:

Enregistrer un commentaire