Thursday, November 29, 2012

Pattern Riddle


What is it, in Your opinion?
The answer is below...
 .
 .
 .
 |
 |
V
 .
 .
 .
 .
 |
 |
V
 .
 .
 .
YES,
these are Xmas trees!!
:-))

[  The author is 2 years old :-)  ]

The sample usage of private static volatile variable in multi-thread environment

I wanted to examine the usage of private static volatile variable in multi-thread environment, and that is the example code which I had written:


package com.jeeprojectsnippets.volatilable;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;

public class JeeProjectSnippetsTest {

    private static volatile int jeep = 1;

    public static void main(String[] args) throws IOException,
            ClassNotFoundException {


           
        JeeProjectSnippets singleton = null;

        for (int i = 1; i < 4; i++) {
           
            UpdateReceiver updateReceiver = new UpdateReceiver();
            updateReceiver.start();
           
            singleton = JeeProjectSnippets.getInstance();
           
            UpdateTransmitter updateTransmitter = new UpdateTransmitter();
            updateTransmitter.start();
           
            File file = new File("ser" + i + ".txt");

            ObjectOutputStream oos = new ObjectOutputStream(
                    new FileOutputStream(file));
            JeeProjectSnippets.a++;
            singleton.b++;
            JeeProjectSnippets.c++;
            singleton.d++;
            JeeProjectSnippets.f++;

            oos.writeObject(singleton);
            oos.close();

            ObjectInputStream ois = new ObjectInputStream(
                    new FileInputStream(file));
            JeeProjectSnippets jps = (JeeProjectSnippets) ois.readObject();

            System.out.println("main() in  JeeProjectSnippetsTest: " +i + ". Variable jeep equals: " + jeep);
            System.out.println("main() in  JeeProjectSnippetsTest: " +i + ". a_static: " + JeeProjectSnippets.a);
            System.out.println("main() in  JeeProjectSnippetsTest: " +i + ". b_transient: " + jps.b);
            System.out.println("main() in  JeeProjectSnippetsTest: " +i + ". c_static_volatile: " + JeeProjectSnippets.c);
            System.out.println("main() in  JeeProjectSnippetsTest: " +i + ". d_volatile: " + jps.d);
            System.out.println("main() in  JeeProjectSnippetsTest: " +i + ". f_static_transient: " + JeeProjectSnippets.f + "\n");
            ois.close();

        }
    }

    /**
     * JeeProjectSnippets class is a simple Singleton implementation. This
     * example demonstrates when is useful to use volatile keyword in Java. I
     * use volatile variable in this example to ensure that every thread can see
     * already updated value of instance.
     */
    public static class JeeProjectSnippets implements Serializable {

        private static final long serialVersionUID = 5808143804530443067L;

        private static int a = 1;
        private transient int b = 1;
        private static volatile int c = 1;
        private volatile int d = 1;
        private static transient int f = 1;

        private static volatile JeeProjectSnippets instance;

        public static JeeProjectSnippets getInstance() {
            if (instance == null) {
                synchronized (JeeProjectSnippets.class) {
                    if (instance == null)
                        instance = new JeeProjectSnippets();
                }
            }
            return instance;
        }
    }
   
    public static class UpdateReceiver extends Thread {
        @Override
        public void run() {
            JeeProjectSnippets singleton = JeeProjectSnippets.getInstance();
            JeeProjectSnippets.a++;
            singleton.b++;
            JeeProjectSnippets.c++;
            singleton.d++;
            JeeProjectSnippets.f++;
            int jeeLocal = jeep;
            while ( jeeLocal < 4){
                if( jeeLocal!= jeep){
                    System.out.println("run() in UpdateReceiver: " +jeeLocal + ". Variable jeep is updated: " + jeep);
                    System.out.println("run() in UpdateReceiver: " +jeeLocal + ". a_static: " + JeeProjectSnippets.a);
                    System.out.println("run() in UpdateReceiver: " +jeeLocal + ". b_transient: " + singleton.b);
                    System.out.println("run() in UpdateReceiver: " +jeeLocal + ". c_static_volatile: " + JeeProjectSnippets.c);
                    System.out.println("run() in UpdateReceiver: " +jeeLocal + ". d_volatile: " + singleton.d);
                    System.out.println("run() in UpdateReceiver: " +jeeLocal + ". f_static_transient: " + JeeProjectSnippets.f + "\n");
                     jeeLocal= jeep;
                }
            }
        }
    }

