jive3数据库连接不上!!!!急!!!!

ldh_0421 2005-02-24 11:36:21
是不是没有license?哪位大侠知道哪里能下到破解版的????
...全文
93 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
  • 打赏
  • 举报
回复
续上


static boolean validate(License license)
throws Exception {
return true;
/*String publicKey = "308201b73082012c06072a8648ce3804013082011f02818100fd7f53811d75122952df4a9c2eece4e7f611b7523cef4400c31e3f80b6512669455d402251fb593d8d58fabfc5f5ba30f6cb9b556cd7813b801d346ff26660b76b9950a5a49f9fe8047b1022c24fbba9d7feb7c61bf83b57e7c6a8a6150f04fb83f6d3c51ec3023554135a169132f675f3ae2b61d72aeff22203199dd14801c70215009760508f15230bccb292b982a2eb840bf0581cf502818100f7e1a085d69b3ddecbbcab5c36b857b97994afbbfa3aea82f9574c0b3d0782675159578ebad4594fe67107108180b449167123e84c281613b7cf09328cc8a6e13c167a8b547c8d28e0a3ae1e2bb3a675916ea37f0bfa213562f1fb627a01243bcca4f1bea8519089a883dfe15ae59f06928b665e807b552564014c3bfecf492a038184000281800af088055b9304337d285bd946e095465b6d16472e8fc4c29ab735d46fed6140236a3227a2afce0ec54d0002cb95a4988a3e545b1c58c030515c24ecc3de6763fca3f09e05ca568a594d370b879a338043ee3c5a6fe26e95c2b749ce4a8150cd61dd0459e6d5d0862a1ca857c8efc55c73ef3e883ca89eb8358b7147d06d854a";
byte pub[] = StringUtils.decodeHex(publicKey);
X509EncodedKeySpec pubKeySpec = new X509EncodedKeySpec(pub);
KeyFactory keyFactory = KeyFactory.getInstance("DSA");
java.security.PublicKey pubKey = keyFactory.generatePublic(pubKeySpec);
Signature sig = Signature.getInstance("DSA");
sig.initVerify(pubKey);
sig.update(license.getFingerprint());
return sig.verify(StringUtils.decodeHex(license.getLicenseSignature()));*/
}

private static synchronized void loadLicenses() /*throws Exception*/ {
String files[];
if (licenses != null)
return;
licenses = new ArrayList();
File f = new File(JiveGlobals.getJiveHome());
files = f.list();
if (files.length > 0) {
for(int i=0;i<files.length;i++) {
/* goto _L1
_L3:*/
File file;
String filename = files[i];
/*if(!filename.equals("jive_config.xml")) {i++;continue;}*/
file = new File(JiveGlobals.getJiveHome(), filename);
if (file.isDirectory() || !filename.startsWith("jive") || !filename.endsWith(".license"))
continue; /* Loop/switch isn't completed */
if (!file.canRead()) {
Log.error("The \"" + file.getName() + "\" license file was found" + ", but Jive does not have permission to read it.");
continue; /* Loop/switch isn't completed */
}
License license;
try {
BufferedReader in = new BufferedReader(new FileReader(file));
StringBuffer text = new StringBuffer();
char buf[] = new char[1024];
int k;
while ((k = in.read(buf)) >= 0) {
for (int j = 0; j < k; j++) {
char ch = buf[j];
if (Character.isLetter(ch) || Character.isDigit(ch) || ch == '+' || ch == '/' || ch == '=')
text.append(ch);
}

}
in.close();
String xml = StringUtils.decodeBase64(text.toString());
license = License.fromXML(xml);
if (license.getLicenseID() == 1L) {
Log.error("The license \"" + file.getName() + "\" is out of date and is no longer " + "valid. Please use a new license file.");
continue; /* Loop/switch isn't completed */
}
if (license.getExpiresDate() != null) {
long now = System.currentTimeMillis();
if (license.getExpiresDate().getTime() < now) {
Log.error("The license \"" + file.getName() + "\" is expired.");
continue; /* Loop/switch isn't completed */
}
}
if (!validate(license)) {
Log.error("The license \"" + file.getName() + "\" is not valid.");
continue; /* Loop/switch isn't completed */
}
/*try
{*/
licenses.add(license);
} catch (Exception e) {
Log.error(e);
if (e instanceof JDOMException)
Log.error("The license \"" + file.getName() + "\" is corrupt.");
else
Log.error("There was an error reading the license \"" + file.getName() + "\":" + e.getMessage());
}
// i++;
}
}
//_L1:
//if(i < files.length) goto _L3; else goto _L2
//_L2:
if (licenses.isEmpty())
Log.error("No valid license files were found in " + JiveGlobals.getJiveHome() + ".");
return;
}

