Help coderanch get a
new server
by contributing to the fundraiser

woo hwang

Greenhorn
+ Follow
since Dec 13, 2006
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by woo hwang

Hi all,

I have a question about the Interface Sun provided.
When I implements RMI, I reliased that i need to thorw RemoteException for all method in the SUN provide interface.

What i am wondering is that can i change interface??
can i throw more exceptions in the sun provided interface?

Cheers
Thanks for an quick response.
It means that DBImpl class does not be an most front end facade in db package. right?

My new question is:
Where DBImpl should be sit on?
It will read a real database file anyhow. When reading processing is doing, It will bytes and create VO. and... return string?
I think it does not make sense to me.

Gui will call another facade class and it will call DBImpl which return String[]. the facade create new VO and return VO or List<VO> to GUI client.
Is it good decision? do you think?

NewFacade --> DBImpl --> DataFileAccess
read File and put field values into String[]
return String[] <--
<--
Create VO with value from String[]

<--retun VO to gui

Cheers mate.
Hi, all.

I have just started a SCJD. And i got a question in my mind.
Sun provides a interface called DB. Methods in there have returnValues and methods parameter as String[] which String array holds datas.

I am wondering that Do i need a Value Object to transfer data between Cilent and the server?

For the RMI networking.. Is String array able to be transfered?
If so, I do not need VO. right?
If not, can i create an anothere facade class to call DataAccess class?

Do i have only String[] return value? because i downloaded an assignemtn 2 years ago. I guess that mime is too old one. you guys one has object return value.

Cheers.
I have a problem with message likes

[java] org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: ejb3.Member.spreadsh
eets, no session or session was closed
[java] at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentC
ollection.java:358)
[java] at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationExceptionIfNotConnected(Abstr
actPersistentCollection.java:350)
[java] at org.hibernate.collection.AbstractPersistentCollection.readSize(AbstractPersistentCollection.java:97)
[java] at org.hibernate.collection.PersistentBag.isEmpty(PersistentBag.java:232)

I have 3 entities A,B and C with |A|1..*|B|1..*|C|
There are no problems in deployment time. But when i try to call a.getBs.add(b) i got a rpoblems above.

So i changed a fetchType on A's and B's OneToMany like FetchType.EAGER
And i got other problem

Problem starting service persistence.units:jar=MyEJB3.jar,unitName=MyEJB3
javax.persistence.PersistenceException: org.hibernate.HibernateException: cannot simultaneously fetch multiple bags

What i want to know is what kind exceptiona are above.
And what are the Eager and Lazy means exactly.

It does not have any problems in JBoss 4.0.3SP1.
It happens in 4.2.1 now.

i need you guys help
17 years ago
I doo not understand the meaning of LAZY and EAGER exactly.
I have a problem to deploy 2 entities bean with one to many relaionship.
On the one side, default vaule of fetchtype is lazy.
And i have a problem with this message on JBOSS 4.2.1
"org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: ejb3.Member.spreadsh
eets, no session or session was closed"

If i change the fatchtype to eager on the one side.. another problem is happened
javax.persistence.PersistenceException: org.hibernate.HibernateException: cannot simultaneously fetch multiple bags

|A| 1 ..* |B| 1..* |C|

how should i fix this? and what is exact meaning of fetch?
cheers
Thanks for your reply.
I make a MyEjb.jar
A simple Entity bean and persistence.xml file are within jar.

The content in persistence.xml is below
<persistence>
<persistence-unit name="MyEJB3">
<jta-data-source>java:/ejb3ProjectDS</jta-data-source>
<properties>
<property name="hibernate.hbm2ddl.auto"
value="create-drop"/>
</properties>
</persistence-unit>
</persistence>

There are no message in JBoss console.

If you do not mind.
Could you give me simple entity bean deplyment example.
What i really want to know is simple packaging structure for entity bean in JBoss.
cheers.
17 years ago
hi guys.
I used jboss4.0.3SP1 to deploy EJB3.0. however, it did not fully support EJB3.0. So i would like to use 4.0.5GA version.
When i use 4.0.3SP1, any xml files is not needed for packaging.
But.. i failed to deploy EJB3.0 in 4.0.5

How i package EJB3.0 for 4.0.5?
What other files(xmls) are needed for?
Any good and simple persistence example in web?

cheers
17 years ago
??
Is above reply for me?
Anyway thanks Satoru.
I am reading the HFEJB. But i think that it is hard to prac for Entity.
I just read read read.. and try to understand the concept of Entity bean.
I want to prac to connect the real DB and want to see what hapepn in DB.

