Win a copy of Rust Web Development this week in the Other Languages forum!

Conan King

Greenhorn
+ Follow
since Aug 31, 2003
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 Conan King

Hi

I have a strange problem, Am trying to build a ejb 2.1 project in maven. we use Weblogic 9.2 server and the ejb components use annotations.

Using Ant build xml the following code runs fine and generates the home and remote interfaces:

<path id="dependencyfinder">
<pathelement location="${BEA_HOME}/jdk150_06/lib/tools.jar"/>
<pathelement location="${BEA_HOME}/weblogic92/server/lib/weblogic.jar"/>
<pathelement location="${BEA_HOME}/weblogic92/server/lib/webservices.jar"/>
<pathelement location="${BEA_HOME}/weblogic92/server/lib/wls-api.jar"/>
<pathelement location="${BEA_HOME}/weblogic92/server/lib/api.jar"/>
</path>



<taskdef name="ejbgen" classname="com.bea.wls.ejbgen.ant.EJBGenAntTask">
<classpath refid="dependencyfinder"/>
</taskdef>
<target name="ejb-generate">
<ejbgen source="1.5" outputDir = "C:\workspace\eclipseworkspace\demoEJB\testEJB\.apt_src"
descriptorDir = "C:\workspace\eclipseworkspace\demoEJB\testEJB\src\main\java\META-INF"
forceGeneration = "true">

<fileset dir="C:\workspace\eclipseworkspace\demoEJB\testEJB\src\main\java" includes="**/*Bean.java" />
</ejbgen>
</target>


However the same thing called from maven gives compilation errors due to annotations:

Maven code:


<configuration>
<tasks>

<path id="dependencyfinder">
<pathelement location="${BEA_HOME}/jdk150_06/lib/tools.jar"/>
<pathelement location="${BEA_HOME}/weblogic92/server/lib/weblogic.jar"/>
<pathelement location="${BEA_HOME}/weblogic92/server/lib/webservices.jar"/>
<pathelement location="${BEA_HOME}/weblogic92/server/lib/wls-api.jar"/>
<pathelement location="${BEA_HOME}/weblogic92/server/lib/api.jar"/>
</path>

<taskdef name="ejbgen" classname="com.bea.wls.ejbgen.ant.EJBGenAntTask">
<classpath refid="dependencyfinder"/>
</taskdef>
<echo message="!!!EJBGEN - REMOTE / HOME GENERATION!!!"/>

<ejbgen source="1.5" outputDir = "${basedir}\.apt_src"
descriptorDir = "${basedir}\src\main\java\META-INF"
forceGeneration = "true">

<fileset dir="${basedir}\src\main\java" includes="**/*Bean.java" />
</ejbgen>

</tasks>
</configuration>

The error given is like this:

[JAM] Error: unexpected exception thrown:
com.bea.util.jam.internal.javadoc.JavadocParsingException: Parsing failure in C:\workspace\eclipseworkspace\demoEJB
.java at line 18. Most likely, an annotation is declared whose type has not been imported.

If anybody has faced such problems with annotations in ejb projects in WL 9.2 please let me know.
14 years ago
Hi Guys,

I need to build a ejb jar using maven2 project. Source would have only the ejb bean, home and remote interfaces. Intend to generate the stubs as well through the maven script if possible.

Could somebody suggest how this can be done.

Thanks Conan
14 years ago
Hi friends,

I am new to EJB s, have just started to study the HFE book. I have run the AdviceClient EJB module given in HFE in the RI server. However need some help to run the same in Websphere Studio Application Developer..
What I have is the bean, home and remote interfaces, the AdviceClient programme and also the ejb-jar DD configured.

Definitely, I need a web client (jsp or servlet) which would do the same job as the AdviceClient.java.. and also a JNDI configuration done.. Could somebody help with the steps required to run the bean in WSAD and get the advice messages once I run the jsp.



Regards
15 years ago
Hi friends,

I am new to EJB s, have just started to study the HFE book. I have run the AdviceClient EJB module given in HFE in the RI server. However need some help to run the same in Websphere Studio Application Developer..
What I have is the bean, home and remote interfaces, the AdviceClient programme and also the ejb-jar DD configured.

Definitely, I need a web client (jsp or servlet) which would do the same job as the AdviceClient.java.. and also a JNDI configuration done.. Could somebody help with the steps required to run the bean in WSAD and get the advice messages once I run the jsp.

Things can really be strange.. Well I have done as you had said and it is working absolutely fine.

Thanks a lot mate.
Hi,

I am going through the HF EJB book and was trying to run the AdviceClient.java program. Got this exception trying to run it. Could you suggest some reason why this exception is occurring.