    public static class UpdateTransmitter extends Thread{
        @Override
        public void run() {
            JeeProjectSnippets singleton = JeeProjectSnippets.getInstance();
            JeeProjectSnippets.a++;
            singleton.b++;
            JeeProjectSnippets.c++;
            singleton.d++;
            JeeProjectSnippets.f++;
            int jeeLocal = jeep;
            while (jeep < 4){
                int temp = jeeLocal+1;
                System.out.println("run() in UpdateTransmitter: " +jeep + ". Increment variable jeep to: " + temp);
                System.out.println("run() in UpdateTransmitter: " +jeep + ". a_static: " + JeeProjectSnippets.a);
                System.out.println("run() in UpdateTransmitter: " +jeep + ". b_transient: " + singleton.b);
                System.out.println("run() in UpdateTransmitter: " +jeep + ". c_static_volatile: " + JeeProjectSnippets.c);
                System.out.println("run() in UpdateTransmitter: " +jeep + ". d_volatile: " + singleton.d);
                System.out.println("run() in UpdateTransmitter: " +jeep + ". f_static_transient: " + JeeProjectSnippets.f + "\n");
                jeep = ++jeeLocal;
                try {
                    Thread.sleep(400);
                } catch (InterruptedException e) { e.printStackTrace(); }
            }
        }
    }

}


And the output was as following:

run() in UpdateTransmitter: 1. Increment variable jeep to: 2
run() in UpdateTransmitter: 1. a_static: 4
run() in UpdateTransmitter: 1. b_transient: 4
run() in UpdateTransmitter: 1. c_static_volatile: 4
run() in UpdateTransmitter: 1. d_volatile: 4
run() in UpdateTransmitter: 1. f_static_transient: 4

run() in UpdateReceiver: 1. Variable jeep is updated: 2
run() in UpdateReceiver: 1. a_static: 4
run() in UpdateReceiver: 1. b_transient: 4
run() in UpdateReceiver: 1. c_static_volatile: 4
run() in UpdateReceiver: 1. d_volatile: 4
run() in UpdateReceiver: 1. f_static_transient: 4

main() in  JeeProjectSnippetsTest: 1. Variable jeep equals: 2
main() in  JeeProjectSnippetsTest: 1. a_static: 4
main() in  JeeProjectSnippetsTest: 1. b_transient: 0
main() in  JeeProjectSnippetsTest: 1. c_static_volatile: 4
main() in  JeeProjectSnippetsTest: 1. d_volatile: 4
main() in  JeeProjectSnippetsTest: 1. f_static_transient: 4

main() in  JeeProjectSnippetsTest: 2. Variable jeep equals: 2
main() in  JeeProjectSnippetsTest: 2. a_static: 6
main() in  JeeProjectSnippetsTest: 2. b_transient: 0
main() in  JeeProjectSnippetsTest: 2. c_static_volatile: 6
main() in  JeeProjectSnippetsTest: 2. d_volatile: 6
main() in  JeeProjectSnippetsTest: 2. f_static_transient: 6

main() in  JeeProjectSnippetsTest: 3. Variable jeep equals: 2
main() in  JeeProjectSnippetsTest: 3. a_static: 7
main() in  JeeProjectSnippetsTest: 3. b_transient: 0
main() in  JeeProjectSnippetsTest: 3. c_static_volatile: 7
main() in  JeeProjectSnippetsTest: 3. d_volatile: 7
main() in  JeeProjectSnippetsTest: 3. f_static_transient: 7

run() in UpdateTransmitter: 2. Increment variable jeep to: 3
run() in UpdateTransmitter: 2. a_static: 8
run() in UpdateTransmitter: 2. b_transient: 8
run() in UpdateTransmitter: 2. c_static_volatile: 8
run() in UpdateTransmitter: 2. d_volatile: 8
run() in UpdateTransmitter: 2. f_static_transient: 8