What should i do for it?
So far i did a prac for advice only.

I am wondering that how do guys practice for Entity and messageDriven beans?
I have a qeustion about ejbActivate and Passivate.
In the HFEJB 203page, When ejbPassivate completes, every non-transient instance variable MUST be a reference to one of the following.
...
A resource manager connection Factory(DataSource)
...

and the next page

a JDBC connection is not Serializable, so if you have one, you must set it to null in ejbPassivate().

My Question is that .JDBC connection is not Serializable. But it is a resource manager connection factory. is it?

I am not english native speaker... so i might misunderstand of this concept.
The things on the list (203page) are fine for activation and passivation. so I do not care of them.
Except the list, I need to care. One of them is JDBC connection.

If i am right, What is a resource manager connection factory?

cheers.
Thanks...
It works now. However, what kind of thing should i care of?
the name of method was wrong?
Hi. guys.
I have a problem to run client. There were not any problem up to compile client.
After i run the client.... i got message below.
--------------------------------------------------------------------------
C:\SCBCD_PRAC\projects\advice>java -cp %J2EE_JARS%;AdviceAppClient.jar; AdviceClient
ic
look up the Advisor
cast
create
getAdvice
ERROR
java.rmi.RemoteException: CORBA BAD_OPERATION 0 No; nested exception is:
org.omg.CORBA.BAD_OPERATION: vmcid: 0x0 minor code: 0 completed: No
at com.sun.corba.ee.internal.iiop.ShutdownUtilDelegate.mapSystemException(ShutdownUtilDelegate.java:137)
at javax.rmi.CORBA.Util.mapSystemException(Util.java:65)
at headfirst._Advice_Stub.getAdvice(Unknown Source)
at AdviceClient.go(AdviceClient.java:25)
at AdviceClient.main(AdviceClient.java:10)
Caused by: org.omg.CORBA.BAD_OPERATION: vmcid: 0x0 minor code: 0 completed: No
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
at java.lang.Class.newInstance0(Class.java:308)
at java.lang.Class.newInstance(Class.java:261)
at com.sun.corba.ee.internal.iiop.messages.ReplyMessage_1_2.getSystemException(ReplyMessage_1_2.java:93)
at com.sun.corba.ee.internal.iiop.ClientResponseImpl.getSystemException(ClientResponseImpl.java:108)
at com.sun.corba.ee.internal.POA.GenericPOAClientSC.invoke(GenericPOAClientSC.java:132)
at org.omg.CORBA.portable.ObjectImpl._invoke(ObjectImpl.java:457)
at headfirst._Advice_Stub.getAdvice(Unknown Source)
... 2 more
--------------------------------------------------------------------
import javax.naming.*;
import java.rmi.*;
import javax.rmi.*;
import headfirst.*;
import javax.ejb.*;

public class AdviceClient {

public static void main(String[] arg) {
new AdviceClient().go();
}

public void go(){

try{
System.out.println("ic");
Context ic = new InitialContext();

System.out.println("look up the Advisor");
Object o = ic.lookup("Advisor");

System.out.println("cast");
AdviceHome home = (AdviceHome)PortableRemoteObject.narrow(o, AdviceHome.class);

System.out.println("create");
Advice advisor = home.create();

System.out.println("getAdvice");
System.out.println( advisor.getAdvice() );

}catch(Exception ex){
System.out.println("ERROR");
ex.printStackTrace();
}
}

}
---------------------------------------------------------------------------
i need a help.....
I am now for SCBCD. I ordered the HFEJB from Amazon.
I would like to install the software for EJB 2.0.
WHat i need to download?

sun-appserver7-2004Q2UR5-se-win.zip is correct file?

cheers.
Hi. guys
I want to take a SCBCD in next few weeks.
For the preparation, I want to buy a textbook for it.
There are several books in JavaRanch SCBCD Links.

Which book is best recommended for EXAM?
How about Head First?

I will take EJB 2.X.
I guess EJB3 is new and 2.X is the more useful in the IT industry.
I am just graduate so no idea for industry.
Anyone who work on EJB or J2EE give me advise which is useful to seek a job sooner or later.

Cheers!

(Sorry i am not native english speaker. I hope you understand what i want to say )
I am wondering the mandatory emements for taglib.
which are <tagb-version> and <short-name>.
There are not <short-name> in your code.
I hope it help you