Showing posts with label java. Show all posts
Showing posts with label java. Show all posts

Java анотации

Friday, March 26, 2010 Автор: Sergey Kabashnyuk 0 коммент.
JAVA: Подсчёт времени выполнения метода через аннотацию http://bit.ly/bgsZXU
Ярлыки: ,

JGroups on Ubuntu 9.10

Saturday, November 28, 2009 Автор: Sergey Kabashnyuk 1 коммент.
If you have

28.11.2009 21:16:25 *ERROR* [Timer-2,JBoss-Cache-Cluster_db1tck_ws,127.0.0.1:7800] MPING: failed sending discovery request (MPING.java, line 346) 
java.io.IOException: Invalid argument
at java.net.PlainDatagramSocketImpl.send(Native Method)
at java.net.DatagramSocket.send(DatagramSocket.java:612)
at org.jgroups.protocols.MPING.sendMcastDiscoveryRequest(MPING.java:341)
at org.jgroups.protocols.PING.sendGetMembersRequest(PING.java:259)
at org.jgroups.protocols.Discovery$PingSenderTask$1.run(Discovery.java:407)
at java.util.concurrent.Executors$RunnableAdapter.
 
on Ubuntu 9.10 or over operation system  try to run you application with
-Djava.net.preferIPv4Stack=true
This happens because  JGroups does work with IPv6.
Ярлыки: , , , ,

Lucene 3.0 is out

Thursday, November 26, 2009 Автор: Sergey Kabashnyuk 2 коммент.
Great news: Lucene 3.0 is out!!

The new version is mostly a cleanup release without any new features. All deprecations targeted to be removed in version 3.0 were removed.

See CHANGES.txt   for details.
Binary and source distributions are available here
Ярлыки: , ,

How to setup Eclipse debug for eXo JCR core (maven project)

Thursday, July 30, 2009 Автор: Sergey Kabashnyuk 0 коммент.
1. Import exo.jcr.core project into the Eclipse. 2. Open dialog Run -> Debug configurations
Select Project: "Name of the imported project"
Main Class: org.codehaus.classworlds.Launcher
3. Insert Arguments
Program arguments: -Dexo.test.forkMode=never -Dexo.tck.skip=true -Dexo.test.skip=false clean test
VM arguments: -Xmx300m -Dclassworlds.conf="${M2_HOME}/bin/m2.conf" -Dmaven.home="${M2_HOME}"
4. Add classwords jar to the classpath.
5. Add required sources.
6. Run debug
Ярлыки: , , , ,

Installing ANTLR IDE on Eclipse Java EE

Thursday, July 16, 2009 Автор: Sergey Kabashnyuk 0 коммент.
If use Eclipse update mechanism (Eclipse Java EE IDE for Web Developers.  Build id: 20090621-0832) for installing ANTLR IDE and you can't find  any categories you should uncheck "Group items by category" checkbox, everything will be working correctly.
Ярлыки: , , ,

Jprofiler 5.2.2 and Java 5 64-bit

Wednesday, July 8, 2009 Автор: Sergey Kabashnyuk 0 коммент.
When I tried to run Jprofiler , I received : exception in thread "main" java.lang.InternalError: libXt loaded before libXm .
Exception in thread "main" java.lang.InternalError: libXt loaded before libXm
 at java.lang.ClassLoader$NativeLibrary.load(Native Method)
 at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751)
 at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668)
 .....
Workaround is to change AWT_TOOLKIT. You should add “export AWT_TOOLKIT=XToolkit” to you jprofiler5/bin/jprofiler file.
LD_LIBRARYN32_PATH="$app_home/bin/linux-x86:$LD_LIBRARYN32_PATH"
LD_LIBRARYN64_PATH="$app_home/bin/linux-x86:$LD_LIBRARYN64_PATH"
export LD_LIBRARY_PATH
export DYLD_LIBRARY_PATH
export SHLIB_PATH
export LIBPATH
export LD_LIBRARYN32_PATH
export LD_LIBRARYN64_PATH
export AWT_TOOLKIT=XToolkit
Ярлыки: ,

Контент ориентированное программирование

Monday, July 6, 2009 Автор: Sergey Kabashnyuk 0 коммент.
Ярлыки: , , ,

How to copy one file to another through channel

Sunday, July 5, 2009 Автор: Sergey Kabashnyuk 0 коммент.
This Java tips illustrates a method of copying one file to another file through channel. A channel is created both on source as well as destination and then the file is copied between those two channels.
   try {
           // Create channel on the source
           FileChannel srcChannel =
             new FileInputStream("srcFilename").getChannel();
      
           // Create channel on the destination
           FileChannel dstChannel =
             new FileOutputStream("dstFilename").getChannel();
      
           // Copy file contents from source to destination
           dstChannel.transferFrom(srcChannel, 0, srcChannel.size());
                   // Close the channels
         srcChannel.close();
         dstChannel.close();
       } catch (IOException e) {
         //TODO catch exception
       }
Ярлыки: ,