sachin y deshpande

Greenhorn
+ Follow
since May 12, 2004
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 sachin y deshpande

Hi
We are trying to read a properties file using FileInputStream in our j2ee app:


The properties file is in a jar defined as a utility jar within the server and associated with the app.

We are getting the following error





Funnily we get the file if we use Resource bundle to load the file.

Please help.
11 years ago
Hi
We are facing a problem (File not found) when specifying custom logging properties in a file external to the application.
Please help in figuring out the issue. Thanks in advance.

We have created a custom Logger class which wraps the JDK logger (initiates it too)
We have used the custom Logger to handle logging in web-service implementations.

The following is the code in the custom Logger class


The following is a section of the MY_logging.properties file that we need to access. This file is supplied in a jar (its in the base directory) which is set in shared-lib of the server. We are using Websphere App Server v7


The following is the exception which we get:
11 years ago
Hi,
We need to deploy a jpa v1.1 application in was 7 which bundles jpa v1.2 by default. How/where do I set the class-path so that the server loads jpa v1.1 jars in priority.
Thanks in advance.
11 years ago
Hello All,
Is it possible to do a insert using jpa ql? if yes how (an link...?)? and what are the ramifications, if any?
Thanks
Hi,
We have developed jax-ws web-services and deployed them on websphere application server 7.0. We need to turn on schema validation within the server implementation so that validation through user code is not necessary.
Any pointers?
Thanks in advance
11 years ago
I have a table:


and another table:


with the following constraints:


and

DEVICE_EQ_TYPE, DEVICE_STN_ID and DEVICE_UNIT_ID are FKs too.


"Generated" entities look like:


and:


and:
and there are some other entities which i guess (and hope) are of not much value in this context.

I need to create a Job and SubJob in the same application managed transaction.
The JPA entity managers/controller are generated.
Note: managers/controller have been modified so that they dont have to manage transactions.

Here is the code that I have written:



The error stack is:
<openjpa-1.2.1-SNAPSHOT-r422266:707222 fatal store error> org.apache.openjpa.persistence.RollbackException: The transaction has been rolled back. See the nested exceptions for details on the errors that occurred.
at org.apache.openjpa.persistence.EntityManagerImpl.commit(EntityManagerImpl.java:523)
...
...
... 38 more
Caused by: <openjpa-1.2.1-SNAPSHOT-r422266:707222 nonfatal user error> org.apache.openjpa.persistence.ArgumentException: Field "entity.SubJob.pk" of "entity.SubJob@577a577a" can not be set to "entity.SubJobPK@84933dcf" value.
at org.apache.openjpa.jdbc.meta.strats.HandlerFieldStrategy.insert(HandlerFieldStrategy.java:131)
...
...
...


The queries printed on the console are:
executing prepstmnt 885994703 INSERT INTO EM.Job (JOB_ID, SUBMITTED_BY, SUBMITTED_TS, JOB_TYPE_ID, STATUS_CD) VALUES (?, ?, ?, ?, ?) [params=(long) 19, (String) shree, (Timestamp) 2009-03-13 19:54:02.125, (long) 1, (long) 1]
[0 ms] spent
executing prepstmnt 1556241602 INSERT INTO EM.SUB_JOB (JOB_ID, JOB_TYPE_ID, STEP_ID) VALUES (?, ?, ?) [params=(long) 19, (null) null, (null) null]
[16 ms] spent


Looks like the insert of SUB_JOB query is generated in correctly/ incompletely!
Can anyone help us in rectifying the problem?

Thanks in advance
Just updating the code (missed adding the objects to be persisted in the BusinessComponent code...)
Hello,
We are developing an Application Managed JPA application.

The structure of the application is
Business Components which have business logic.
Tool generated DAO layer (JPA Managers and JPA Entities)

The usage would be like


Note: JPA Managers do invoke any transaction related APIs.


1) Is this valid code? i.e. would the update happen in a single transaction even if the EntityManagers obtained by all the classes (BusinessComponent, JPAEntity2Mgr, JPAEntity1Mgr) are different?
2) Is there a need to invoke the em.joinTransaction() api in the JPA Managers?
1) I do have a firewall which came with the anti-virus. Turned it off. Tried again. Same results.
2) Verified that I dont have another ssh program. And I dont have it.

Any other suggestions?
11 years ago
Agreed that 'Each stream should be read in a separate Thread' to avoid lockups.
But thats not whats happening currently!
It would be great if someone has an explanation, or better still, a solution.
Thanks.
11 years ago
Have omitted the part which reads from input (not that it really matters).
Here is the rest of the part:

...
...
String lineErr;
while ((lineErr = br.readLine()) != null) {
System.out.println("lineErr-" + lineErr);
}

