ubuntu为当前用户增加组

将wangliang 增加到vboxusers组中

sudo usermod -a -G vboxusers wangliang

http://www.cyberciti.biz/faq/howto-linux-add-user-to-group/

原创文章,转载请注明: 转载自海波无痕

本文链接地址: ubuntu为当前用户增加组

文章的脚注信息由WordPress的wp-posturl插件自动生成

发表在 server | 标签为 , | 留下评论

ubuntu 12.04 LTS 版eclipse svn报Failed to load JavaHL Library

Failed to load JavaHL Library.
These are the errors that were encountered:
no libsvnjavahl-1 in java.library.path
no svnjavahl-1 in java.library.path
no svnjavahl in java.library.path
java.library.path = /usr/lib/jni

按照以前的装法

1、sudo apt-get install libsvn-java

2、eclipse.ini中增加参数

-vmargs[……]

Read more

发表在 javaee, server | 标签为 , , , , , | 留下评论

run multiple instances of sshd on ubuntu

sudo cp -r /etc/ssh /etc/ssh2
sudo cp /etc/init.d/ssh /etc/init.d/ssh2
sudo cp /etc/default/ssh /etc/default/ssh2
sudo ln /usr/sbin/sshd /usr/sbin/sshd2

sudo vi /etc/init.d/ssh2
SSHD_OPTS='-f /etc/ssh2/sshd_config'

sudo vi /etc/ssh2/sshd_config'

Port 28222
[……]

Read more

发表在 server | 标签为 , , | 留下评论

避免javax.xml.bind.UnmarshalException兼容一个更新的webservice

CXF的jaxb客户端调用webservice的情况下,默认情况下服务端更新了wsdl如xml增加了一个属性,假如不再根据wsdl重新生成client就会报错 javax.xml.bind.UnmarshalException: unexpected element ,但新增的这个元素对原有的业务又是无用的多余的。

那对于客户端来说就可以不升级client,解决办法是将set-jaxb-validation-event-handler 设置为false

JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();

Cl[……]

Read more

发表在 javaee, server | 标签为 , , , | 一条评论

cxf自动生成的wsdl被nginx代理后soap:address location

由于开发webservice使用的是cxf的java first、wsdl是自动生成的。其中生成的

<wsdl:port binding="tns:MyServiceSoapBinding" name="MyServicePort">
<soap12:address location="http://www.domain.com/appcontext/Service/MyService"/>
</wsdl:port>

location 是根据请求的request来自动生成的
如果用127.0.0.1来访问生成的wsdl就是

<wsdl:port binding="tns:MyServiceSoapBinding" name="MyServicePort">
<soap12:address location="http://127.0.0.1/appcontext/Service/MyService"/></wsdl:port>

如果用localhost来访问生成的wsdl就是

<wsdl:port binding="tns:MyServiceSoapBinding" name="MyServicePort">
<soap12:address location="http://localhost/appcontext/Service/MyService"/>
</wsdl:port>

这就会产生一个问题如果用nginx或者apache放在tomcat的前端的话,tomcat[……]

Read more

发表在 javaee, spring | 标签为 , , , , , , , | 7条评论

tomcat在windows下安装后台服务

1、用命令行进入tomcat_home/bin/目录,运行service install tomcat_c4。进入服务列表设置为自动服务。

2、使用regedit进入注册表

找到

HKEY_LOCAL_MACHINE\SOFTWARE\Apache Software Foundation\Procrun 2.0\tomcat_c4\Parameters\Java

修改

JvmMs 选10进制 设置为512 

JvmMx 选10进制 设置为512

Options 的值增加

 

-XX:NewRatio=3
-XX:PermSize=128m
-[……]

Read more

发表在 javaee | 标签为 , | 留下评论

Another unnamed CacheManager already exists in the same VM.

