Кусок кода в котором вылетает ексепшн: | Код | public DesignTemplate BuildTemplate(int id, StringBuffer str) throws Exception { DesignTemplate dTmpl = new DesignTemplate(id); Rectangle rect = new Rectangle(); String PICTURE = "picture"; String TEXT = "text"; String type; Statement statment = null; String sql = "SELECT apis_bg.id AS bg_id, apis_bg.`bgfile`, "+ "apis_frames.`id` AS t_id, `x` , `y` , "+ "`width`, `height` , apis_frames.`type` "+ "FROM `apis_bg` LEFT JOIN `apis_frames` ON(apis_bg.id = apis_frames.bgid) "+ "WHERE apis_bg.id =" + id; ResultSet rs = null; statment = this.GetConnection().createStatement(); rs = statment.executeQuery(sql); if (rs.next()) { dTmpl.SetBgImagePath("http://photorakurs.net.ru/forum/sources/gallery/images/"+rs.getString("bgfile")); if(rs.getString("t_id") != null){ rect.setBounds(rs.getInt("x"), rs.getInt("y"), rs.getInt("width"), rs.getInt("height")); type = rs.getString("type"); if (type.equals(PICTURE)) { dTmpl.AddImgTmpl(new ImgTmpl(rect)); } else if (type.equals(TEXT)) { dTmpl.AddTextTmpl(new TextTmpl(rect)); } } } while (rs.next()) { rect.setBounds(rs.getInt("x"), rs.getInt("y"), rs.getInt("width"), rs.getInt("height")); type = rs.getString("type"); if (type.equals(PICTURE)) { dTmpl.AddImgTmpl(new ImgTmpl(rect)); } else if (type.equals(TEXT)) { dTmpl.AddTextTmpl(new TextTmpl(rect)); } } if (rs != null) { rs.close(); } if (statment != null) { statment.close(); } return dTmpl; }
|
и соответственно: | Код | package dataclasses.DataClasses;
import java.awt.Dimension; import java.awt.Graphics; import java.awt.Graphics2D; import java.util.*;
import java.io.Serializable; import java.awt.Rectangle; import java.awt.geom.AffineTransform; import java.awt.image.BufferedImage; import javax.swing.JLabel;
/** * <p>Title: Apis </p> * * <p>Description: </p> * * <p>Copyright: Copyright (c) 2006</p> * * <p>Company: </p> * * @author not attributable * @version 1.0 */ public class DesignTemplate implements Serializable{ private ArrayList imgTemplates = new ArrayList(); private ArrayList textTemplates = new ArrayList(); private double PREVIEW_RATIO = 1.0; private String bgImagePath; private int tId; public DesignTemplate(int id) { this.tId = id; } public void AddImgTmpl(ImgTmpl tmpl) { imgTemplates.add(tmpl); } public int GetID() { return this.tId; } public ArrayList GetImgTmpls() { return this.imgTemplates; } public void AddTextTmpl(TextTmpl tmpl){ textTemplates.add(tmpl); } public ArrayList GetTxetTmpls() { return this.textTemplates; } public void SetBgImagePath(String path) { this.bgImagePath = path; } public String GetBgImagePath() { return this.bgImagePath; } public void SetPreviewRatio(double r){ this.PREVIEW_RATIO = r; } protected BufferedImage scaleNewWay(BufferedImage src, double ratio) { BufferedImage dest = new BufferedImage((int) ((double)src.getWidth() * ratio), (int) ((double)src.getWidth() * ratio), BufferedImage.TYPE_INT_RGB); Graphics2D g2d = dest.createGraphics(); AffineTransform at = AffineTransform.getScaleInstance(ratio, ratio); g2d.drawRenderedImage(src, at); g2d.dispose(); return dest; } public static class ImgTmpl implements Serializable{ private Rectangle rect = new Rectangle(); private String imgFileName = null; private int rotation = 0; public ImgTmpl(Rectangle r){ this.rect.setBounds(r); } public Rectangle GetTmplRectanlge() { return this.rect; } public void SetImgFileName(String name) { this.imgFileName = name; } public String GetImgFileName() { return this.imgFileName; } public void SetRotation(int r){ this.rotation = r; } public int GetRotation(){ return this.rotation; } } public static class TextTmpl implements Serializable{ private Rectangle rect = new Rectangle(); private String textImgFileName = null; private String text = null; public TextTmpl(Rectangle r){ this.rect.setBounds(r); } public Rectangle GetTmplRectanlge() { return this.rect; } public String GetTestBuffer() { return this.text; } public void SetText(String str){ this.text = str; } public void SetTextImageFileName(String fName){ this.textImgFileName = fName; } public String GetTextImageFileName(){ return this.textImgFileName; } // public BufferedImage GetTextImage(){ // Dimension d = new Dimension((int)((double)rect.width*DesignTemplate.this.PREVIEW_RATIO), // (int)((double)rect.height*DesignTemplate.this.PREVIEW_RATIO)); // BufferedImage bi = new BufferedImage(d.width,d.height,BufferedImage.TYPE_INT_RGB); // Graphics g = bi.getGraphics(); // // JLabel lbl = new JLabel(this.text); // lbl.setBounds(0,0,d.width,d.height); // lbl.paint(g); // // bi = DesignTemplate.this.scaleNewWay(bi,(1.0/DesignTemplate.this.PREVIEW_RATIO)); // // return bi; // } } }
|
в runtime вылетает следующее: | Код | Без подсветки java.lang.NoSuchMethodError: dataclasses.DataClasses.DesignTemplate$ImgTmpl.<init>(Ljava/awt/Rectangle;)V apisserver.DBMgr.DBMgr.BuildTemplate(DBMgr.java:98)
|
уже два дня бьюсь с этим: - версии менял - не помогло!!! - даже в билдере перекомпелировал - теже яйца! - Томкат пашет правильно, так как все остальные функции пашут нормально. Народ, спасайте!!!!!!!
--------------------
Если долго мучиться, что нибудь получится... 
|