27 Ekim 2009 Salı

revisited : Troobleshooting: Date becomes XMLGregorianCalendar when stubs are generated at client side, how to prevent this?

lets revisit issue on http://hilaltarakci.blogspot.com/2009/06/troobleshooting-date-becomes.html
the problem is, although adapter interface is generated, the generated implementation for the interface is empty.. so, sould replace with own implementation..

btw, soln is discovered by someone in the team, not me.. lets share it :  https://jaxb.dev.java.net/guide/Using_different_datatypes.html


18 Ekim 2009 Pazar

Could not execute JDBC batch update

the error Could not execute JDBC batch update comes out when the entities are as follows and you are trying to save the parent entity:

parent entity
  @OneToMany(cascade = CascadeType.ALL)
   @JoinTable(name = "TBL_INCIDENT_ABSEVIDGRP", joinColumns = {
        @JoinColumn(name = "FLD_INCIDENT_ID")
    },
    inverseJoinColumns = {
        @JoinColumn(name = "FLD_ABSEVIDGRP_ID")
    })
private List childList = new ArrayList();

child entity
    @ManyToOne
    @JoinTable(name = "TBL_INCIDENT_ABSEVIDGRP", joinColumns = {
        @JoinColumn(name = "FLD_ABSEVIDGRP_ID")
    },
    inverseJoinColumns = {
        @JoinColumn(name = "FLD_INCIDENT_ID")
    })
private Parent parent;

the error is solved by commenting out the green and bold code portion..
the lack of red code portion leads to the following error while saving the parent entity:
Error while commiting the transaction
javax.persistence.RollbackException: Error while commiting the transaction
        at org.hibernate.ejb.TransactionImpl.commit(TransactionImpl.java:71)
...
Caused by: org.hibernate.TransientObjectException: object references an unsaved transient instance - save the transient instance before flushing: Child Entity
 

unit testing dao with actual postgre db settings

the environment is netbeans 6.5 ide, postgre db, junit for unit testing..
when i try to execute unit tests over postgre, i get the following error:
3196 [main] FATAL org.hibernate.connection.DatasourceConnectionProvider  - Could not find datasource: blshilaltarakci
javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file:  java.naming.factory.initial
        at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:645)
        at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)
....

i think the reason for this is the lack of jndi properties file. when the project is deployed to any server, the server mostly already has a jndi properties file and this is not a problem..  ( i think..) in my case, there is no jndi properties file in classpath, since the (dao) project is not deployed to server in the time of testing.. 
so, i moved back to unit testing using an in memory database..

Edit on 05/11/2009 at 10:27 : Sometimes, the reason the error does not disappear is badly formed named queries.. 

15 Ekim 2009 Perşembe

soapui experience

well, i want to note down what i faced unexpected during my soapui usage..

first of all, soapui project is one big xml file which is a disadvantage.. i really have no idea how they handled svn usage, maybe it is similar to enterprise architect's solution. whatever, my concern is not svn at this moment..

secondly, i could not open the project after i closed netbeans, i don t know why.. soapui-project.xml file is just got emty with no reason.. so, i have to start from beginning, this is annoying actually :( the point is: pay special attention to taking backups..
and this warning comes up everytime i close netbeans.. 
Project file [...Test] has been modified externally, overwrite?

TODO: very soon..



13 Ekim 2009 Salı