// read the ls output
String lineOut;
while ((lineOut = bufferedreader.readLine()) != null) {
System.out.println("lineOut-" + lineOut);
}

try {
if (proc.waitFor() != 0) {
System.err.println("Exit value :" +
proc.exitValue());
}
}
catch (InterruptedException e) {
e.printStackTrace();
System.err.println("Iterrupted Stack :" + e);
}
...
...


Thanks again
11 years ago
Hi,
I am trying to execute, from my local windows box, a command (ssh) on a remote linux box using Java's Runtime exec

String cmds[] = { "ssh",
"root@remotelinuxbox",
"ls"
};
String arr[] = {""};
String workingFolder = "C:\\";

Runtime rt = Runtime.getRuntime();
rt.traceInstructions(true);
rt.traceMethodCalls(true);
Process proc = rt.exec(cmds, arr, new File(workingFolder));
System.out.println("ExecInput.ssh()" + " ssh'ed");

// get its output (your input) stream
InputStream inputstream = proc.getInputStream();
InputStreamReader inputstreamreader = new InputStreamReader(inputstream);
BufferedReader bufferedreader = new BufferedReader(inputstreamreader);

InputStream inputstreamerr = proc.getErrorStream();
InputStreamReader isr = new InputStreamReader(inputstreamerr);
BufferedReader br = new BufferedReader(isr);

String lineErr;
while ((lineErr = br.readLine()) != null) {
System.out.println("lineErr-" + lineErr);
}

The output of the above code results in :

ExecInput.ssh() ssh'ed
lineErr-socket: Operation not permitted
lineErr-ssh: connect to host remotelinuxbox port 22: Operation not permitted
Exit value :255


Funnily,
String cmds[] = { "scp",
"ST_list.xml",
"root@remotelinuxbox:ST_list.xml"};
works great!

Can someone tell me what do I need to correct here?

Note:
1) Have tried other combinations (am skeptical about these though)

a) String cmds[] = { "ssh root@remotelinuxbox ls"};
b) String cmds[] = { "ssh",
"root@remotelinuxbox 'ls -l'"};
c) String cmds[] = { "ssh",
"root@remotelinuxbox | 'ls -l'"};
These combinations yield
IO Stack :java.io.IOException: CreateProcess: "ssh root@remotelinuxbox "ls -l"" error=2



Noticably, both the commands when executed on the command prompt work perfectly as expected! The login happens and they execute as well.
1) scp ST_list.xml root@remotelinuxbox:ST_list.xml
2) ssh root@remotelinuxbox ls

Thanks in advance
11 years ago
Hi,
Both the below commands when executed on the command prompt work perfectly as expected! The login happens and they execute as well.
1) scp ST_list.xml root@remotelinuxbox:ST_list.xml
2) ssh root@remotelinuxbox ls

Thanks.
11 years ago
Hi,
I am trying to execute, from my local windows box, a command (ssh) on a remote linux box using Java's Runtime exec

String cmds[] = { "ssh",
"root@remotelinuxbox",
"ls"
};
String arr[] = {""};
String workingFolder = "C:\\";

Runtime rt = Runtime.getRuntime();
rt.traceInstructions(true);
rt.traceMethodCalls(true);
Process proc = rt.exec(cmds, arr, new File(workingFolder));
System.out.println("ExecInput.ssh()" + " ssh'ed");

// get its output (your input) stream
InputStream inputstream = proc.getInputStream();
InputStreamReader inputstreamreader = new InputStreamReader(inputstream);
BufferedReader bufferedreader = new BufferedReader(inputstreamreader);

InputStream inputstreamerr = proc.getErrorStream();
InputStreamReader isr = new InputStreamReader(inputstreamerr);
BufferedReader br = new BufferedReader(isr);

String lineErr;
while ((lineErr = br.readLine()) != null) {
System.out.println("lineErr-" + lineErr);
}

The output of the above code results in :

ExecInput.ssh() ssh'ed
lineErr-socket: Operation not permitted
lineErr-ssh: connect to host remotelinuxbox port 22: Operation not permitted
Exit value :255


Funnily,
String cmds[] = { "scp",
"ST_list.xml",
"root@remotelinuxbox:ST_list.xml"};
works great!

Can someone tell me what do I need to correct here?

Note:
1) Have tried other combinations (am skeptical about these though)

a) String cmds[] = { "ssh root@remotelinuxbox ls"};
b) String cmds[] = { "ssh",
"root@remotelinuxbox 'ls -l'"};
c) String cmds[] = { "ssh",
"root@remotelinuxbox | 'ls -l'"};
These combinations yield
IO Stack :java.io.IOException: CreateProcess: "ssh root@remotelinuxbox "ls -l"" error=2


Help me out of this please.

Thanks in advance
11 years ago
I also need to mention that we are using ActionForm to set the data retreived from database.
13 years ago