小编bal*_*208的帖子

取消部署Tomcat Web应用程序时如何防止文件锁定?

我在tomcat 7中使用管理器应用程序,我无法完全取消部署应用程序.

它说 FAIL - Unable to delete [F:\apache-tomcat-7.0.33\webapps\balaji]. The continued presence of this file may cause problems.

我读到它的某处是因为一些称为内存泄漏的现象,如果我们修复它,问题就会得到解决.

任何人都可以告诉我tomcat 7中的内存泄漏是什么,我们如何解决?我正在使用Windows 7操作系统.如果我能够解决它,我的非部署和重新部署过程将顺利进行吗?

tomcat memory-leaks file-locking tomcat7 undeploy

65
推荐指数
2
解决办法
5万
查看次数

什么是<required>和<rtexprvalue>用于?

我正在研究自定义标记库,我很困惑如何在TLD文件中使用<required><rtexprvalue>标记来定义自定义标记属性.

  1. 这些标签是什么?
  2. 我们应该在他们之间写什么?
  3. 写这些标签后我们会得到什么样的行为?

java jsp taglib custom-tag

42
推荐指数
2
解决办法
4万
查看次数

Hibernate Mapping Exception:实体映射中的重复列

特定实体存在映射异常.无法从问题出现的地方找出答案.我从头到尾检查了所有映射3次.我仍然得到映射异常.

发送给员工的电子邮件只映射一次.但它仍然报告错误重复映射

错误是:

Caused by: org.hibernate.MappingException: Repeated column in mapping for entity: com.cluster.entity.Email column: EMPLOYEE_ID (should be mapped with insert="false" update="false")
    at org.hibernate.mapping.PersistentClass.checkColumnDuplication(PersistentClass.java:680)
    at org.hibernate.mapping.PersistentClass.checkPropertyColumnDuplication(PersistentClass.java:702)
    at org.hibernate.mapping.PersistentClass.checkColumnDuplication(PersistentClass.java:724)
    at org.hibernate.mapping.PersistentClass.validate(PersistentClass.java:477)
    at org.hibernate.mapping.RootClass.validate(RootClass.java:268)
    at org.hibernate.cfg.Configuration.validate(Configuration.java:1287)
    at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1729)
    at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1775)
    at com.cluster.util.HibernateUtil.<clinit>(HibernateUtil.java:16)
    ... 1 more
Run Code Online (Sandbox Code Playgroud)

电子邮件Pojo

package com.cluster.entity;

public class Email {

    private int intEmailID;
    private String strEmailName;

    //many to one
    private EmailType emailType;

    //many to one
    private Employee employee;

    public int getIntEmailID() {
        return intEmailID;
    }