run() in UpdateReceiver: 2. Variable jeep is updated: 3
run() in UpdateReceiver: 2. Variable jeep is updated: 3
run() in UpdateReceiver: 2. a_static: 8
run() in UpdateReceiver: 2. a_static: 8
run() in UpdateReceiver: 2. b_transient: 9
run() in UpdateReceiver: 2. c_static_volatile: 9
run() in UpdateReceiver: 2. d_volatile: 9
run() in UpdateReceiver: 2. f_static_transient: 9

run() in UpdateTransmitter: 3. Increment variable jeep to: 4
run() in UpdateTransmitter: 3. a_static: 10
run() in UpdateTransmitter: 3. b_transient: 10
run() in UpdateTransmitter: 3. c_static_volatile: 10
run() in UpdateTransmitter: 3. d_volatile: 10
run() in UpdateTransmitter: 3. f_static_transient: 10

run() in UpdateReceiver: 3. Variable jeep is updated: 4
run() in UpdateReceiver: 3. a_static: 10
run() in UpdateReceiver: 3. b_transient: 10
run() in UpdateReceiver: 3. c_static_volatile: 10
run() in UpdateReceiver: 3. d_volatile: 10
run() in UpdateReceiver: 3. f_static_transient: 10

run() in UpdateReceiver: 2. b_transient: 8
run() in UpdateReceiver: 2. c_static_volatile: 10
run() in UpdateReceiver: 2. d_volatile: 10
run() in UpdateReceiver: 3. Variable jeep is updated: 4
run() in UpdateReceiver: 2. f_static_transient: 10

run() in UpdateReceiver: 3. a_static: 10
run() in UpdateReceiver: 3. b_transient: 10
run() in UpdateReceiver: 3. c_static_volatile: 10
run() in UpdateReceiver: 3. d_volatile: 10
run() in UpdateReceiver: 3. f_static_transient: 10

Friday, November 23, 2012

Use WeakHashMap as cache memory

When can we use WeakHashMap as cache memory? Having objects that are often reused and their creation is expensive, and there are too many of them to keep them all in memory.

SAMPLE CODE:
package com.jeeprojectsnippets.weakhashmap;

import java.util.WeakHashMap;

public class JeeProjectSnippets {

    public static void main(String[] args) {
  
        G33Value g33value = new G33Value();
        G33Key g33key = new G33Key();
        g33value.setStr("Value1");
        g33key.setKey(1);
        final WeakHashMap weakHashMap;
        weakHashMap = new WeakHashMap();
        final WeakHashMap weakHashMap2;
        weakHashMap2 = new WeakHashMap();
        final WeakHashMap weakHashMap3;
        weakHashMap3 = new WeakHashMap();
        weakHashMap.put(g33key, g33value);
        g33value.setStr("Value2");
        g33key.setKey(2);
        weakHashMap2.put(g33key, g33value);
        g33value.setStr("Value3");
        g33key.setKey(3);
        weakHashMap3.put(g33key, g33value);
        System.gc();
        System.out.println("weakHashMap.size() = " + weakHashMap.size());
        System.out.println("weakHashMap.get(g33key) = " + weakHashMap.get(g33key));
        g33key = null;
        int count = 0;
        while (0 != weakHashMap.size()) {
            ++count;
            System.gc();
        }
        System.out.println("weakHashMap.size() = " + weakHashMap.size());
        System.out.println("weakHashMap.get(g33key) = " + weakHashMap.get(g33key));
        System.out.println("Counter after exiting of the loop = " + count);
    }

    static class G33Key {
        private Integer key = null;

        public Integer getKey() {
            return key;
        }

        public void setKey(Integer key) {
            this.key = key;
        }
    }

    static class G33Value {
        private String str = null;

        public String getStr() {
            return str;
        }

        public void setStr(String str) {
            this.str = str;
        }
    }
}


RESULTS:
weakHashMap.size() = 1
weakHashMap.get(g33key) = pl.jeeprojectsnippets.weakhashmap.JeeProjectSnippets$G33Value@b8df17
weakHashMap.size() = 0
weakHashMap.get(g33key) = null
Counter after exiting of the loop = 6

Elements in a WeakHashMap can be reclaimed by the garbage collector if there are no other strong references to the object, this makes them useful for caches/lookup storage.
By te way, Java specifies five levels of reachability for objects in order of strongest-to-weakest:
*    Strongly Reachable
*    Softly Reachable
*    Weakly Reachable
*    Phantom Reachable
*    Unreachable


