This week's book giveaway is in the Cloud forum.
We're giving away four copies of Terraform in Action and have Scott Winkler on-line!
See this thread for details.
Win a copy of Terraform in Action this week in the Cloud forum!

Neha Gap

Greenhorn
+ Follow
since May 30, 2007
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Neha Gap

Hello ranchers!

I would like to know if there is a good solution to dealing with schema upgrades in my application when these upgrades are done by someone else. For example, I have a set of hbm.xml files and corresponding java classes generated using Hibernate tools. Now in production, everything works fine until the db schema is upgraded. I do (my app does) not have access to do that so how do I deal with this using Hibernate?

Thanks,
Neha.
Hi folks,

The subject says it all.

Any help would be appreciated.

Thanks,
Neha.
12 years ago
Hi,

I have just come across JMock and haven't quite got the hang of it yet.
I have a class called JabberAccountManager. It has a few methods that perform account management operations. Every method internally creates an object of type XMPPConnection (which is a part of an XMPP library)

Now, I want to mock the Jabber server so I need to create a mock XMPPConnection object, but my problem is that the class I need to test and the class I need to mock are tightly coupled. I cannot de-couple these since there are a lot of issues involved.

Could someone please explain to me how to go about using JMock in a case like this?

Thanks,
Neha.
13 years ago
Ok the deal is that the keystore is not created correctly. I'm surprised this is so because I created the keys using the keytool as explained in the keytool manual. Even checked using keytool -list on the console, it gave me the expected results.

Anyway, if anyone is facing a similar problem while running a sample app using wss4j, you can try using the .keystore file provided in wss4j/keys

Also, if someone is aware of why I the keys I created using keytool are not being read, please let me know.

Thank you
- Neha.
14 years ago
Anybody seen a similar error? Please let me know.

Thanks
- Neha.
14 years ago
Thanks for the reply.

I generated the keystores and then used them in the crypto.properties file. I'm sure the password is correct, I even checked using the method you just mentioned. Yet i continue to get the same exception.

- Neha.
14 years ago
Hi,

I have created a key pair each for the client and the server side. I then imported the client's public key into the server's keystore. Now, my client-deploy.wsdd looks like this

<deployment xmlns="http://xml.apache.org/axis/wsdd/" xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
<transport name="http" pivot="java rg.apache.axis.transport.http.HTTPSender"/>
<globalConfiguration >
<requestFlow >
<handler type="java rg.apache.ws.axis.security.WSDoAllSender" >
<parameter name="action" value="UsernameToken Encrypt"/>
<parameter name="user" value="wss4j"/>
<parameter name="passwordCallbackClass" value="com.comp.webservice.PWCallback"/>
<parameter name="passwordType" value="PasswordDigest"/>
<parameter name="addUTElement" value="Nonce Created" />
<parameter name="encryptionPropFile" value="client_crypto.properties" />
<parameter name="encryptionKeyIdentifier" value="X509KeyIdentifier" />
<parameter name="encryptionUser" value="privkey" />
<parameter name="encryptionParts"
value="{Element}{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd}UsernameToken" />
</handler>
</requestFlow >
</globalConfiguration >
</deployment>

and my server-deploy.wsdd looks like this

<deployment xmlns="http://xml.apache.org/axis/wsdd/"
xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">

<service name="SayHelloService" provider="java:RPC">
<requestFlow>
<handler type="java rg.apache.ws.axis.security.WSDoAllReceiver">
<parameter name="passwordCallbackClass" value="PWCallback"/>
<parameter name="action" value="UsernameToken Encrypt"/>
<parameter name="decryptionPropFile" value="server_crypto.properties" />
</handler>
</requestFlow>
<parameter name="className" value="com.comp.webservice.SayHelloService"/>
<parameter name="allowedMethods" value="*"/>
</service>

</deployment>


Everything seems to be right, yet when I run the client, it says

IOException: Keystore was tampered with, or password was incorrect

What am I doing wrong... I'm guessing its a very fundamental mistake that I'm not able to notice. Please help me if you have any clues of how to go about solving this one.

Thanks in advance.
- Neha.
14 years ago
Thank you for the replies

- Neha.
The DAOs are all middlegen generated. I am not writing the code for child-parent references.

- Neha.
Hi,

I have two tables with bi-directional association between the two. The hbm.xml files, DAOs, model classes and interfaces are all generated by middlegen. I'm constructing the objects of these generated model classes using Spring's ApplicationContext. The child object has a reference to the parent object in the spring config xml file. I try to insert an object of type child using hibernate's generated DAOs and get the following error

<error message="(Hibernate operation: could not insert: [child]): data integrity violated by SQL 'insert into child
nested exception is java.sql.SQLException: Cannot add or update a child row: a foreign key constraint fails (``, CONSTRAINT `FK9EB1B4A760778BE5` FOREIGN KEY (`parentID`) REFERENCES `parent` (`parent_id`))" type="org.springframework.dao.DataIntegrityViolationException">org.springframework.dao.DataIntegrityViolationException: (Hibernate operation: could not insert: []): data integrity violated by SQL '


Any and all help would be greatly appreciated.
- Neha.
Hi,

I am doing the following -

I have a parent application bean context which does not construct any beans.

ApplicationBeanContext parent = new FileSystemXmlApplicationContext("empty.xml");

I have two children contexts, child1 and child2
ApplicationBeanContext child1 = new FileSystemXmlApplicationContext("child1.xml",parent);


Child1.xml

<bean id="child1" class="child1">
<property name="val">
<value>1</value>
</property>
</bean>

ApplicationBeanContext child2 = new FileSystemXmlApplicationContext("child2.xml",parent);
Child2.xml

<bean id="child2" class="child2">
<property name="child1">
<ref name="child1"/>
</property>
</bean>

(The code above is pseudo code)
Basically, I've configured child1 and child2 contexts to have the same parent. At child2's object initialisation, I get the following error

org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'child1' is defined:

Is this because I'm giving the xml files to the child contexts and not the parent context? Is there any solution for this?

Thanks in advanace
- Neha.
Basically, the field should be mapped to text and not to varchar(2147483647).
Hi,

I am using this task for converting my hbm.xml files to and sql script for SQL Server 2005. My problem is this - my hbm.xml file contains a field which is of type String with length 2147483647. When I run the schemaExportTask, it maps this field to varchar(2147483647). This is incorrect since in SQL Server 2005, varchar cannot have size more than 8000.

Is there any way of changing this (other than writing a custom dialect?)

Thanks,
Neha.
Hi,

I want to know how to use the special characters (like < ) in an ant build file.

I'm trying to create a target in my ant file to execute a script in mysql. Since mysql has no options for input file, on the command prompt, it can be done using the < filename.sql option. However, putting the < character in the arg section of exec task in an ant file gives errors.

Any help would be really appreciated.
Thanks!
Neha.
14 years ago
Hi,

I'm a complete newbie, and am just evaluating J2ME right now.
If I want to write a mobile application using J2ME, how will my application communicate with a Java server? Using RMI? Or is it that J2ME applications for mobile devices are written primarily for stand alone apps?

Any help would be greatly appreciated.
Thanks!
Neha.
14 years ago