19 Kasım 2009 Perşembe

increasing heap size of glassfish

In order to increase heap size for glassfish, follow th steps:
1) Open glassfish admin console from adress similar to http://localhost:4848/ 
(the default username: admin and password: adminadmin)
2) Select application server -> jvm settings -> jvm options
3) Update the parameters similar to the below ones according to your needs:

12 Kasım 2009 Perşembe

javax.xml.ws.WebServiceException: Unexpected response element ,,, error

Sometimes, you get javax.xml.ws.WebServiceException: Unexpected response element ,,, error while running a bpel process from a client. 
The error is well defined here: http://forums.netbeans.org/topic11185.html
One way to get rid of this error is adding namespace attribute to the operation definition in the wsdl of the bpel process as follows:
 <binding name="calculatorMtomWSDLPortTypeBinding" type="tns:calculatorMtomWSDLPortType">
        <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
        <operation name="calculatorMtomWSDLOperation">
            <soap:operation/>
            <input name="input1">
                <soap:body use="literal" namespace="http://j2ee.netbeans.org/wsdl/CalculatorMtom/calculatorMtomWSDL"/>
            </input>
            <output name="output1">
                <soap:body use="literal" namespace="http://j2ee.netbeans.org/wsdl/CalculatorMtom/calculatorMtomWSDL"/>
            </output>
        </operation>
    </binding>

in short, lack of the red stuff above, leads the mentioned problem..



monitoring soap messages in glassfish

in order to see oncoming and outgoing soap messages on glassfish, 

set the following jvm parameter in glassfish admin console:

-Dcom.sun.xml.ws.transport.http.client.HttpTransportPipe.dump=true

6 Kasım 2009 Cuma

testsuite for junit

i used org.junit package for developing unit tests and want to run all my tests in a suite..
in order to do that :

two sample test classes
import org.junit.Test;

public class Test1 {
    @Test
    public void TestCase1() {
   ...
   }
-------------------------------
import org.junit.Test;

public class Test2 {
    @Test
    public void TestCase2() {
   ...
   }

test suite
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
import org.junit.runners.Suite.SuiteClasses;

@RunWith(Suite.class)
@SuiteClasses({
    Test1.class,
    Test2.class
    })
public class AllTests {

}

(post by Arne V. at 10-06-2008, 03:18 AM)


5 Kasım 2009 Perşembe

named query

named query is a great tool provided by jpa while developing your dao classes.. (i mean it is used while developing dao classes, not tool for doing the job itself..)



4 Kasım 2009 Çarşamba

limitation: circular relationships in web services


object model can represent a graph at the server side and it must be serialized into an xml which can only represent a tree (not a graph especially with cycles) while using xml web services.. 



CycleRecoverable is an interface which detects cycles on the implementing object and executes the method onCycleDetected when the object is about to serialize into XML. Thus it gives you a chance to break the cycles in the object graph and make it a tree, thus representable by xml. 

import com.sun.xml.bind.CycleRecoverable;
import com.sun.xml.bind.CycleRecoverable.Context;

public class Clazz implements  CycleRecoverable {
// ...
@Override
    public Object onCycleDetected(Context arg0) {
        // do whatever you do
        return object;
    }