Wednesday, November 21, 2012

Are You registered in parleys.com? Not yet?

Parleys.com
The Next Generation eLearning Platform.

Are You registered in parleys.com? Not yet?
Why not :-)

http://www.parleys.com/#st=8

https://twitter.com/parleys


Collections.synchronizedMap() vs. ConcurrentHashMap

java.util.Collections.synchronizedMap() method's declaration is as following:
public static <K,V> Map<K,V> synchronizedMap(Map<K,V> m)

Collections.synchronizedMap() guarantees that each atomic operation I want to run on the map will be synchronized. It creates a blocking Map which will degrade performance, however it ensure consistency (if used properly).

Let's see at a sample code:
  Map<String, List<String>> myMap;
  myMap = new HashMap<String, List<String>>();
  private static Map<String, List<String>> synchroMap = Collections.synchronizedMap(myMap);

  public static void addToMyMap(String myKey, String myValue) {
    synchronized (synchroMap) {
      if (!synchroMap.containsKey(myKey)) {
        List<String> listOfValues = new ArrayList<String>();
        listOfValues.add(myValue);
        synchroMap.put(myKey, listOfValues);
      }else{
        synchroMap.get(myKey).add(myValue);
      }
    }
  }

And what about java.util.concurrent.ConcurrentHashMap?
It allows concurrent changes of the Map from several threads without the need to block them. We can use it when the performance is critical.


Tuesday, November 20, 2012

Autoboxing calls Integer.valueOf(...)

Autoboxing calls Integer.valueOf(...) - see sample snippet of code:

package pl.jeeprojectsnippets.autoboxing;
public class JeeProjectAutoboxing {

    public static void main(String[] args) {
        int d [][] = {{1,2},{3,4}};
        int c [] = d[1];
        int b = c[1];
        Object f = 1; // Autoboxing "Object f = 1;" calls "Integer.valueOf(1)"
        Object a = b;
        int g = (Integer) a;
        Integer i = Integer.valueOf(1);
        Integer j = Integer.valueOf(1);
        Integer k = new Integer(1);
        Integer l = new Integer("1");
        System.out.println(g);  // toggle a breakpoint here and see id of all numbers in debug mode
    }
}

volatile and transient

Access modifiers to fields of classes: volatile and transient

In Java every variable marked with a transient modifier will not be serialized (because it will be excluded by Java object serialization subsystem when serializing an instance of the class). You can use the transient keyword to indicate to the JVM that the transient field is not part of the persistent state of an object.

The volatile modifier tells the Java Virtual Machine that every recording to this field should always be synchronously flushed to memory, and that every reading of this field should always read from memory. That is why fields marked as volatile can be safely accessed and updated in a multi-thread application without using native or standard library-based synchronization (except long or double fields, which may be non-atomic on some Java Virtual Machines. However, it always can apply to reference-typed fields) .

See more in java.util.concurrent.atomic packacge e.g.:
AtomicIntegerFieldUpdater     A reflection-based utility that enables atomic updates to designated volatile int fields of designated classes.
AtomicLongFieldUpdater     A reflection-based utility that enables atomic updates to designated volatile long fields of designated classes.



 

Monday, November 19, 2012

Shell limits for the oracle user

Check the shell limits for the oracle user and set them if necessary:
ulimit -d 1048576  
ulimit -s 409600  
ulimit -c unlimited     
ulimit -n 65536 
ulimit -m unlimited 
ulimit -v unlimited 
ulimit -u 16384 

oracle user account in Linux


Creating a oracle user account in Linux

Log in as root, please. Use tcsh or csh. Do not use su or sudo.


Please check the availability for UID in the /etc/passwd.
Create a user account:
-   oracle, account with a non-zero and available UID number such as 1001
     (installation owner of Oracle)

groupadd oracleinstall
groupadd dba
groupadd oracle
useradd -u 1001 -o -g oracle -s /bin/tcsh -d /home/oracle -m -c 'Oracle Owner' oracle
usermod -aG dba,oracleinstall oracle
passwd oracle
id oracle
chown -R oracle  /home/oracle/
cat /etc/group

