首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >不能将com.dhtmlx.connector.JSONOptionsConnector转换为com.dhtmlx.connector.OptionsConnector

不能将com.dhtmlx.connector.JSONOptionsConnector转换为com.dhtmlx.connector.OptionsConnector
EN

Stack Overflow用户
提问于 2015-04-16 23:01:23
回答 1查看 97关注 0票数 0

我有这两个tables:gantt_tasks和gantt_links,我成功地将任务添加到第一个表中,但如果我尝试添加链接,则会出现此错误。

代码语言:javascript
复制
java.lang.ClassCastException: com.dhtmlx.connector.JSONOptionsConnector cannot be cast to com.dhtmlx.connector.OptionsConnector

下面是我的页面html和我的servlet Conector:

index.html

代码语言:javascript
复制
<body>
  <div id="idGantt" style="width:100%; height:500px;"></div>
    <script type="text/javascript">

            gantt.config.xml_date = "%Y-%m-%d %H:%i";
            gantt.config.scale_unit = "day";
            gantt.config.duration_unit = "day";
            gantt.config.date_scale = "%d";
            gantt.init("idGantt");
            gantt.load("Conector");
            var dp = new  dataProcessor("Conector");
            dp.init(gantt);
    </script>
</body>

Conector.java

代码语言:javascript
复制
public class Conector extends ThreadSafeConnectorServlet  {

@Override
protected void configure(HttpServletRequest req, HttpServletResponse res) {
   Connection conn = null;
    try {
        Class.forName("com.mysql.jdbc.Driver").newInstance();
        conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/test", "root", "");
    } catch (Throwable e) {
        e.printStackTrace();
    }

    JSONGanttConnector gantt = new JSONGanttConnector(conn, DBType.MySQL);
    gantt.servlet(req, res);

    gantt.mix("open", "1");

 gantt.enable_order("sortorder");
 gantt.render_links("gantt_links", "id", "source,target,type");

 gantt.render_table("gantt_tasks", "id", "start_date,duration,text,progress,sortorder,parent");

}
}

请帮帮忙,谢谢。

EN

回答 1

Stack Overflow用户

发布于 2015-04-18 00:00:56

我从这里的conector.jar下载了更新的connector.jar,它工作得很好。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/29678683

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档