Bunty Paul

Greenhorn
+ Follow
since Jun 26, 2006
Merit badge: grant badges
For More
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 Bunty Paul

Hi All,

I get the following exception when i run my EJB Client code.

Exception in thread "main" java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
java.rmi.ServerException: EJBException:; nested exception is:
javax.ejb.EJBException: Could not instantiate bean
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:325)
at sun.rmi.transport.Transport$1.run(Transport.java:153)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
at java.lang.Thread.run(Thread.java:595)
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:126)
at org.jboss.invocation.jrmp.server.JRMPInvoker_Stub.invoke(Unknown Source)
at org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxy.invoke(JRMPInvokerProxy.java:118)
at org.jboss.invocation.InvokerInterceptor.invokeInvoker(InvokerInterceptor.java:227)
at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:167)
at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:46)
at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:55)
at org.jboss.proxy.ejb.HomeInterceptor.invoke(HomeInterceptor.java:169)
at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:86)
at $Proxy1.create(Unknown Source)
at com.css.sample.client.MyClient.main(MyClient.java:34)
Caused by: java.rmi.ServerException: EJBException:; nested exception is:
javax.ejb.EJBException: Could not instantiate bean
at org.jboss.ejb.plugins.LogInterceptor.handleException(LogInterceptor.java:352)
at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:125)
at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invokeHome(ProxyFactoryFinderInterceptor.java:93)
at org.jboss.ejb.SessionContainer.internalInvokeHome(SessionContainer.java:613)
at org.jboss.ejb.Container.invoke(Container.java:894)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
at org.jboss.invocation.jrmp.server.JRMPInvoker$MBeanServerAction.invoke(JRMPInvoker.java:805)
at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:406)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
at sun.rmi.transport.Transport$1.run(Transport.java:153)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
at java.lang.Thread.run(Thread.java:595)
Caused by: javax.ejb.EJBException: Could not instantiate bean
at org.jboss.ejb.plugins.AbstractInstancePool.get(AbstractInstancePool.java:180)
at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invokeHome(StatelessSessionInstanceInterceptor.java:78)
at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:90)
at org.jboss.ejb.plugins.CallValidationInterceptor.invokeHome(CallValidationInterceptor.java:41)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:109)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:300)
at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:146)
at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:116)
at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:121)
... 25 more


My Client Code is as follows:
---------------------------------

package com.css.sample.client;

import com.css.sample.MyHome;
import com.css.sample.MyRemote;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.rmi.PortableRemoteObject;


public class MyClient {

/** Creates a new instance of MyClient */
public MyClient() { }

public static void main(String args[]) throws Exception {
Context ctx = new InitialContext();

Object objRef = ctx.lookup("MyBean");

MyHome home = (MyHome) PortableRemoteObject.narrow(objRef, MyHome.class);

MyRemote remote = home.create();
String name = remote.printName("Test");
System.out.println("Name : " + name);
}
}



ejb-jar.xml
-------------

<?xml version="1.0" encoding="UTF-8"?>
<ejb-jar version="2.1" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd">
<display-name>MySampleEjbBean</display-name>
<enterprise-beans>
<session>
<display-name>MyEjbBean</display-name>
<ejb-name>MyEjbBean</ejb-name>
<home>com.css.sample.MyHome</home>
<remote>com.css.sample.MyRemote</remote>
<ejb-class>com.css.sample.MyEjb</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
</session>
</enterprise-beans>
<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>MyEjbBean</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>NotSupported</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar>


jboss.xml:
----------
<?xml version="1.0" encoding="UTF-8"?>
<jboss>
<enterprise-beans>
<session>
<ejb-name>MyEjbBean</ejb-name>
<jndi-name>MyBean</jndi-name>
<configuration-name>Standard Stateless SessionBean</configuration-name>
</session>
</enterprise-beans>

I dont know where the problem occurs. Please help.
</jboss>
Hi,

I have a problem in converting my jar files into executables on linux platform. I need them to be converted to .bin like the .exe. Your valuable insights on this are welcomed.


Thanks
Bunty Paul
16 years ago
I have a requirement where i need to invoke the native "PRINT DIALOG" that should display the application name, where on invoking the application from the dialog the contents should be written to a PDF file.