You should see an entry in the /etc/passwd like this:
  oracle:x:uid_nr:group_nr:Oracle Owner:/home/oracle:/bin/tcsh


 Setting the environment variables

Before the proper installation of the Oracle database system check and complete environment variables:
su - oracle
env | grep ORACLE
set | grep ORACLE


Set them if they are not properly set:
su - oracle
vi /home/oracle/.bash_profile
ORACLE_HOME=/home/oracle/app/oracle/product/11.2.0/dbhome_1;
export ORACLE_HOME;
ORACLE_SID=essdb; export ORACLE_SID;
ORACLE_OWNER=oracle; export ORACLE_OWNER;
ORACLE_BASE=/home/oracle/app/oracle; export ORACLE_BASE;
PATH=$ORACLE_HOME/bin:$PATH; export PATH

touch /home/oracle/.cshrc
vi /home/oracle/.cshrc
setenv ORACLE_HOME /home/oracle/app/oracle/product/11.2.0/dbhome_1
setenv ORACLE_SID essdb
setenv ORACLE_OWNER oracle
setenv ORACLE_BASE /home/oracle/app/oracle
setenv PATH $ORACLE_HOME/bin:$PATH

reboot
su - oracle
env | grep ORACLE
set | grep ORACLE

Configuring the kernel parameters to install the Oracle database server on CentOS or RedHat

I want to show how to configure the kernel parameters to install the Oracle database server on CentOS or RedHat:


Run the ipcs command with the option -l (list):
ipcs -l

As a result, we can get a list of kernel parameters:

   ------ Shared Memory Limits --------
   max number of segments = 4096                    // SHMMNI  
   max seg size (kbytes) = 32768                       // SHMMAX
   max total shared memory (kbytes) = 3774873      // SHMALL in number of pages
   min seg size (bytes) = 1                 // SHMMIN

   ------ Semaphore Limits --------
   max number of arrays = 1024                         // SEMMNI
   max semaphores per array = 250                      // SEMMSL
   max semaphores system wide = 256000             // SEMMNS
   max ops per semop call = 100                         // SEMOPM
   semaphore max value = 32767

   ------ Messages: Limits --------
   max queues system wide = 1024                       // MSGMNI
   max size of message (bytes) = 65536             // MSGMAX
   default max size of queue (bytes) = 65536       // MSGMNB




Check and set kernel parameters, please.

[Kernel parameter]    [Value]        [Command to check the value]
shmmni            4096        cat /proc/sys/kernel/shmmni
shmall            3774873        cat /proc/sys/kernel/shmall
shmmax            2147483648    cat /proc/sys/kernel/shmmax
shmmin            1        ipcs -lm |grep "min seg size"  
semmsl            250        cat /proc/sys/kernel/sem | awk '{print $1}' 
semmns            256000        cat /proc/sys/kernel/sem | awk '{print $2}' 
semopm            100        cat /proc/sys/kernel/sem | awk '{print $3}' 
semmni            1024        cat /proc/sys/kernel/sem | awk '{print $4}'
file-max        65536        cat /proc/sys/fs/file-max
ip_local_port_range    1024 - 65000    cat /proc/sys/net/ipv4/ip_local_port_range
rmem_default        1048576   
rmem_max        1048576   
wmem_default        262144   
wmem_max        1048576   
aio-max-nr        1048576   
kernel.msgmax        65535   
msgmnb            65535   
Table 1: Kernel parameters of Linux system (e.g.
CentOS or RedHat)

Run commands:
su - root
ipcs -ls
sysctl -p
cat /etc/sysctl.conf



Set the following kernel parameters with a option of sysctl command, or in the vi editor:
sysctl -w kernel.sem="250 256000 100 1024"
sysctl -w fs.file-max=65536
or
vi /etc/sysctl.conf
kernel.sem = 250 256000 100 1024
kernel.shmmax=2147483648        # For a 64-bit system
kernel.shmall=3774873        # For 90 percent of 16 GB memory
kernel.msgmax=65535
kernel.msgmnb=65535
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 1048576
net.core.rmem_max = 1048576
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
fs.file-max = 65536
fs.aio-max-nr = 1048576

