Minute Project First Trial java.net.url nullpointerexception

时间:2014-05-29 07:15:13

标签: jdbc frameworks openxava

我正在尝试使用minuteproject生成openxava文件。我的配置类似于http://minuteproject.wikispaces.com/OpenXava演示文件中的配置。 我得到java.net.url异常。我检查了我的jdbc网址,但找不到错误。这是我对minuteproject的第一次试验。我想学习它非常多,因为我很长时间都在寻找这样的框架(minuteproject + openxava)。感谢您的时间 :) Ferda

我将在此处添加配置文件。我尝试只对一个文件进行逆向工程而不是整个数据库。我的数据库是MS SQL。

<!DOCTYPE root>
<generator-config>
    <configuration>
        <model name="evrak" version="1.0" package-root="veritabani.xxx.org.tr">
            <data-model>
                <dataSource>
                    <driverClassName>com.microsoft.sqlserver.jdbc.SQLServerDriver</driverClassName>
                    <url>jdbc:sqlserver://10.1.x.x:1433;DataBaseName=xxx</url>
                    <username>xx</username>
                    <password>xx</password>
                </dataSource>
                <!-- for Oracle and DB2 please set the schema
                <schema> </schema>
                 -->
                <primaryKeyPolicy oneGlobal="true" oneForEachTable="false">
                    <primaryKeyPolicyPattern prefix="" suffix="" name="sequencePattern" sequenceName="hibernate_sequence"></primaryKeyPolicyPattern>
                    <!-- for autogenerated pk (mysql)
                    <primaryKeyPolicyPattern name="autoincrementPattern" ></primaryKeyPolicyPattern>
                    -->
                </primaryKeyPolicy>
            </data-model>
            <business-model>
                <generation-condition>
                    <condition type="exclude" startsWith="DUAL"></condition>
                    <condition type="exclude" startsWith="ID_GEN"></condition>
            <condition type="include" startsWith="dbo.sekreterya_kisifirma" ></condition>
         <condition type="exclude" startsWith="ID_GEN"></condition>


sekreterya_kisifirma
                </generation-condition>
                <business-package default="veritabani.losev.org.tr">
                </business-package>
            </business-model>
        </model>
        <targets catalog-entry="OpenXava"/>
    </configuration>
</generator-config>

1 个答案:

答案 0 :(得分:0)

没有堆栈跟踪,有点难以调查。

同时,既然你想在mssql数据库上使用带有openxava的minuteproject,我建议你在northwind-db-revisited-with-mp-4-ox跟踪一个样本。

它在着名的Northwind数据库上生成一个openxava应用程序。

总结数据模型访问配置,启发自己

<dataSource>
 <driverClassName>com.microsoft.sqlserver.jdbc.SQLServerDriver</driverClassName>
 <url>jdbc:sqlserver://localhost:1433;databaseName=northwind</url>
 <username>sqlserver</username>
 <password>xxxxxxxx</password>
</dataSource>
<!-- for Oracle and DB2 please set the schema <schema> </schema> -->
<schema>dbo</schema>
<primaryKeyPolicy oneGlobal="true">
 <primaryKeyPolicyPattern name="identityPattern"></primaryKeyPolicyPattern>
</primaryKeyPolicy>

不要忘记将架构节点设置为dbo