Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/perl/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
无法将Smartgwt应用程序与mysql数据库远程服务器连接_Mysql_Smartgwt - Fatal编程技术网

无法将Smartgwt应用程序与mysql数据库远程服务器连接

无法将Smartgwt应用程序与mysql数据库远程服务器连接,mysql,smartgwt,Mysql,Smartgwt,我一直在尝试将smartgwt客户端应用程序连接到MySQL服务器。 我已经创建了服务器端实现“mysqlconction” 以及客户端同步和异步接口。 我在我的入口点类中创建了一个RPC对象,但每次我尝试启动它时,我都会发现 Line 13: No source code is available for type java.lang.ClassNotFoundException; did you forget to inherit a required module? Line 13: No

我一直在尝试将smartgwt客户端应用程序连接到MySQL服务器。
我已经创建了服务器端实现“mysqlconction” 以及客户端同步和异步接口。
我在我的入口点类中创建了一个RPC对象,但每次我尝试启动它时,我都会发现

Line 13: No source code is available for type java.lang.ClassNotFoundException; did you forget to inherit a required module?
Line 13: No source code is available for type java.sql.SQLException; did you forget to inherit a required module?
在13号线我有

ArrayList onLoad() throws ClassNotFoundException, SQLException, IOException;
我已经在*.gwt.xml文件和 还包括jar文件

这是我的连接码

public Connection MySQLConnection() {
        try {
            Class.forName("com.mysql.jdbc.Driver");
        } catch (ClassNotFoundException e) {
            
            e.printStackTrace();
            return null;
        }

        Connection connection = null;

        try {
            connection = (Connection) DriverManager.getConnection(url, user, pass);

        } catch (SQLException e) {
            
            e.printStackTrace();
            return null;
        }
    
        return connection;
    }
这是我的*gwt.xml代码

<module rename-to='Abc'>
    <inherits name="com.google.gwt.user.User" />
    <inherits name="com.google.gwt.user.theme.standard.Standard" />
    <inherits name="com.smartgwt.SmartGwt" />
    <entry-point class="com.xyz.client.Abc" />


    <!-- Inherit the default GWT style sheet. You can change -->
    <!-- the theme of your GWT application by uncommenting -->
    <!-- any one of the following lines. -->
    <!-- <inherits name='com.google.gwt.user.theme.standard.Standard'/> -->
    <!-- <inherits name='com.google.gwt.user.theme.chrome.Chrome'/> -->
    <!-- <inherits name='com.google.gwt.user.theme.dark.Dark'/> -->

    <!-- Other module inherits -->
    <!-- <inherits name="com.smartgwt.SmartGwt"/> -->
    <inherits name="com.smartgwt.SmartGwtNoTheme" />
    <inherits name="com.smartclient.theme.enterpriseblue.EnterpriseBlue" />
    <inherits name="com.smartclient.theme.enterpriseblue.EnterpriseBlueResources" />

    <servlet class="com.xyz.server.MySQLConnection" path="/MySQLConnection" />
    <source path='client' />
    <source path='shared' />

    

</module>

出现此问题是因为您必须编写一些代码,这些代码访问
ClassNotFoundException、SQLException、IOException
,这些代码位于客户机文件夹中的类中

此文件夹中的任何类都无法访问每个Java类

您的服务器端逻辑应该写在server文件夹中包含的类中

要了解GWT的项目结构,请查看以下链接:

要了解为什么不能使用客户端包中的每个类,请查看以下链接:


RAS我已经在服务器文件夹中编写了该逻辑。。但是异步接口需要我想要从客户机代码执行的方法声明(在服务器逻辑上)。。问题是我的方法需要抛出异常,所以我必须提到它
void fetchNames(字符串查询,异步回调)抛出SQLException,ClassNotFoundException,IOException是,但即使您导入这些类中的任何一个,GWT也会抱怨。你必须找到另一个选择。
rpc = (DBConnectionAsync) GWT.create(DBConnection.class);