    public void setIntEmailID(int intEmailID) {
        this.intEmailID …
Run Code Online (Sandbox Code Playgroud)

orm persistence hibernate hibernate-mapping java-ee

11
推荐指数
2
解决办法
4万
查看次数

MongoDB到Java的集成

我们正在尝试将旧的Oracle sql应用程序转换为NO-SQL,我们选择了Mongo DB.

像Hibernate这样的Mongo DB是否有ORM支持可以减少我们的编码?

我们可以使用JPA规范为Mongo DB构建应用程序吗?

如果JPA,哪个ORM供应商最好选择,为什么?

他们为Mongo DB提出了无sql方言,以便我们可以使用非关系数据库构建应用程序吗?

hibernate jpa mongodb nosql hibernate-ogm

9
推荐指数
2
解决办法
8218
查看次数

如何以及在何处为Hibernate添加JNDI?

我需要代码将JNDI名称添加到hibernate中的连接池中.我已经在Jboss服务器中配置了连接池,其JNDI名称为"EmployeeDB"

如何在hibernate.cfg.xml中配置它?

如果我正在使用Hibernate 4 Final版本,Plez会给我hibernate.cfg.xml的代码.

hibernate jndi connection-pooling

8
推荐指数
1
解决办法
1万
查看次数

Eclipse中的控制台打印顺序

我在Eclipse中输入了一个简单的算术程序.在Eclipse中运行程序时,每次运行时输出都会以奇怪的顺序出现.有时异常出现在最后的print语句中(这是正确的方法).有时它会在混乱的顺序中反过来.为什么会发生这种情况以及如何纠正它?是否有任何设置可以在每次执行时以正确的方式打印.以下屏幕截图显示了它的显示方式.请帮我纠正这个问题.

正确的顺序: 运行时更正订单

我们运行几次后错误的订单 订单不正确

 package com;

    public class Abc {

        /**
         * @param args
         */
        public static void main(String[] args) {

            System.out.println("begin main");
            // TODO Auto-generated method stub
            int a = 10;
            int b = 0;
            int c = 0;


            System.out.println("value of a BD is " + a);
            System.out.println("value of b BD is " + b);
            System.out.println("value of c BD is " + c);

            c = a/b; //Arthmetic Exception

            System.out.println("value of a AD is " + a);
            System.out.println("value of b AD …
Run Code Online (Sandbox Code Playgroud)

java eclipse exception eclipse-juno

5
推荐指数
2
解决办法
1678
查看次数

使用CSS在我的<div>元素中填充背景颜色

我根据需要创建了一个<div>标签css表.但我在一个特定的地方受到了打击.我需要在<div>元素中填充背景颜色.使用哪个属性?

我的代码如下:

<htmL>

<head>
    <style>

        div.table{
            display: table;
        }
        div.row{
             display: table-row;
            border-style:solid;
            border-color: black;
            border-width:15px;
            padding-top:35px;
            padding-bottom:35px;
            padding-right:50px;
            padding-left:50px;
            margin-top:25px;
            margin-bottom:25px;
            margin-right:50px;
            margin-left:50px;
        }


        div.cell{
            display: table-cell;
            border-style: solid;
            border-width:15px;
            padding-left: 30px;
            padding-right: 30px;
            padding-top: 30px;
            padding-bottom: 30px;
            font-weight:5000;
            font-size:200%;


        }

    </style>
</head>
<body>
    <div id="table" class="table">

        <div id="r1" class="row">
            <div id="sys55" class="cell">55
            </div>
            <div id="sys56" class="cell">56
            </div>
            <div id="sys57" class="cell">57
            </div>
            <div id="sys58" class="cell">58
            </div>
            <div id="sys59" class="cell">59
            </div>
            <div id="sys60" class="cell">60
            </div>
            <div …
Run Code Online (Sandbox Code Playgroud)

html css

5
推荐指数
1
解决办法
5万
查看次数

删除mule中的favicon.ico请求

我正在使用mule studio,我正在尝试它的例子.

当我做HTTP浏览器请求时,同时发出2个请求,其中第一个是/favicon.ico,第二个请求是实际请求.

我的配置XML如下.

<?xml version="1.0" encoding="UTF-8"?>

<mule xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:file="http://www.mulesoft.org/schema/mule/file" xmlns:jms="http://www.mulesoft.org/schema/mule/jms" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:spring="http://www.springframework.org/schema/beans" xmlns:core="http://www.mulesoft.org/schema/mule/core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="CE-3.2.1" xsi:schemaLocation="
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd 
http://www.mulesoft.org/schema/mule/file http://www.mulesoft.org/schema/mule/file/current/mule-file.xsd 
http://www.mulesoft.org/schema/mule/jms http://www.mulesoft.org/schema/mule/jms/current/mule-jms.xsd 
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd 
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd ">
    <jms:activemq-connector name="Active_MQ" brokerURL="tcp://localhost:61616" validateConnections="true" doc:name="Active MQ"/>
    <flow name="Inititationflow" doc:name="Inititationflow">
        <http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8046" doc:name="HTTP"/>
        <echo-component doc:name="Echo"/>
        <jms:outbound-endpoint queue="BANK1" exchange-pattern="request-response" doc:name="JMS"/>
    </flow>
    <flow name="SampleTest" doc:name="SampleTest">
        <jms:inbound-endpoint queue="BANK1" connector-ref="Active_MQ" doc:name="JMS"/>
        <echo-component doc:name="Echo"/>
        <append-string-transformer message="AppendedPart" doc:name="Append String"/>
        <echo-component doc:name="Echo"/>
        <file:outbound-endpoint path="C:\Documents and Settings\balajik\Desktop" outputPattern="myfile.txt" doc:name="File"/>
    </flow>
</mule>
Run Code Online (Sandbox Code Playgroud)

我什么时候做Http浏览器请求:lh:8046/manasa-sundarraman

当2个请求出现时,流程执行两次.请求是:1)/favicon.ico 2)/ manasa-sunderraman

我的问题是/favicon.ico是什么?为什么要作为请求来?怎么避免呢?

java favicon esb http mule

3
推荐指数
1
解决办法
3198
查看次数

Maven Tomcat 7 - 构建

我正在使用Tomcat 7来部署我的war文件.所以不得不使用mojo tomcat-maven-plugin.我在Tomcat中设置的Http端口是8090,我的服务器名是localhost.

Maven无法部署我的应用程序,因为它发出以下错误:

[ERROR] Failed to execute goal org.codehaus.mojo:tomcat-maven-plugin:1.1:deploy (default-cli) on project 01JsfExample: Cannot invoke Tomcat manager: Server returned HTTP response code: 403 for URL: http://localhost:8090/manager/deploy?path=%2Fbalaji&war= -> [Help 1]
Run Code Online (Sandbox Code Playgroud)

在执行程序之前,我在以下地方做了所有改动.

%TOMCAT_HOME%/ CONF/Tomcat的users.xml中

<?xml version='1.0' encoding='utf-8'?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); …
Run Code Online (Sandbox Code Playgroud)

java tomcat maven-3 maven tomcat7

3
推荐指数
1
解决办法
5369
查看次数

在Commons Codec中合适地替代encodeBuffer方法

我有一段代码使用AES算法进行加密和解密,该算法使用sun.misc。*软件包。

后来我才知道,使用那些使我听从使用有效的Apache Commons Codec的建议的软件包集是错误的。

先前的代码如下:

import java.security.*;
import java.security.spec.InvalidKeySpecException;
import javax.crypto.*;
import javax.crypto.spec.SecretKeySpec;


import sun.misc.*;

public class AESencrp {
private static final String ALGO = "AES";
private static final byte[] keyValue = 
    new byte[] { 'T', 'h', 'e', 'B', 'e', 's', 't','S', 'e', 'c', 'r','e', 't', 'K', 'e', 'y' };

public static String encrypt(String Data) throws Exception {
    Key key = generateKey();
    Cipher c = Cipher.getInstance(ALGO);
    c.init(Cipher.ENCRYPT_MODE, key);
    byte[] encVal = c.doFinal(Data.getBytes());
    String encryptedValue = new BASE64Encoder().encode(encVal);
    return encryptedValue;
} …
Run Code Online (Sandbox Code Playgroud)

java encryption base64 aes apache-commons

1
推荐指数
1
解决办法
4689
查看次数