******************************************
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.mapSystemExceptio
n(ShutdownUtilDelegate.java:137)
at javax.rmi.CORBA.Util.mapSystemException(Util.java:65)
at headfirst._Advice_Stub.getAdvice(Unknown Source)
at AdviceClient.go(AdviceClient.java:30)
at AdviceClient.main(AdviceClient.java:18)
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(NativeConstruct
orAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingC
onstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
at java.lang.Class.newInstance0(Class.java:306)
at java.lang.Class.newInstance(Class.java:259)
at com.sun.corba.ee.internal.iiop.messages.ReplyMessage_1_2.getSystemExc
eption(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(GenericPOACli
entSC.java:132)
at org.omg.CORBA.portable.ObjectImpl._invoke(ObjectImpl.java:457)
at headfirst._Advice_Stub.getAdvice(Unknown Source)
... 2 more
******************************************
I am not sure if we need to do it explicitly. I was studying the C:\j2sdkee1.3.1\bin\setenv.bat in the j2sdkee1.3.1 executables. There the j2ee.jar is added to the classpath.
setenv.bat is called by the j2ee.bat which we execute.

There should be something else wrong. Any suggestions.
Hi,

I am getting this error when I try to start the RI server. I am having JDK1.3 and j2sdkee1.3.1 in my system.

Error ***

Naming service started:1050
Exception in thread "main" java.lang.NoSuchMethodError
at com.sun.corba.ee.internal.corba.AnyImpl.createTypeCodeForClass(AnyIm
l.java:1256)
at com.sun.corba.ee.internal.iiop.ShutdownUtilDelegate.createTypeCode(S
utdownUtilDelegate.java:223)
at com.sun.corba.ee.internal.iiop.ShutdownUtilDelegate.writeAny(Shutdow
UtilDelegate.java:178)
at javax.rmi.CORBA.Util.writeAny(Util.java:80)
at org.omg.stub.com.sun.enterprise.naming._SerialContextProvider_Stub.r
bind(Unknown Source)
at com.sun.enterprise.naming.SerialContext.rebind(SerialContext.java:18
)
at com.sun.enterprise.naming.SerialContext.rebind(SerialContext.java:20
)
at javax.naming.InitialContext.rebind(InitialContext.java:370)
at com.sun.enterprise.naming.NamingManagerImpl.publishObject(NamingMana
erImpl.java:192)
at com.sun.enterprise.naming.NamingManagerImpl.publishObject(NamingMana
erImpl.java:149)
at com.sun.enterprise.server.J2EEServer.bindObject(J2EEServer.java:718)
at com.sun.enterprise.server.J2EEServer.createServerObject(J2EEServer.j
va:473)
at com.sun.enterprise.server.J2EEServer.run(J2EEServer.java:244)
at com.sun.enterprise.server.J2EEServer.main(J2EEServer.java:972)

Could one of let me know what has to be done to get this resolved. Do I need to add some jar to the classpath? Also I have set the JAVA_HOME and J2EE_HOME to proper values.
Thanks Jesus for the information. I am on our way.
Yaah I would like to bring up this topic, could somebody give the direct link to download the J2ee 1.3 api docs please.
Hello.

Seems like the downloaded exe is corrupt. There should not be any other reason. You may try downloading it again. Or maybe post the error message shown in here so that somebody can help.

Neways can you please give me the exact link from where you got this download. Bcoz I confused as well in all the links of SUN s download page.
Phew!! done with SCWCD today. One more ill planned venture of mine marginally avoiding failure again. Well wanted above 90% but happy with what I ended up with. Last few days were horrible since I had much to cover. Took HFS exam at 6 pm day before the actual exam. Gt around 70%, so I guess HFS + 20% some how keeps proving itself by some trick.

Well whatever, forgetting my mistakes let me share my suggestions with Javaranchers who would be goin for the exam shortly.

HFS is grtt, The more I read of this HFS series I can't stop enjoying and smiling. Thanks to BB and KS for such noble concepts, especially the %#*^ that is used through out the masterpiece(s).
One particular paragraph (pg 321) while explaining (or should I say confusing) the standard actions and non-standard actions. If only I knew who had the dirty brain to trouble all dear lil test takers like us .
But then end o day we do learn quite a lot from the book and possibly some impish ness as well to trouble fellow colleagues.

Ok enuf of that book. I made the mistake of taking the HFS exam as the last thing, but I am sure u guys wouldd nt do that mistake, After the exam 1 -2 rounds of quick revision really helps, bcoz u know what are the type of facts to really concentrate on.

Few questions in the exam were confusing and I am not sure even if I had prepared better I could have got them right. Gt 62 outta 69 correct. U wont get to know which questions exactly went wrong and it will remain a mystery.

Javaranch was as always a grtt help. LAck of mock exams for SCWCD could be a concern for people.

Well thats it, will keep lurking around the SCBCD forum henceforth.

Thanks to ya all!
Hi Sumathi,

Consider the following stages in the lifecycle of a servlet

1. Servlet class gets loaded into JVM on first request. This consists of loading Servlet class and calling the compiler supplied no argument constructor.

2. Container creates servletconfig object.

3. Then the init method is called and the servletconfig object is passed as argument to the init method.

4. Now onwards whenever a new request comes, a thread for the servlet is generated and service method for the servlet handles the request.

5. When the servlet is destroyed (by bringing down the server) the destroy() method is called.

Steps 1, 2, 3 take place only during the first request to the servlet, and 4 multiple times on each request

Now the reason you are possibly confused is because you read the statement that the servletconfig object is created only when the servlet is redeployed. This is true because the first 3 steps are not called on each request and and change in configuration parameters would need redeployment of servlet.

Hope this helps.
Yes I have included the taglib directive on the jsp. I am using Tomcat 5.0
I tried changing the url to an html in another application within the same container and it worked fine. However it is failing when I use an external URL in the internet.

I have a proxy setting in my browser for accessing the internet, not sure if that is why I am getting the error.
Hi,

I thought so. And tried with the same, However got this.

javax.servlet.ServletException: javax.servlet.jsp.JspException: Problem accessing the absolute URL "http://jakarta.apache.org/tomcat/index.html". java.net.ConnectException: Connection refused: connect
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:821)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:758)

Can any of u tell why this is happening?