Now my problem is that i am not able to invoke the native print dialog and i don't know how to bring my java program to be displayed in the native dialog as a virtual printer.

i am using jdk1.6 and working on platform Fedora 4.

Please help me in this

Thanks
16 years ago
Hi,

I am using NetBeans 6.0 and developing some sample desktop applications with the data binding functionalities provided by NetBeans 6.0. My Probelm is i am able to bind textfields, checkboxes but i am not able to bind radio buttons to the entity bean.

The entity bean type for the JRadio Button is boolean.

Can anybody help me out in this.

thanks
Hey, I have figured out the solution.

Thank me, there was a solution.


just set the theme attribute of the form to the value 'simple'.

for example:

<code>
<s:form action="myaction.do" theme="simple">
</code>

It's that simple !!!
16 years ago
Thank you Reda Mokrane.

It helps, for actionerrors. But i need to change my fielderrors to actionerrors. And that definitely gives me pain.

Ok thats how the struts 2 has been designed. What can we do? Oops!
16 years ago
I did some validation for the fields in my JSP using struts 2 taglib.
It uses field validator which displays the actionerrors above every field.

But i want to specify that actionerrors be displayed only at the top of the page. How can i do this.
16 years ago
I did some validation for the fields in my JSP using struts 2 taglib.
It uses field validator which displays the actionerrors above every field.

But i want to specify that actionerrors be displayed only at the top of the page. How can i do this. Anyone using struts 2 could help me and thanks.
16 years ago
We are developing an application and are planning to use Hibernate. But few are suggesting to go for EJB. The application basically contains adding new records, editing, removing, searching etc. So which one should i go for and can you also tell me about the performance of each. Application will be deployed using JBoss 4.5.

Thanks
Bunty Paul.

Originally posted by Jesper Young:
Can you explain in more detail what you want to do? Do you want to store passwords in a database or file or somewhere else in encrypted form?

One technique that is used very frequently (for example, it is how most versions of Unix store passwords of user accounts in the file /etc/passwd) is the following:

Instead of storing the password itself, you store a "digest" of the password. There are several different algorithms to create the digest, for example SHA and MD5. Those digest algorithms are one-way algorithms: you can encrypt data with them, but it is not possible to decrypt it (you can't get the original data back out of the digest).

When someone logs on to your system, the user types in his or her password. Your program now computes the digest of the password that the user typed in, and compares that digest to the digest in the database. If the two are the same, then the correct password was typed in.

So you see, the trick here is that if you know the digest, you don't know the password, because the algorithm only works one way.

Java has methods to compute digests over data: see the class java.security.MessageDigest.



I want to store the pasword in a mysql database table in encrypted form.
Again i need to decrypt whenever i need, for example during password verification
I want some encryption and decryption program in java using any algorithm.
I have got lot of encryption methods through google but have not got any decrypion algorithm
17 years ago
Hi,


Can somebody help me out in encryption and decryption of a password?
17 years ago

Originally posted by Jesus Angeles:
May I ask why you want to have further jsp processing on that scenario?



Thats the requirement for the project i am working on.
17 years ago
JSP
I have a problem . I have a screen where when i press a button it goes to the servlet , and there i am constructing a rtf or pdf file , then writing to the output stream and closing it. But after that i want to go back to the same jsp and display some message .

response.setContentType("application/text");
response.setHeader("Content-Disposition",
"inline; filename=\"" + "test.pdf" +"\"");
response().setBufferSize(100*1024); //100KB

OutputStream fos;
fos = response().getOutputStream();
BufferedOutputStream bos = new BufferedOutputStream(fos);
bos.write(data.toString().getBytes());
bos.flush();
bos.close();

after this i have to forward the response to jsp.

I get the exception : java.lang.IllegalStateException: Cannot forward after response has been committed

I am using struts framework.

I know a response cannot be forwarded to jsp after closing the stream

but still i want to acheive this requirement somehow.

is there any other way of doing it. i believe nothing is impossible
17 years ago
JSP
Thanks all, thats the way i wanted.
17 years ago
JSP
But is there any way i can achieve this...

1) I have to restrict users from directly accessing images folder

2) I should be able to display this image through my JSP
17 years ago
JSP