Run sysctl command with -p parameter to load sysctl settings from the default file /etc/sysctl.conf:
sysctl -p
ipcs -ls
reboot
su - root
sysctl -p
ipcs -ls
cat /etc/sysctl.conf


Changes will be effective after every reboot, because of executing of /etc/rc.d/rc.sysinit script
called by /etc/inittab will automatically load /etc/sysctl.conf file.


Pre-configuration of SSH

I am happy that I use English on this blog. There are a lot of advantages of it :-)

Pre-configuration of SSH
Check that the SSH service is enabled on the server. Enable if not.
Perform backup of content of following files:
•    /etc/ssh/sshd_config – copy to /etc/ssh/sshd_config.old (ssh server),
•    /etc/ssh/ssh_config – copy to /etc/ssh/ssh_config.old (ssh client),

Log on as root and follow the instructions:
cp /etc/ssh/sshd_config  /etc/ssh/sshd_config.old
cp /etc/ssh/ssh_config  /etc/ssh/ssh_config.old
cat /etc/ssh/sshd_config

Then, review and modify the SSH server configuration in /etc/ssh/sshd_config file, for example:

Protocol 2
Port 22
#ListenAddress adres-ip
AllowTcpForwarding no
GatewayPorts no
X11Forwarding yes
X11DisplayOffset 10
X11UseLocalhost yes
PrintMotd no
KeepAlive yes
SyslogFacility auth
LogLevel info
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key
ServerKeyBits 768
KeyRegenerationInterval 3600
StrictModes no
LoginGraceTime 600
MaxAuthTries    6
MaxAuthTriesLog    3
PermitEmptyPasswords no
PasswordAuthentication yes
PermitRootLogin yes
Subsystem    sftp    /usr/lib/ssh/sftp-server
IgnoreRhosts yes
RhostsAuthentication no
RhostsRSAAuthentication no
RSAAuthentication yes
DSAAuthentication yes
PubkeyAuthentication yes
# Accept locale-related environment variables
AcceptEnv LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES
AcceptEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT
AcceptEnv LC_IDENTIFICATION LC_ALL
UsePAM yes
#AllowUsers oracle root userWhoIsUsedToLogIn

Remember after configuration of installation to change values of some parameters again (such as for security reasons):
PermitRootLogin without-password

Then, review and modify the SSH client configuration in /etc/ssh/ssh_config file, for example:

Protocol 2
Port 22
RSAAuthentication yes
DSAAuthentication yes
PasswordAuthentication yes
GSSAPIKeyExchange yes
StrictHostKeyChecking ask
IdentityFile ~/.ssh/id_rsa
IdentityFile ~/.ssh/id_dsa
Host *
GSSAPIAuthentication yes
ForwardX11Trusted yes
# Send locale-related environment variables
SendEnv LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES
SendEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT
SendEnv LC_IDENTIFICATION LC_ALL LANGUAGE
SendEnv XMODIFIERS

Restart the SSH server settings:
/etc/init.d/sshd stop
/etc/init.d/sshd start

Annotations with WebServices and Soap



Let's apply annotations for basic class for Web Services with SOAP. This could look like the following:


package pl.kdabrowski;

import javax.annotation.Resource;
import javax.ejb.Stateless;
import javax.xml.transform.sax.SAXSource;
import javax.xml.ws.ServiceMode;
import javax.xml.ws.WebServiceContext;
import javax.xml.ws.BindingType;
import javax.xml.ws.Provider;
import javax.xml.ws.WebServiceProvider;
import javax.xml.ws.handler.MessageContext;
import javax.xml.ws.Service.Mode;
import org.jboss.ws.api.annotation.WebContext;

@Stateless
@WebServiceProvider(targetNamespace = "http://kdabrowski.pl/test/testuj", portName="TestujSOAP", serviceName="TestujService",
        wsdlLocation = "META-INF/wsdl/Testuj.wsdl")
@ServiceMode(Mode.MESSAGE)
@WebContext(contextRoot="/test/testuj", urlPattern="/testuj/"+WERURL) 
@BindingType(value="http://www.w3.org/2003/05/soap/bindings/HTTP/")

public class TestujService implements Provider{

    @Resource
    WebServiceContext context;
   
    public SAXSource invoke(SAXSource arg0) {


(...)