http://dev2dev.bea.com.cn/bbs/index.jspa

解决方案 »

  1.   

    http://dev2dev.bea.com.cn/resourcecenter/index.jsp
      

  2.   

    import javax.imageio.ImageIO;
    import java.awt.image.BufferedImage;
    import java.awt.image.ColorModel;
    import java.awt.image.WritableRaster;
    import java.awt.*;
    import java.awt.geom.AffineTransform;
    import java.io.InputStream;
    import java.io.File;
    import java.io.FileOutputStream;public class test {
        public static BufferedImage resize(BufferedImage source, int targetW, int targetH) {
               // targetW,targetH分别表示目标长和宽
                int type = source.getType();
                BufferedImage target = null;
                double sx = (double) targetW / source.getWidth();
                double sy = (double) targetH / source.getHeight();
                //这里想实现在targetW,targetH范围内实现等比缩放。如果不需要等比缩放
                      //则将下面的if else语句注释即可
                if(sx>sy)
                {
                    sx = sy;
                    targetW = (int)(sx * source.getWidth());
                }else{
                    sy = sx;
                    targetH = (int)(sy * source.getHeight());
                }
                if (type == BufferedImage.TYPE_CUSTOM) { //handmade
                    ColorModel cm = source.getColorModel();
                    WritableRaster raster = cm.createCompatibleWritableRaster(targetW, targetH);
                    boolean alphaPremultiplied = cm.isAlphaPremultiplied();
                    target = new BufferedImage(cm, raster, alphaPremultiplied, null);
                } else
                 target = new BufferedImage(targetW, targetH, type);
                Graphics2D g = target.createGraphics();
                //smoother than exlax:
                g.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY );
                g.drawRenderedImage(source, AffineTransform.getScaleInstance(sx, sy));
                g.dispose();
                return target;
            }
        public static void saveImageAsJpg (String fromFileStr,String saveToFileStr,int width,int hight)
                    throws Exception {
                BufferedImage srcImage;
                File saveFile=new File(saveToFileStr);
                File fromFile=new File(fromFileStr);
                srcImage = ImageIO.read(fromFile);
                if(width > 0 || hight > 0)
                {
                     srcImage = resize(srcImage, width, hight);
                }
                ImageIO.write(srcImage, "JPEG", saveFile);        }
        public static void main (String argv[]) {
            System.err.println("xxxxxx");
            try{
                //参数1(from),参数2(to),参数3(宽),参数4(高)
                  test.saveImageAsJpg("c:/2.jpg","c:/3.jpg",400,400);
            }  catch(Exception e)
            {
                e.printStackTrace();
            }    }
    }
    这是我新找的一个供大家分享!呵呵!看看有没有更高的
      

  3.   

    http://www.idcdream.net/archive_48074.html
      

  4.   

    去bea官方网站
    还有这个
    http://bbs.chinajavaworld.com/
      

  5.   

    1 日常管理
    1.1 WebLogic Platform 8.1 永不过期的开发版license
    下载地址为:
    http://dev2dev.bea.com.cn/bbs/servlet/D2DServlet/download/81-8992-44196-240/license.bea使用方式:
    替换c:\bea目录下的这个文件,这样就可以使WebLogic Platform用不过期原文地址:
    http://dev2dev.bea.com.cn/bbs/thread.jspa?forumID=81&threadID=8992&tstart=0&quint=true
    1.2 如何远程启动WebLogic服务?
    用telnet远程控制服务器, 远程启动WEBLOGIC服务,启动后关闭telnet,WebLogic服务也跟着停止,这是因为使用telnet启动的进程会随着telnet进程的关闭而关闭。所以我们可以使用一些UNIX下的命令来做到不关闭。使用如下命令:
    nohup startWeblogic.sh&如果想要监控标准输出可以使用:
    tail -f nohup.out原文地址:
    http://dev2dev.bea.com.cn/bbs/thread.jspa?forumID=81&threadID=7709&tstart=0&quint=true1.3 控制台左边的树结构看不见?
    这是因为浏览器没有安装合适版本的JRE插件来支持Applet。
    可以到http://java.sun.com/products/plugin/ 下载相应浏览器的插件来解决这个问题。原文地址:
    http://dev2dev.bea.com.cn/bbs/thread.jspa?forumID=81&threadID=5233&tstart=0&quint=true
    1.4 WebLogic 配置出来的各种域有什么区别?
    请看这个链接中的Table 16-1 Configuration Template Summary ,说的很明白
    http://e-docs.bea.com/platform/docs81/confgwiz/tempref.html
    Table 16-1 Configuration Template Summary 
    Template Required WebLogic Platform Component Filename Description
    Avitek Medical Records Sample Domain WebLogic Server medrec.jar Creates the Avitek Medical Records domain outside the installed kit. This domain is a WebLogic Server sample application suite that concisely demonstrates all aspects of the J2EE platform.
    Basic WebLogic Integration Domain WebLogic Integration,WebLogic Workshop,WebLogic Server wli.jar Creates a domain that supports the development of WebLogic Integration solutions.Note: To create a domain that supports the development of WebLogic Server Process Edition solutions, use the Basic WebLogic Integration Domain template. If you have an existing WebLogic Server-based domain, you can extend it to include the resources required for WebLogic Server Process Edition by using the WebLogic Integration Extension Template.
    Basic WebLogic Platform Domain WebLogic Platform (all components must be installed) platform.jar Creates a domain that supports the development of applications using all WebLogic Platform components.
    Basic WebLogic Portal Domain WebLogic Portal,WebLogic Workshop,WebLogic Server wlp.jar Creates a domain that supports the development of WebLogic Portal solutions.
    Basic WebLogic Server Domain WebLogic Server wls.jar Creates a simple WebLogic Server domain without any sample applications.
    Basic WebLogic Workshop Domain WebLogic Workshop,WebLogic Server wlw.jar Creates a domain that supports the development of WebLogic Workshop solutions.
    WebLogic Server Examples Domain WebLogic Server examples.jar Creates the WebLogic Server Examples domain outside the installed kit. This domain contains a collection of examples that illustrate best practices for coding individual J2EE APIs.  
    原文地址:
    http://dev2dev.bea.com.cn/bbs/thread.jspa?forumID=81&threadID=9188&tstart=0&quint=true1.5 Too many open files错误的处理
    在有些Linux下由于操作系统的限制,单一进程可以打开的文件数有限制,引起WebLogic报告错误,解决这问题需要编译内核并且调节一些限制参数。在Linux内核2.4.x中需要修改源代码,然后重新编译内核才生效。编辑Linux内核源代码中的 include/linux/fs.h文件,将 NR_FILE 由8192改为65536,将NR_RESERVED_FILES 由10 改为 128。编辑fs/inode.c 文件将MAX_INODE 由16384改为262144。一般情况下,系统最大打开文件数比较合理的设置为每4M物理内存256,比如256M内存可以设为16384,而最大的使用的i节点的数目应该是最大打开文件数目的3倍到4倍。另外,对每个进程的设置:
    ulimit -n 4096 将每个进程可以打开的文件数目加大到4096,缺省为1024
    ulimit -m 4096 限制每个进程使用的内存数。原文地址:
    http://dev2dev.bea.com.cn/bbs/thread.jspa?forumID=81&threadID=2461&tstart=0&quint=true1.6 Apache2和weblogic7实现虚拟主机
    选择apache2,是因为目前wls7只支持apache2的结合.1.首先,正确安装apache2,这里我们假设安装在C:\apache group,安装完毕,需要测试apache2是否支持动态加载模块功能,这样测试,到命令提示符下运行:
       c:\>apache group\apache2\bin\apache -l
    如果列出:
      mod_so.c
    则表示支持,然后将本篇文章附件中的mod_wl_20.so拷贝到apache group\apache2\modules下面,运行:
       c:\>apache group\apache2\bin\apache -t
    如果输出:
      Syntax Ok
    表示WebLogic Server plug-in安装成功。2.正确安装weblogic7.0。这里我们假设wls7的安装路径是:c:\bea。然后用域配置向导配置一个域,我们假设域
    的名称为amjn,路径是c:\bea\user_projects\amjn,然后在amjn下面分别建立两个站点web1,web2,修改c:\bea\user_projects\amjn\config.xml文件,在
        <Application Deployed="true" Name="DefaultWebApp"
            Path=".\applications" StagedTargets="" TwoPhase="false">
            <WebAppComponent Name="DefaultWebApp" Targets="myserver" URI="DefaultWebApp"/>
        </Application>
    下面添加:
        <Application Deployed="true" Name="web1" Path=".\applications\web1"
            StagedTargets="" TwoPhase="false">
            <WebAppComponent Name="web1" URI="web1" VirtualHosts="web1_vh"/>
        </Application>
        <Application Deployed="true" Name="web2" Path=".\applications\web2"
            StagedTargets="" TwoPhase="false">
            <WebAppComponent Name="web2" Targets="myserver" URI="web2" VirtualHosts="web2_vh"/>
        </Application>
    在文件最下面的
    </Domain>
    的上面添加
        <VirtualHost DefaultWebApp="web1" Name="web1_vh" Targets="myserver" VirtualHostNames="www.web1.com"/>
        <VirtualHost DefaultWebApp="web2" Name="web2_vh" Targets="myserver" VirtualHostNames="www.web2.com"/>
    ,然后重新启动运行\amjn\startWebLogic.cmd,一定要运行正常。到这里,weblogic算是配置完成了。3.现在开始配置apache多个虚拟主机,首先我们先打开c:\winnt\system32\drivers\etc\hosts文件,在其中添加:
    10.1.3.30 www.web1.com
    10.1.3.30 www.web2.com
    这里面的10.1.3.30是你的weblogic服务器绑定的ip,然后打开apache2\conf\httpd.conf文件,在174行,注意是174行加入如下语句:
    #WebLogic Server Proxy Settings  -------该行是174行
    LoadModule weblogic_module modules/mod_wl_20.so
    <IfModule mod_weblogic.c>
    WebLogicHost www.synnex-china.com
    WebLogicPort 7001
    MatchExpression *.jsp
    MatchExpression *.do
    </IfModule>
    然后修改httpd.conf文件中的Listen:80为Listen:10.1.3.30:80,在文件section 3部分添加:
    NameVirtualHost 10.1.3.30
    <VirtualHost 10.1.3.30>
    ServerName www.web1.com
    DocumentRoot "c:/bea/user_projects/amjn/applications/web1"
    ErrorLog logs/web1.com.log
    </VirtualHost><VirtualHost 10.1.3.30>
    ServerName www.web2.com
    DocumentRoot "c:/bea/user_projects/amjn/applications/web2"
    ErrorLog logs/web2.com.log
    </VirtualHost>
    启动apache,如果没有问题(可以通过logs/error.log查看),那就一切ok了4.现在你可以分别敲入www.web1.com/index.jsp,访问的将是web1/index.jsp,敲入www.web2.com/index.jsp访问的将是web2/index.jsp原文地址:
    http://dev2dev.bea.com.cn/bbs/thread.jspa?forumID=81&threadID=6326&tstart=0&quint=true
      

  6.   

    1.7 如何限制公网用户访问WebLogic的控制台呢?
    我们的weblogic(版本6.1)应用部署在内部网上,通过防火墙映射到公网上,但公网用户通过键入域名:www.xxx.com/console,就可进入weblogic的登陆页面,用户可猜测管理员的密码,如何屏蔽公网用户对weblogic控制台的访问呢?方法1:
    在控制台上点击左边的你那个domain,将Console Enabled这个选项去掉,这样就完全不能使用console了
    方法2:
    将“console”改名,改“Console Context Path”的“console”为一个希奇古怪的名字就可以了
    方法3:
    不要给WebLogic公网ip,通过一个有公网ip的apache等proxy来访问WebLogic
    方法4:
    启动Administration Port
    方法5:
    应用不发布在Admin Server上,Admin Serve在外网不可见原文地址:
    http://dev2dev.bea.com.cn/bbs/thread.jspa?forumID=81&threadID=22301.8 开机自动启动oracle和weblogic
    我的机器是5L,oracle9i,weblogic6.1,HTTPServer
    由于给别人装的机器,对方水平有限,为了省心,还是让系统起来自动运行各项应用比较好:)
    首先自动启动oracle9i,9i装在oracle文件系统下,在/oracle下建立文件startdb,
    文件内容
    echo "begin to start oracle"
    lsnrctl start
    sqlplus /nolog <<EOF
    connect /as sysdba
    startup
    exit
    exit
    echo "oracle have started"
    给startdb执行权限
    自动关闭oracle9i,在/oracle下建立文件stopdb
    sqlplus /nolog <<EOF
    connect /as sysdba
    shutdown immediate
    好了启动和关闭oracle脚本完成还要加到系统的启动和关闭文件里,另外还要在启动oracle后启动weblogic
    在/etc下建立文件rc.startdb,脚本如下su - oracle "-c /oracle/startdb"    #启动oracle 
    cd /weblogic/wlserver6.1/config/mydomain  #转到weblogic启动目录,必须
    ./startWebLogic.sh  #启动weblogic
    给文件执行权限
    注 意由于weblogic在启动后如果用户退出telnet 就自动关闭,所以要把weblogic放在后台执行,所以在startWebLogic.sh文件中启动weblogic的命令行改为可以在后台运行,用 nohup (启动命令行) >/home/weblogic.log &
    把weblogic的运行信息存到/home/weblogic.log文件中下面要把启动信息放到inittab中,加入一行
    startdb:2345678:wait:/etc/rc.startdb
    这样系统启动后会自动启动oracle9i
    系统关机自动关闭oracle9i
    在/etc下建立脚本文件rc.stopdb
    su - oracle "-c /oracle/stopdb"
    给执行权限
    由于5L中安装完成后没有/etc/rc.shutdown文件,需要手工创建一个
    内容如下
    #!/bin/ksh  
    rc.stopdb
    给执行权限
    这样当系统关机时会自动寻找rc.shutdown并执行,系统可以自动关闭oracle9i当然可以把一些命令行直接写入inittab或rc.shutdown中,看自己的喜好了:)原文地址:
    http://dev2dev.bea.com.cn/bbs/thread.jspa?forumID=81&threadID=8415&tstart=25&quint=true
    1.9 如何测试虚拟主机
    在本机配置了虚拟主机,没有DNS Server,如何进行测试呢?
    C:\WINNT\system32\drivers\etc\hosts加入一行:127.0.0.1 test.project.com.cn原文地址:
    http://dev2dev.bea.com.cn/bbs/thread.jspa?forumID=81&threadID=9776&tstart=25&quint=true1.10 WebLogic的Startup Class应该放在那个目录里
    WebLogic在启动的时候可以指定Startup Class,它在任何一个应用的类被加载之前调用,所以应该加到启动时的系统类路径下,可以修改startWebLogic.cmd或commEnv.cmd文件相应的CLASSPATH部分,加入Startup Class的类路径。原文地址:
    http://dev2dev.bea.com.cn/bbs/thread.jspa?forumID=81&threadID=9119&tstart=25&quint=true1.11 如何停止WebLogic服务?
    直接杀死进程不是标准的做法,应该使用如下Java命令:
    java -classpath weblogic.jar;%CLASSPATH% weblogic.Admin -url <host_name>:<port_number> SHUTDOWN -username <system_user_name> -password <system_user_password>
    例如:
    java -classpath weblogic.jar;%CLASSPATH% weblogic.Admin -url 192.168.0.1:7001
    SHUTDOWN -username system -password password
    其中如果SHUTDOWN管不掉,可以使用FORCESHUTDOWN代替SHUTDOWN来强制关掉服务器。另外也可以直接使用stopWebLogic.cmd。原文地址:
    http://dev2dev.bea.com.cn/bbs/thread.jspa?forumID=81&threadID=5519&tstart=25&quint=true