2014年2月17日星期一
linux 查找
find / -type f -name "*.log" | xargs grep "ERROR"
例子:从当前目录开始查找所有扩展名为.in的文本文件,并找出包含”thermcontact”的行
find . -name "*.in" | xargs grep "thermcontact"
tomcat启动在80端口 Permission denied :80
在redhat上启动tomcat(将server.xml中的端口改为80)
su - tomcat -c "$CATALINA_HOME/bin/startup.sh"
后出现:Catalina.start: LifecycleException: null.open: java.net.BindException: Permission denied:80
这是因为只有root用户才可访问1024以下的端口。
解决方法:
重将server.xml中的端口改为8080
然后:iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8080
(如果用到443,也相应执行以上方法)
即可!
linux命令
先sudo apt-get install alien
然后
sudo alien /路径/xxxx.rpm
然后在当前用户路径下生成了一个XXXXX.deb
直接
sudo dpkg -i xxxx.deb
就行了。
Type the full pathname of a J2SE installation (or Ctrl-C to quit), the path will be stored
具体过程如下:
1、修改hosts
sudo gedit /etc/hosts
2、添加解析记录( . )
完整案例:127.0.0.1 localhost.localdomain localhost
简洁记录:127.0.0.1 localhost
3、保存后重启网络
mvn clean package -Dmaven.test.skip=true
Skip your tests with maven release plugin
- Preparing –
mvn -DpreparationGoals=clean -DscmCommentPrefix="XXX" release:prepare
- Performing –
mvn -Darguments="-Dmaven.test.skip=true" release:perform
update 子查询隐含风险
Steps To Solve “bind an object under the name HibernateSessionFactory in the JNDI tree” error | Weblogic
< 14-Dec-2010 10:41:01 CET> <error> <cluster> <BEA-000123> <Conflict start: Youtried to bind an object under the name in the JNDI tree HibernateSessionFactory.From the object-2465366582483676621S: hrofserver02: [7010.7010, -1, -1, -1, -1, -1]ckm: HPOF02_1 is non-clusterable, and you have tried to bind more than two ounces ormore from servers. Such objects can only be deployed from one server.> ”
In persistance.xml when the below property is added you will face this issue
<property name="hibernate.session_factory_name">hibernate.SessionFactory</property> <!-- JNDI bound Session Factory Name -->
so it will only be pinned to one of your server as stated in the log message.
Please add the below property to persistance.xml to resolve this issue.
<property name="hibernate.jndi.weblogic.jndi.replicateBindings">false</property> <!-- because SessionFactory is not clusterable -->
BEA-149500:An exception occurred while registering the MBean null
java.lang.IllegalArgumentException: Registered more than one instance with the same objectName : com.bea:ServerRuntime=AdminServer,Name=portal,Type=ApplicationRuntime new:weblogic.j2ee.J2EEApplicationRuntimeMBeanImpl@13e959da existing weblogic.j2ee.J2EEApplicationRuntimeMBeanImpl@135ebbc5
at weblogic.management.jmx.ObjectNameManagerBase.registerObject(ObjectNameManagerBase.java:168)
at weblogic.management.mbeanservers.internal.WLSObjectNameManager.lookupObjectName(WLSObjectNameManager.java:131)
at weblogic.management.jmx.modelmbean.WLSModelMBeanFactory.registerWLSModelMBean(WLSModelMBeanFactory.java:87)
at weblogic.management.mbeanservers.internal.RuntimeMBeanAgent$1.registered(RuntimeMBeanAgent.java:105)
at weblogic.management.provider.core.RegistrationManagerBase.invokeRegistrationHandlers(RegistrationManagerBase.java:180)
Truncated. see log file for complete stacktrace
ssh -L6666:172.20.66.218:22 root@192.168.20.156
修改173的 etc/hosts
Spring mvc @ResponseBody ajax调用出现如下错误:406 Not Acceptable
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
<version>1.7.1</version>
</dependency>
linux Gbk 乱码
linux svn 切换用户
linux svn 切换用户
win7 64位+Oracle 11g 64位下使用PL/SQL Developer 的解决办法
码农的一天
忙得七荤八素的,都想不起来昨天干了些啥。
今天又苦逼得忙了一天,查库 开库 找原因 安排新功能,尿尿的没时间,码农的一天
想着整理整理13年积攒下来的一些东西
2014 再出发
偷懒儿的时候翻看blogger,发现我关注的几个博客都几年没更新了,2年的....4年的。我的一年没更新了
0:16 回家的出租车上
过去的2013,忙碌 疲惫 麻木 机械,得过且过,新年新气象,再出发
2012年12月31日星期一
2012年9月4日星期二
weblogic org.hibernate.QueryException: ClassNotFoundException: org.hibernate.hql.internal.ast.HqlToken
在WEB-INF目录下建一个weblogic.xml文件,文件中写入如下代码:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE weblogic-web-app PUBLIC "-//BEA Systems, Inc.//DTD Web Application 8.1//EN" "http://www.bea.com/servers/wls810/dtd/weblogic810-web-jar.dtd">
<weblogic-web-app>
<container-descriptor>
<prefer-web-inf-classes>true</prefer-web-inf-classes>
</container-descriptor>
</weblogic-web-app>
说明:prefer-web-inf-classes=true是WebLogic's classloader在有重名类时,优先加载Web应用中WEB-INF内的类
也可以
set PRE_CLASSPATH=D:\oracle\weblogic\wlserver_10.3\server\lib\antlr-2.7.7.jar
http://azurelover.blog.51cto.com/2990964/548988
cvc-complex-type.3.1: Value '2.0' of attribute 'version' of element 'entity-mappings' is not valid with respect to the corresponding attribute use. Attribute 'version' has a fixed value of '1.0'
Caused by: org.xml.sax.SAXException: zip:D:/oracle/weblogic/user_projects/domains/base_domain/servers/AdminServer/tmp/_WL_user/examsystem-showcase/eymnvq/war/WEB-INF/lib/_wl_cls_gen.jar!/META-INF/orm.xml [Location: Line: 3, C: 138]: org.xml.sax.SAXParseException: cvc-complex-type.3.1: Value '2.0' of attribute 'version' of element 'entity-mappings' is not valid with respect to the corresponding attribute use. Attribute 'version' has a fixed value of '1.0'.
at org.apache.openjpa.lib.meta.XMLMetaDataParser.getException(XMLMetaDataParser.java:656)
将orm.xml
改成
<?xml version="1.0" encoding="UTF-8"?>
<entity-mappings version="1.0" xmlns="http://java.sun.com/xml/ns/persistence/orm" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/ormhttp://java.sun.com/xml/ns/persistence/orm_1_0.xsd">
</entity-mappings>
java.lang.NoSuchMethodError: javax.persistence.spi.PersistenceUnitInfo.getSharedCacheMode()Ljavax/persistence/SharedCacheMode
Caused By: java.lang.NoSuchMethodError: javax.persistence.spi.PersistenceUnitInfo.getSharedCacheMode()Ljavax/persistence/SharedCacheMode;
at org.hibernate.ejb.util.LogHelper.logPersistenceUnitInfo(LogHelper.java:39)
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:516)
at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:73)
at weblogic.deployment.PersistenceUnitInfoImpl.createEntityManagerFactory(PersistenceUnitInfoImpl.java:352)
at weblogic.deployment.PersistenceUnitInfoImpl.createEntityManagerFactory(PersistenceUnitInfoImpl.java:332)
设置setDomainEnv
windows
@rem Enable JPA 2.0 functionality on WebLogic Server
set PRE_CLASSPATH=D:\oracle\weblogic\modules\javax.persistence_1.1.0.0_2-0.jar;D:\oracle\weblogic\modules\com.oracle.jpa2support_1.0.0.0_2-1.jar
linux
PRE_CLASSPATH=/oracle/weblogic/modules/javax.persistence_1.0.0.0_2-0-0.jar;/oracle/weblogic/modules/com.oracle.jpa2support_1.0.0.0_2-0.jar
export PRE_CLASSPATH