nested exception is net.sf.ehcache.CacheException: Another unnamed CacheManager already exists in the same VM. Please provide unique names for each CacheManager in the config or do one of following:
1. Use one of the CacheManager.create() static factory methods to reuse same CacheManager with same name or create one if necessary
2. Shutdown the earlier cacheManager before creating new one with same name.
The source of the existing CacheManager is: DefaultConfigurationSource [ ehcache.xml or ehcache-failsafe.xml ]
at org.springframework.beans.factory.access.SingletonBeanFactoryLocator.useBeanFactory(SingletonBeanFactoryLocator.java:389)
at org.springframework.web.context.ContextLoader.loadParentContext(ContextLoader.java:358)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:193)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4779)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5273)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:895)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:871)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:649)
at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1581)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
<bean id=sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean" lazy-init="true">
<property name="dataSource"><ref bean="dataSource" /></property>
<property name="mappingLocations">
<list><value>classpath*:com/xxx/*.hbm.xml</value></list>
</property>
<property name="hibernateProperties">
<value>
hibernate.bytecode.use_reflection_optimizer={hibernate.bytecode.use_reflection_optimizer}
hibernate.dialect=${hibernate.dialect}
hibernate.jdbc.fetch_size=${hibernate.jdbc.fetch_size}
hibernate.jdbc.batch_size=${hibernate.jdbc.batch_size}
hibernate.hbm2ddl.auto=${hibernate.hbm2ddl.auto}
hibernate.show_sql=${hibernate.show_sql}
hibernate.format_sql=${hibernate.format_sql}
hibernate.query.factory_class=${hibernate.query.factory_class}
hibernate.default_batch_fetch_size=${hibernate.default_batch_fetch_size}
hibernate.transaction.factory_class=${hibernate.transaction.factory_class}
hibernate.transaction.auto_close_session=${hibernate.transaction.auto_close_session}
hibernate.cache.use_query_cache=${hibernate.cache.use_query_cache}
hibernate.cache.use_second_level_cache=${hibernate.cache.use_second_level_cache}
hibernate.cache.region.factory_class=net.sf.ehcache.hibernate.SingletonEhCacheRegionFactory
net.sf.ehcache.configurationResourceName=/com/xxx/ehcache.xml
</value>
</property>
</bean>

用个项目中多个sessionfactory使用hibernate的ehcache或者hibernate和业务共同使用ehcache使用SingletonEhCacheRegionFactory。

原创文章,转载请注明: 转载自海波无痕

本文链接地址: Another unnamed CacheManager already exists in the same VM.

文章的脚注信息由WordPress的wp-posturl插件自动生成

发表在 javaee, server, spring | 标签为 , , , | 留下评论

ehcache//overflowToDisk=true//java.io.NotSerializableException

 

ehcache版本2.5.1
 
java.io.NotSerializableException: com.xxx.MyObj
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1164)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330)
at java.util.HashMap.writeObject(HashMap.java:1001)
at sun.reflect.Gen[……]

Read more

发表在 javaee, server | 标签为 , , , | 留下评论

使用jaxb-xjc的xjc和schemagen

jaxb是sun的oxm(object xml mapping)框架api,它包含了
jaxb-api
jaxb-impl
jaxb-xjc
其中jaxb-impl实现了jaxb-api,而xjc是XML Binding Binding Compiler,
可以使用其中的
com.sun.tools.internal.jxc.SchemaGenerator 根据java source 生成schema定义
com.sun.tools.xjc.XJCFacade 则根据schema生成java代码

在maven2项目中

dbeca7f12919a580c2d69f29454[……]

Read more

发表在 javaee, javascript, server | 标签为 , , , | 留下评论

TCP/IP协议栈

TCP/IP协议栈是一组由不同协议构成的协议组合。其模型实现了OSI网络模型的功能。TCP/IP网络协议栈分为应用层(Application)、传输层(Transport)、网络层(Network)和链路层(Link)四层

TCP/IP字面上代表了两个协议:TCP传输控制协议和IP互联网协议。
ISO的OSI网络模型
面向数据传输–>物理层、数据链路层、网络层、传输层
面向用户应用–>会话层、表示层、应用层
 
 
应用层协议
 
smtp/简单邮件传输协议
http
pop3
soap
ftp
dhcp
 [……]

Read more

发表在 server | 标签为 , , , | 留下评论
Pages: Prev 1 2 3 4 5 6 7 8 9 10 ... 20 21 22 Next