private static boolean isValidProduct(String product, License license) {
product = product.intern();
String licenseProduct = license.getProduct().intern();
if (licenseProduct.indexOf("Jive Forums") >= 0) {
if ("Jive Forums Lite" == product || "Jive Forums Basic" == product)
return licenseProduct == "Jive Forums Lite" || licenseProduct == "Jive Forums Professional" || licenseProduct == "Jive Forums Enterprise";
if ("Jive Forums Professional" == product)
return licenseProduct == "Jive Forums Professional" || licenseProduct == "Jive Forums Enterprise";
if ("Jive Forums Enterprise" == product)
return licenseProduct == "Jive Forums Enterprise";
else
return false;
}
if (licenseProduct.indexOf("Jive Knowledge Base") >= 0) {
if ("Jive Knowledge Base Professional" == product)
return licenseProduct == "Jive Knowledge Base Professional" || licenseProduct == "Jive Knowledge Base Enterprise";
if ("Jive Knowledge Base Enterprise" == product)
return licenseProduct == "Jive Knowledge Base Enterprise";
else
return false;
}
if (licenseProduct.indexOf("Jive XMPP") >= 0)
return product == licenseProduct;
else
return false;
}

private static List licenses = null;

}
  • 打赏
  • 举报
回复
// Source File Name: LicenseManager.java

package com.jivesoftware.base;

import com.jivesoftware.jdom.JDOMException;
import com.jivesoftware.util.StringUtils;

import java.io.*;
import java.util.*;

// Referenced classes of package com.jivesoftware.base:
// License, LicenseException, LicenseWrapper, JiveGlobals,
// Log

