7 Mayıs 2012 Pazartesi

How to recover crashed svn repository...


We are using visual svn 2.1.4. It is working on vmware virtual windows 7 on unbuntu linux box. Unfortunately, our electricity infrastructure has a big problem, the electric generator is not activated whenever the electric goes off. Well, this situation is not causing too much problem when our vmware is running on windows box.. But we have changed operating system to linux, it begun to cause problems.. Some files at vmware windows 7 are corrupted..

REPORT of '/svn/ttnetquestuswar/!svn/vcc/default': Could not read chunk size:

We get the above message from svn client, whenever we try to update..

Solution :

1. Stop visual svn server.

2. Backup your repository . You can copy your svn repository to another directory.

3. You should point crashed revision. You can use svnadmin verify command to point the crashed revision.

4. You should dump all revisions until the problematic revision (suppose that it is 1000) with this command ; svnadmin dump -r 1:999 > svndump.txt

5. You should also dump all revisions after the problematic one with this command (suppose the last revision is 2000) ; svnadmin dump --incremental -r 1001:2000 > svndump2.txt

6. Rename your old repository directory..

7. Create a new repository with the same name..

8. Load all changes to the brand new repository with these commands :
svnadmin load < svndump.txt
svnadmin load < svndump2.txt


9. Check your repository with svn verify..

10. Start your visual svn server..

5 Mayıs 2012 Cumartesi

Toad for oracle is not starting..


Well, recently toad is not answering , and I killed its process. But after that, whenever I want to start toad , I get this exception ;

Error reading TtdSQLRecall.HistorySQL: Stream read error

As usual, I googled it, but I could not find anything. As a solution, I have removed SavedSQL.dat file located "user files" directory under toad installation.. It worked for me, I hope it would solve your problem also..

9 Ocak 2012 Pazartesi

Weblogic 10.3.2 and Hibernate Named Query Problem

If you use Hibernate 3.3.X, 3.4.X with Weblogic 10.3.X , and choose to use named queries , most probably you gonna get below exception ;

org.hibernate.QueryException: ClassNotFoundException: org.hibernate.hql.ast.HqlToken

The problem the versions of antlr.jar , weblogic and hibernate are not compatible. You should put antlr.jar 1.4.X as a first item in weblogic server classpath. You can change startWebLogic.cmd for Windows , startWebLogic.sh for linux file at directory %WEBLOGIC_HOME%/user_projects/domains/%YOUR_DOMAIN%/bin/.

set SAVE_CLASSPATH=%CLASSPATH%

You should change upper line such as for windows environment;

set SAVE_CLASSPATH=%CLASSPATH%
set CLASSPATH=%antlr_path%\antlr.jar;%SAVE_CLASSPATH%

10 Haziran 2011 Cuma

wsimport removes underscores while generating java classes from wsdl

Actually, jaxb is responsible for this behaviour. You should use a binding file to change default behaviour.

Here is the binding file ;


<?xml version='1.0' encoding='UTF-8'?>
<jaxb:bindings
    xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
    version="2.1">
    <jaxb:globalBindings underscoreBinding="asCharInWord"/>
</jaxb:bindings>







You should  call wsimport such as ;

wsimport -b bindingFile.xml wsdlLocation


27 Nisan 2011 Çarşamba

How to solve Oracle Cannot access NLS data files or invalid environment specified exception

Recently, I have tried to port a seam application to tomcat from weblogic. I have got below exception...

java.sql.SQLException: ORA-00604: error occurred at recursive SQL level 1
ORA-12705: Cannot access NLS data files or invalid environment specified


After a quite time consuming search, I have found a solution that works for me. My oracle jdbc driver version is 10.2.0.1.0 and name is ojdbc14.jar. Here is the solution ;

 -Duser.language=en  -Duser.region=us







24 Mart 2011 Perşembe

How to display a progressbar during gwt rpc?..


Well, it is a generic non-functional requirement, I have done some research on this item, I have implemented a solution that Thomas Broyer has suggested on gwt group.. This solution has distinct advantage over other solutions, You dont have to change your callback classes, what you have to do is just add a line of code after creation of async gwt-rpc service...

  

    IGwtPersistenceEngineRPCAsync persistenceEngine = GWT.create(IGwtPersistenceEngineRPC.class);
         ((ServiceDefTarget) persistenceEngine).setRpcRequestBuilder(
                          new ProgressRequestBuilder());


    package com.gurselkoca.gwt.client.service;
    import com.allen_sauer.gwt.log.client.Log;
    import com.google.gwt.http.client.Request;
    import com.google.gwt.http.client.RequestBuilder;
    import com.google.gwt.http.client.RequestCallback;
    import com.google.gwt.http.client.Response;
    import com.google.gwt.user.client.rpc.RpcRequestBuilder;
    
    public class ProgressRequestBuilder extends RpcRequestBuilder {
    
     private class RequestCallbackWrapper implements RequestCallback {
    
     private RequestCallback callback;
    
     RequestCallbackWrapper(RequestCallback aCallback) {
     this.callback = aCallback;
     }
    
     @Override
     public void onResponseReceived(Request request, Response response) {
     Log.debug("onResposenReceived is called");
     // put the code to hide your progress bar
     callback.onResponseReceived(request, response);
    
     }
    
     @Override
     public void onError(Request request, Throwable exception) {
     Log.error("onError is called",new Exception(exception));
     // put the code to hide your progress bar
     callback.onError(request, exception);
     }
     }
    
     @Override  
     protected RequestBuilder doCreate(String serviceEntryPoint) {
    
     RequestBuilder rb = super.doCreate(serviceEntryPoint);
     // put the code to show your progress bar
     return rb;  
     }
    
     @Override
     protected void doFinish(RequestBuilder rb) {
     super.doFinish(rb);
     rb.setCallback(new RequestCallbackWrapper(rb.getCallback()));
      
     }
    
    }

11 Mart 2011 Cuma

How to stop compilation of your gwt project every time you run a GwtTestCase in production (web) mode

When you run a GwtTestCase in production(web) mode , java to javascript compilation is done, whether source files are modified or not. And as already known, java to jaavascript is compilation is very slow. GwtTestCase does not have any option to prevent compilation. I have modified JUnitShell.maybeCompileWebMode method to make compilation depend on VM argument compile. You can download modified JUnitShell from here. You should add -Dcompile=false  to the script responsible running for your GwtTestCase.