vendredi 17 avril 2015

com.dhtmlx.connector.JSONOptionsConnector cannot be cast to com.dhtmlx.connector.OptionsConnector

I have these two tables:gantt_tasks and gantt_links, I succeed to add tasks to the first table but I had this error if I try to add a link.



java.lang.ClassCastException: com.dhtmlx.connector.JSONOptionsConnector cannot be cast to com.dhtmlx.connector.OptionsConnector


Here my page html and my servlet Conector :


index.html



<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



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");

}
}


Help please, thanks.


Aucun commentaire:

Enregistrer un commentaire