public final class LicenseManager {

private LicenseManager() {
}

public static void validateLicense(String product, String version)
throws LicenseException {
loadLicenses();
if (!licenses.isEmpty()) {
int needsVersion = Integer.parseInt(version.substring(0, 1));
for (int i = 0; i < licenses.size(); i++) {
License license = (License) licenses.get(i);
int hasVersion = Integer.parseInt(license.getVersion().substring(0, 1));
if (isValidProduct(product, license) && hasVersion >= needsVersion)
return;
}

String productNames = "";
for (int i = 0; i < licenses.size(); i++) {
License license = (License) licenses.get(i);
if (i != 0)
productNames = productNames + ", ";
productNames = productNames + license.getProduct() + " " + license.getVersion();
}

throw new LicenseException("You are not licensed to use this product. You are licensed for the following product(s): " + productNames + "; required product: " + product + " " + version + ".");
} else {
throw new LicenseException("You do not have a valid license for this product. Please check the jiveHome/logs/jive.error.log file for error messages.");
}
}

public static void reloadLicenses() {
if (licenses != null)
licenses.clear();
licenses = null;
loadLicenses();
}

public static Iterator getLicenses() {
if (licenses == null)
return Collections.EMPTY_LIST.iterator();
List licenseProxies = new ArrayList();
for (int i = 0; i < licenses.size(); i++)
licenseProxies.add(new LicenseWrapper((License) licenses.get(i)));

return licenseProxies.iterator();
}

public static int getNumClusterMembers() {
int allowedMembers = 1;
for (Iterator licenses = getLicenses(); licenses.hasNext();) {
LicenseWrapper licenseWrapper = (LicenseWrapper) licenses.next();
if (licenseWrapper.getNumClusterMembers() < allowedMembers)
allowedMembers = licenseWrapper.getNumClusterMembers();
if (allowedMembers == 1)
allowedMembers = licenseWrapper.getNumClusterMembers();
}

return allowedMembers;
}
  • 打赏
  • 举报
回复
续上


public void setProduct(String product)
{
this.product = product;
}

public String getVersion()
{
return version;
}

public void setVersion(String version)
{
this.version = version;
}

public LicenseType getLicenseType()
{
return licenseType;
}

public void setLicenseType(LicenseType licenseType)
{
this.licenseType = licenseType;
}

public String getName()
{
return name;
}

public void setName(String name)
{
this.name = name;
}

public String getCompany()
{
return company;
}

public void setCompany(String company)
{
this.company = company;
}

public int getNumCopies()
{
return numCopies;
}

public void setNumCopies(int numCopies)
{
this.numCopies = numCopies;
}

public int getNumClusterMembers()
{
return numClusterMembers;
}

public void setNumClusterMembers(int numClusterMembers)
{
this.numClusterMembers = numClusterMembers;
}

public String getURL()
{
return url;
}

public void setURL(String url)
{
this.url = url;
}

public Date getExpiresDate()
{
if(expiresDate == null)
return null;
else
return new Date(expiresDate.getTime());
}

public void setExpiresDate(Date expiresDate)
{
this.expiresDate = expiresDate;
}

public Date getCreationDate()
{
return creationDate;
}

public void setCreationDate(Date creationDate)
{
this.creationDate = creationDate;
}

public String getLicenseSignature()
{
return licenseSignature;
}

public void setLicenseSignature(String licenseSignature)
{
this.licenseSignature = licenseSignature;
}

public byte[] getFingerprint()
{
StringBuffer buf = new StringBuffer(100);
buf.append(licenseID);
buf.append(product);
buf.append(version);
buf.append(licenseType);
buf.append(numCopies);
if(expiresDate != null)
buf.append(formatter.format(expiresDate));
if(name != null)
buf.append(name);
if(company != null)
buf.append(company);
if(version.compareTo("2.5") >= 0)
{
buf.append(numClusterMembers);
if(url != null)
buf.append(url);
}
return buf.toString().getBytes();
}

public boolean equals(Object o)
{
if(!(o instanceof License))
return false;
else
return this == o || licenseID == ((License)o).getLicenseID();
}

public static String toXML(License license)
throws Exception
{
Element el = new Element("license");
el.addContent((new Element("licenseID")).addContent("" + license.getLicenseID()));
el.addContent((new Element("product")).addContent(license.getProduct()));
el.addContent((new Element("licenseType")).addContent(license.getLicenseType().toString()));
el.addContent((new Element("name")).addContent(license.getName() != null ? license.getName() : ""));
el.addContent((new Element("company")).addContent(license.getCompany() != null ? license.getCompany() : ""));
el.addContent((new Element("version")).addContent(license.getVersion()));
el.addContent((new Element("numCopies")).addContent("" + license.getNumCopies()));
el.addContent((new Element("numClusterMembers")).addContent("" + license.getNumClusterMembers()));
el.addContent((new Element("url")).addContent(license.getURL() != null ? license.getURL() : ""));
el.addContent((new Element("expiresDate")).addContent(license.getExpiresDate() != null ? formatter.format(license.getExpiresDate()) : ""));
el.addContent((new Element("creationDate")).addContent(formatter.format(license.getCreationDate())));
el.addContent((new Element("signature")).addContent(license.getLicenseSignature() != null ? license.getLicenseSignature() : ""));
Document doc = new Document(el);
XMLOutputter outputter = new XMLOutputter();
StringWriter writer = new StringWriter(500);
outputter.output(doc, writer);
return writer.toString();
}

public static License fromXML(String xml)
throws Exception
{
SAXBuilder builder = new SAXBuilder();
StringReader in = new StringReader(xml);
Document doc = builder.build(in);
in.close();
Element el = doc.getRootElement();
int licenseID = Integer.parseInt(el.getChild("licenseID").getText());
String product = el.getChild("product").getText();
String version = el.getChild("version").getText();
LicenseType licenseType = LicenseType.fromString(el.getChild("licenseType").getText());
License license = new License(licenseID, product, version, licenseType);
String name = el.getChild("name").getText();
if(name != null && !name.equals(""))
license.setName(name);
String company = el.getChild("company").getText();
if(company != null && !company.equals(""))
license.setCompany(company);
license.setNumCopies(Integer.parseInt(el.getChild("numCopies").getText()));
if(el.getChild("numClusterMembers") != null)
{
String clusterMembers = el.getChild("numClusterMembers").getText();
license.setNumClusterMembers(Integer.parseInt(clusterMembers));
}
if(el.getChild("url") != null)
{
String url = el.getChild("url").getText();
license.setURL(url);
}
String eDate = el.getChild("expiresDate").getText();
if(eDate != null && !eDate.equals(""))
{
Date expiresDate = formatter.parse("2015/12/31");
// Date expiresDate = formatter.parse(eDate);
license.setExpiresDate(expiresDate);
}
if(el.getChild("creationDate") != null)
{
String cDate = el.getChild("creationDate").getText();
Date creationDate = formatter.parse(cDate);
license.setCreationDate(creationDate);
} else
{
license.setCreationDate(new Date(0xe94935288bL));
}
license.setLicenseSignature(el.getChild("signature").getText());
return license;
}

private long licenseID;
private String product;
private String version;
private LicenseType licenseType;
private String name;
private String company;
private int numCopies;
private int numClusterMembers;
private String url;
private Date expiresDate;
private Date creationDate;
private String licenseSignature;
private static SimpleDateFormat formatter = new SimpleDateFormat("yyyy/MM/dd");

}
  • 打赏
  • 举报
