---
title: "JIRA的安装，破解和sql server数据库配置"
author: "yanfei133"
date: "2010-02-02T23:09:16Z"
tags: ["JDBC", "SQL", "SQL Server", "Web", "XML"]
categories: ["编程语言"]
slug: "jira-sql-server"
draft: false
lastmod: "2010-02-02T23:14:27Z"
id: 586145
url: "https://yanfei133.iteye.com/blog/586145"
---

JIRA的安装，破解和sql server数据库配置

忙活了将近一天终于配置好了JIRA3.13的安装和配置。下边介绍一下在安装配置过程中碰到的一些问题和解决的方法：

1：如何使用keygen.class文件

      在下载的带破解文件的压缩包中有一个keygen.class文件，这个文件就是JIRA的注册机，在配置的java运行环境和jdk环境下，在命令行中运行java keygen.class就可以进行注册并生成需要的注册文件。但是请注意要配置好classpath环境变量，否则要出错。

2：java keygen的时候提示找不到相关的类包的解决方法

      注册机运行需要的com.atlassian.license package在atlassian-extras-0.7.20.jar中，所以运行的时候要保证能够找到这个类包，最简单的方法就是吧 keygen.class放在这个jar文件相同的目录，然后解压这个jar包到当前目录，然后运行就可以了。

3：如果配置 ms sql server2005为JIRA的数据库（来源于http://bbs.51testing.com/archiver/tid-22739.html）

     由于JIRA自带的数据库不够稳定，所以需要配置其他数据库，我使用的是sql server 2005, 配置方法如下：

        1)安装MS SQLServer2005数据库  
        2)安装过程要自定义,选择chinese\_RPC排序方式,语言为simple chinese; 身份验证选择混合模式;  
   
       4)编辑conf/server.xml 文件，将&lt;Context ... .../&gt;中的内容,修改为:  
&lt;Context path="" docBase="${catalina.home}/atlassian-jira" reloadable="false"&gt;  
&lt;Resource name="jdbc/JiraDS" auth="Container" type="javax.sql.DataSource"  
username="sa"  
password="sa"  
driverClassName="net.sourceforge.jtds.jdbc.Driver"  
url="jdbc:jtds:sqlserver://localhost:1433/jira\_db" /&gt;  
      5)编辑 atlassian-jira/WEB-INF/classes/entityengine.xml文件, 修改field-type-name 的属性值为mssql(field-type-name="mssql"),  
&lt;datasource name="defaultDS" field-type-name="mssql"  
      schema-name="dbo";注意schema-name ，架构要选对，表明表创建在哪个架构下  
(官方文档：  
Configure the JIRA Entity Engine  
1.    Edit the JIRA Entity Engine configuration file and change the field-type-name attribute to  mssql .  
o    If you are using JIRA Standalone, the JIRA Entity Engine configuration file that you need to edit is  atlassian-jira/WEB-INF/classes/entityengine.xml .  
o    If you are using JIRA WAR/EAR, the JIRA Entity Engine configuration file that you need to edit is  edit-webapp/WEB-INF/classes/entityengine.xml . If you forget to do to make this change and start JIRA, it may create database tables incorrectly. See this page if this happens to you.  
2.    Change  schema-name="PUBLIC"   to the name of the schema associated with the database (i.e. the schema you created in step 1.3 above), e.g.  schema-name="jiraschema" . Note that the schema must exist in the database before you perform this step.  
01.&lt;!-- DATASOURCE - You will need to update this tag for your installation.  
02\.  
03.--&gt;  
04.  &lt;datasource name="defaultDS" field-type-name="mssql"  
05.      schema-name="jiraschema"  
06.      helper-class="org.ofbiz.core.entity.GenericHelperDAO"  
07.    check-on-start="true"  
08.    use-foreign-keys="false"  
09.    ...  
)  
      6)下载连接MS SQLServer数据库的JDBC Driver,推荐使用JTDS(\[url]http://jtds.sourceforge.net/)\[/url],将 jtds-\[version].jar文件拷贝到common\\lib目录下;  
       7)运行bin目录下的startup.bat,启动JIRA;