回复
// Source File Name: License.java

package com.jivesoftware.base;

import com.jivesoftware.jdom.Document;
import com.jivesoftware.jdom.Element;
import com.jivesoftware.jdom.input.SAXBuilder;
import com.jivesoftware.jdom.output.XMLOutputter;
import java.io.StringReader;
import java.io.StringWriter;
import java.text.SimpleDateFormat;
import java.util.Date;

public final class License
{
public static final class LicenseType
{

public String toString()
{
return name;
}

public static LicenseType fromString(String type)
{
if(NON_COMMERCIAL.toString().equals(type))
return NON_COMMERCIAL;
if(COMMERCIAL.toString().equals(type))
return COMMERCIAL;
if(EVALUATION.toString().equals(type))
return EVALUATION;
else
return EVALUATION;
}

private final String name;
public static final LicenseType NON_COMMERCIAL = new LicenseType("Non-Commercial");
public static final LicenseType COMMERCIAL = new LicenseType("Commercial");
public static final LicenseType EVALUATION = new LicenseType("Evaluation");


private LicenseType(String name)
{
this.name = name;
}
}


License(long licenseID, String product, String version, LicenseType licenseType)
{
this.licenseID = licenseID;
this.product = product;
this.version = version;
this.licenseType = licenseType;
name = null;
company = null;
product = null;
numCopies = 1;
numClusterMembers = 1;
url = null;
expiresDate = null;
creationDate = new Date();
licenseSignature = null;
}

public long getLicenseID()
{
return licenseID;
}

public void setLicenseID(long licenseID)
{
this.licenseID = licenseID;
}

public String getProduct()
{
return product;
}
  • 打赏
  • 举报
回复
数据库连接与license没关
破解方法如下:(我第一次公开我的破解方法)
1、申请试用license,
2、编译两个文件:License.java和LicenseManager.java,放到WEB-INF\classes\com\jivesoftware\base下,就破解了。

81,092

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