Servlets and EJBs in weblogic 5.1
Me somebody can say like communicating servlet that this in a machine with Weblogic 5,1 with a EJB in another machine also with weblogic5.1
When trying gives it to me Comunication Exception .
But if I have the 2 in the same machine it works well
We have the same scenario and had the same CommunicationException.
We had the remote & home interfaces of the ejb and the helper classes
avaliable
to the server#1 , and still encountered the following CommunicationException
Tue Feb 06 17:53:54 GMT+05:30 2001:<I> <ServletContext-General>
scripInfoServletWAP25:
ScripInfoServlet.init()javax.naming.CommunicationException [Root exception
is weblogic.rmi.UnmarshalException: Unmarshalling return
- with nested exception:
[java.lang.ClassNotFoundException: class
ITS.beans.order.ScripInfoSessionEJBHomeImpl_ServiceStub previously not
found]]
Tue Feb 06 17:53:54 GMT+05:30 2001:<E> <ServletContext-General> Servlet
failed with Exception
javax.servlet.ServletException: javax.naming.CommunicationException [Root
exception is weblogic.rmi.UnmarshalException: Unmarshalling return
- with nested exception:
[java.lang.ClassNotFoundException: class
ITS.beans.order.ScripInfoSessionEJBHomeImpl_ServiceStub previously not
found]]
at ITS.wap.ScripInfoServletWAP25.init(ScripInfoServletWAP25.java:83)
at
weblogic.servlet.internal.ServletStubImpl.createServlet(ServletStubImpl.java
:390)
at
weblogic.servlet.internal.ServletStubImpl.createInstances(ServletStubImpl.ja
va, Compiled Code)
at
weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.jav
a:338)
at
weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.java:16
4)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
:99)
at
weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImp
l.java:742)
at
weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImp
l.java:686)
at
weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContext
Manager.java:247)
at
weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:361)
at weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:261)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled Code)
Only when the jar file was made available to the server#1(i.e. present in
weblogicclasspath but not deployed) was the servlet on server#1 able to call
the ejb on server#2.
When calling the ejb through a Java Application or through a servlet
deployed on the same server as the ejb,
the stub classes are not required to be specified in the weblogicclasspath.
Has anybody else encountered a similar situation?
Thanks in advance.
Aparna
"Cameron Purdy" <[email protected]> wrote in message
news:[email protected]...
> You can have a Servlet on server #1 talk to an EJB on server #2. It is
> accomplished by having the client classes for the EJB available to the
> Servlet on server #1 and using JNDI on server #1 to get initial context
for
> server #2 and using that to look up the EJB.
>
> (Sorry, no habla espanol.)
>
> --
> Cameron Purdy
> Tangosol, Inc.
> http://www.tangosol.com
> +1.617.623.5782
> WebLogic Consulting Available
>
>
> "Javier Fdez" <[email protected]> wrote in message
> news:[email protected]...
> >
> > Me somebody can say like communicating servlet that this in a machine
with
> Weblogic 5,1 with a EJB in another machine also with weblogic5.1
> > When trying gives it to me Comunication Exception .
> > But if I have the 2 in the same machine it works well
>
>
Similar Messages
-
Servlet and EJB on different machine: Security propagation
Hi all,
I have an application, where my servlets and EJBS are deployed on the same machine.So
when in my servlet a user need to authenticate himself, security credentials are
propagated to the EJB automatically.I'd like to know in the case where the components
are on different machine if I need to put the credential in my InitialContext
when my servlet calls my EJB or if it is also done automatically.
Cheers
romainSay your stub is in a jar called stub.jar.
You need to put that stub somewhere that it can be reached through a protocol for which Java has a URL type - so you can put it on a shared file system and use a file URL or behind an http server and use an http URL.
Let's use http - put stub.jar at the docroot of a web server.
Then, when you start your SERVER code, include this VM parameter:
-Djava.rmi.server.codebase="http://<serveraddress>stub.jar"
Now your client will be able to use http to load the stub file out of stub.jar through http.
If you do use a file URL, make sure the shared directory you put your jar in is not on the client's classpath. -
JNDI tree access for code outside servlets and EJBs and JSPs
Can code outside EJBs, Servlets and JSPs have access to the JNDI tree?
For example, in a web application, web.xml has a env-entry declaration which I want to access from a POJO which is called by a JSP in the web app. Is this permissible?Can code outside EJBs, Servlets and JSPs have access
to the JNDI tree?
For example, in a web application, web.xml has a
env-entry declaration which I want to access from a
POJO which is called by a JSP in the web app. Is
this permissible?Yes. Read the JNDI tutorial. -
When to Use Servlet only, EJB only and, both Servlet And EJB???
I have a question, If I want to build a Web application. Sometime i found that there is no need to use EJB as Servlet already provide that functionality.
Can anyone tell me when do I use Pure Servlet? When do I use Pure EJB and, When do I use Both EJB and Servlet???
I am very interesting in it.
Thanks.
JackEJB and servlets are two different things. Trying to compare them doesn't really make sense. A web application is always going to need some way to process Http requests and this in Java is done accomplished through Servlets (or jsp pages which in turn also use servlets).
EJBs are the basis of distributed cross-platform objects. They are handled through name services and stored in databases. An Entity Bean can be "brought back to life" as long as it's info is stored in a database. Regardless of a server being restarted. All this database support behind an Entity Bean (transactions, queries etc.) are very transparent to the programmer. They are provided by the EJB vendor.
The class properties of a Servlet (or class-level member variables) are shared among all requests (running thread instances of the service method). That's why they should be used with a lot of caution. This feature can be very useful but if used improperly can also be very vulnerable to security and synchronization issues.
I'm not an EJB expert but this explanation should give you some idea of what EJBs are all about. -
Servlet jndi lookup to remote EJB, servlet and EJB not in the same application
Hi,
I think that the subject explain my problem.
I have Oracle IAS9i 9.0.2.0.0, and JDeveloper 9.0.2.829
I have deployed and EJB in IAS9i and i want to use from the developer machines, which have JDeveloper.
how can i to do remote calls from JDeveloper?.
I have modifed the orion-application.xml, and added remote=true.
I have modifed the rmi.xml and added the hosts where the Jdeveloper placed.
Any ideas?
Thanks and cheers
P.D The app server and jdeveloper are in the same net.
if it is posible replys me to [email protected] too.Steps to access a remote EJB from within OC4J
++++++++++++++++++++++++++++++++++++++++++++++
1) Deploy EJB application (ApplicationRemote) to remote container (REMOTE)
"java -jar admin.jar -deploy ormi://REMOTE.hostname:REMOTE.port REMOTE.username REMOTE.password -deploy -file ApplicationRemote.ear
-deploymentName ApplicationRemote"
2) Ensure that local application (ApplicationLocal) has ejb-ref tags for remote EJBs accessed (in web.xml or ejb-jar.xml)
3) Deploy to local container (LOCAL) an empty application (ApplicationEmpty) with the same name as the remote application (ApplicationRemote)
"java -jar admin.jar -deploy ormi://LOCAL.hostname:LOCAL.port LOCAL.username LOCAL.password -deploy -file ApplicationEmpty.ear -deploymentName
ApplicationRemote"
5) Deploy local application (ApplicationLocal) to local container (LOCAL)
"java -jar admin.jar -deploy ormi://LOCAL.hostname:LOCAL.port LOCAL.username LOCAL.password -deploy -file ApplicationLocal.ear -deploymentName
ApplicationLocal"
4)Restart local container
ApplicationEmpty should consist of just an application.xml file - no modules. The same file can be deployed with different application names for all the remote
applications that must be accessed.
ApplicationLocal should access the remote EJB by using the following JNDI properties
java.naming.factory.initial = "com.evermind.server.rmi.RMIInitialContextFactory"
java.naming.provider.url = "ormi://REMOTE.hostname:REMOTE.port/ApplicationRemote"
java.naming.security.principal = "REMOTE.username"
java.naming.security.credentials = "REMOTE.password"
regards
Debu Panda -
Hi,
My question, is possible to access from servlet some EJB through EJB's local interface, even these participate two different containers?
Regards
KrzysztofI am not that good with EJB , but I donot think so
EJB Local interfaces only work from othe EJB's AFAIK, -
Shared utility class file among servlets and Ejb
I have the following context:
XXX.war:
WEB-INF\
Jsp files
WEB-INF\classes\
WEB-INF\lib\
WEB-INF\web.xml
WEB-INF\weblogic.xml
YYY.jar
META-INF\
Class files
META-INF\ejb-jar.xml
META-INF\weblogic-ejb-jar.xml
In XXX/WEB-INF/classes/…/Util.class
In YYY/util.class
How can I share Util.class between both XXX and YYY?
Cheers,If you are on 8.1 check out
http://e-docs.bea.com/wls/docs81/programming/classloading.html#1069420
The larger document talks about how classloading works in Weblogic
Dave
<mehdi valizadeh> wrote in message news:[email protected]..
I have the following context:
XXX.war:
WEB-INF\
Jsp files
WEB-INF\classes\
WEB-INF\lib\
WEB-INF\web.xml
WEB-INF\weblogic.xml
YYY.jar
META-INF\
Class files
META-INF\ejb-jar.xml
META-INF\weblogic-ejb-jar.xml
In XXX/WEB-INF/classes/???/Util.class
In YYY/util.class
How can I share Util.class between both XXX and YYY?
Cheers, -
Co-location optimization between servlet and ejb?
Find some similar posting in archive, but answers confused me.
If I implement a sesion bean in WL6.1 with remote interfaces and call that session bean from the web tier (i.e. servlet) that is located in the same WL server, will co-location optimization occur.
Some previous posting suggested optimization only occurs within the same classloader. My understanding is servlet have a different class loader than the EJB.
So will co-location optimization still occur?
Thanks
Joe Wroblewski"Joe Wroblewski" <[email protected]> wrote in message news:32319370.1096294137900.JavaMail.root@jserv5...
Find some similar posting in archive, but answers confused me.
If I implement a sesion bean in WL6.1 with remote interfaces and call that session bean from the web tier (i.e.servlet) that is located in the same WL server, will co-location optimization occur.
>
Some previous posting suggested optimization only occurs within the same classloader. My understanding is servlethave a different class loader than the EJB.
>
So will co-location optimization still occur?In case of a servlet you will have co-location optimization if the ejb-jar and the war are in the same ear. Then was
will inherit EJB classsloader. If it's not the case, pass-by-reference is not possble.
Regards,
Slava Imeshev -
Problems deployment servlet and ejb
Hello,
I'm Having the following problem hopefully someone can help me.
I'm working in a visualcafe 4.5 project and I have to external jar
files
one containing an EJB the other cotaining some classes.
testservlet.war : deployed by VC
ejb.jar
xxx.jar
Deploying from VC is no problem but when I want to start the
server it can not find some classes which are in the xxx.jar file
containing the classes. But when I open the xxx.jar I see that they
are located in WEB-INF/classes.
My first Idea is that it could be a classloader problem
In the startweblogic.cmd I add the testservlet.war to the classpath
(Project options)
In the ejbc additional classpath entrys of the testservlet.jar I add
the xxx.jar.
In the server additional classpath I added both ejb.jar and the
xxx.jar
can someone tell me where it is going wrong???
Thanks
Oskar
Depoly them both in an EAR file. You will have to edit the Class-Path: property in each of the MANIFEST.MF files to make the proper path to the Singleton visible to all three, as well.
-
Hi,
I don't know if this is an appropriate question to ask for this class as it's not
workshop
specific. I was wondering how will I decide when it is appropriate to use a web
service as opposed to say servlet or an EJB for my application? What is a good
rationale to use?
Thanks,
SadhanaHi Adam,
Thanks a lot for giving such a lucid explanation of my vague question!
I understand now the difference between when to use EJBs/Servlets/Web Services.
Thanks again!
Sadhana
"Adam FitzGerald" <[email protected]> wrote:
>
Hi Sadhana,
Web service versus Servlet versus EJB. Which one to use? That is a very
good question.
EJBs should be the core desription and processing of your business rules.
They generally
have good performance, are easy to integrate into your security set up but
they require
access using the RMI-IIOP protocol. This means that generally EJBs are not
accessible
outside of your firewall and their clients have to be written in Java (other
enterprise
objects or applets or GUI applications).
Servlets often form a web-based front end to EJBs. They also have good performance,
integrate into security and only require HTTP access. This means they are
accessible
outside your firewall and any client with a HTTP or web API can call on
them, however,
there is no standard contract or rules for this type of interaction so you
will need
provide direct input into development of the client.
Web services are also accessible via HTTP and so can be accessed from outside
your
firewall. In fact, Web services internally within Workshop and WebLogic
actually
operate by using servlets and EJBs but the main advantage is that the mechanism/contract
for interacting with the web service is a well defined standard (WSDL) and
can actually
be registered or retreived dynamically (UDDI). Since web service standards
are open,
most popular programming languages already provide client APIs to interact
with them
thus freeing the web service developer from direct interaction with the
client developer
and letting the client be developed on any platform. The penalty for this
openness
is a small performance hit (XML translation) and a slowly maturing security
model.
So in summary, use EJBs for business operations that have Java clients within
your
enterprise, use servlets to provide web style access to your business operations
(like web pages) and use web services to enable automated clients that can
be written
on any platform either inside or outside your enterprise (firewall). In
fact, it
is common to write the EJB first and then to expose some parts of it outside
of your
enterprise by writing a web service wrapper (maybe using the EJB controls
that we
saw in class).
I hope this helps.
Adam
"Sadhana Jain" <[email protected]> wrote:
Hi,
I don't know if this is an appropriate question to ask for this class as
it's not
workshop
specific. I was wondering how will I decide when it is appropriate to use
a web
service as opposed to say servlet or an EJB for my application? What is
a good
rationale to use?
Thanks,
Sadhana -
What do I need to compile and run Servlets and JSP?
Hi there,
What do I need to run Servlets and JSP? I am developing on a Windows platform.
As far as I know, Tomcat and JDK is needed. My JDK (1.3rc1) cannot seem to compile servlet files (javax.servlet.* not found)
Can anyone please advise?
Thank you in advance.If you mean "in a month", then the answer is "afaik, no.", sorry.
If you need something comfortable, you better should buy one of these heavy-weighters like Weblogic, or WebSphere. Cost some $$$$'s, though (between 2000-10000. I guess).
For servlets (and ejb's too), there is no "easy and quick" solution. You probably should think about buying a freelancer or such, which already has the appropriate know-how. -
Classes, Stateful EJBs and EJB Container
Hi,
We have several doubts about classes, servlets, and EJBs.
We have been told that the instance of non-static classes from JSPs or servlets
can be a problem if we have a big number of clients connecting to weblogic (or
any other app server). Would it be a problem? Is it a better practice to instantiate
those classes from EJBs?
We have been told that EJBs are managed by the EJB container, and it uses a pool
for serving them to clients, passivating and activating them. This would include
the classes instantiated inside them. Is it true?
If all our guesses are true, the better way to implement a search with pagination
would be a stateful EJB, using handlers to save it in the client's session. But
we've heard that stateful EJBs are really bad for server's perfomance. Is it true?
We are using Weblogic 7.0. If so, what are they useful for???
If they can be a problem, how to build that searching using stateless EJBs?
Best regards,
Ignacio SanchezYou're right, the concrete tag to use seems to be:
<replication-type>InMemory</replication-type>
Anyway, do you have any further explanation on Stateful's behaviour with many
clients and pagination implementation?
"Stanley Beamish" <[email protected]> wrote:
>
"Ignacio Sanchez" <[email protected]> wrote in message
news:[email protected]...
Thanks for your replies.
Anyway, I still have some questions about stateful EJBs. In a clusteredenvironment,
we've been told that stateful EJBs are only balanced before create()method. So,
if we have already "created" the Remote interface, we're using it,and the
server
fails and must be balanced to another instance, what will happen? Willwe
lost
that Remote interface and data included in it?
Not necessarily, you can enable replication, which means that your stateful
EJB's state (values of i-vars) can be replicated across nodes in a cluster.
Search through the WLS cluster documentation for details.
SB
And about your suggestion on pagination using stateless. Could youplease
explain
it in more detail? I haven't understood it well.
Thank you very much for your attention.
"Sri" <[email protected]> wrote:
Hi,
Look below for my coments.
S
"Ignacio Sanchez" <[email protected]> wrote:
Hi,
We have several doubts about classes, servlets, and EJBs.
We have been told that the instance of non-static classes from JSPsor
servlets
can be a problem if we have a big number of clients connecting to
weblogic
(or
any other app server). Would it be a problem? Is it a better practice
to instantiate
those classes from EJBs?It all boils down to your architecture. If you have a lot of clients
connecting
to web container then and if each client needs objects stored in session
then
you have to refactor your object distribution. But this could be avoided
by separating
static content from dynamic content (using proxies, load balancersetc),
having
more web containers etc. It's not necessary to instantiate these classes
in EJBs
always (then you are increasing your memory footprint). The generalguidelne
is
to do more heavy duty work as you go deeper into tiers hopefully handling
less
connections etc.
We have been told that EJBs are managed by the EJB container, and
it
uses a pool
for serving them to clients, passivating and activating them. Thiswould
include
the classes instantiated inside them. Is it true?
True.
If all our guesses are true, the better way to implement a search
with
pagination
would be a stateful EJB, using handlers to save it in the client'ssession.
But
we've heard that stateful EJBs are really bad for server's perfomance.
Is it true?
We are using Weblogic 7.0. If so, what are they useful for???
True if misused as stateful EJBs, just like HTTP sessions could bereplicated
and could be activated/passivated.
If they can be a problem, how to build that searching using stateless
EJBs?
You could cache searchs and pass identity and page numbers to theSLSB.
Best regards,
Ignacio Sanchez -
How to debug serlvet and EJB using IDE
Anybody knows how to debug Servlet and EJB through standard IDE, like
Symantec or VisualAge? Does the attach to process works?
Thanks.1) Download and install the jpda package from sun (Java Platform Debugger
Architecture, it contains the jdwp.dll, this has to be in your %PATH%
variable).
2) Start weblogic with something like this:
%JDK_HOME%\bin\java -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y
,address=8000 -ms64m -mx64m -Xbootclasspath:%JAVACLASSPATH% -classpath
%WEBLOGICHOME%\classes\boot -Dweblogic.class.path=%WEBLOGICCLASSPATH% -Dwebl
ogic.home=%WEBLOGICHOME% -Dweblogic.system.name=MyServer -Djava.security.man
ager -Djava.security.policy==%WEBLOGICHOME%\weblogic.policy weblogic.Server
3) address is the portnumber (in this example 8000) for the remote debugger.
Attach to the VM with arguments -host <hostname> -port <address>
-Falk
"test" <[email protected]> wrote in message
news:8frkq6$ru5$[email protected]..
Anybody knows how to debug Servlet and EJB through standard IDE, like
Symantec or VisualAge? Does the attach to process works?
Thanks. -
Web Services - Servlets vs EJBs
Hi,
Looking for any suggestions about the benefits of using either servlets or EJBs as web service endpoints. Very early in the design of any application, I wish to expose my business logic components as web services, is there any particular benefit to using a specific approach (i.e. using either EJBs or Servlets as the end points of the web services exposing the business logic)?
This is a totally new application so I have no considerations towards reusing old EJB code, etc. My initial thoughts favour using servlets, if only because it reduces the complexity / resources required for the application server (i.e only Web-container required, rather than Web & EJB container).
Any thoughts please?Why do Servlets not scale as well? Surely they are
more "lightweight" than an EJB (which has all theRMI
overhead), and wouldn't it ultimately be down tothe
underlying app server anyway?Right, but servlets are just HTTP request listeners.
They aren't components, they aren't transactional,
they don't handle persistence, they don't have
naming services, they don't have queuing services.
The EJB container offers you a lot.
With that said, it's not just a choice between
servlets and EJBs. You can use POJOs and avoid EJBs
altogether if you do it right.
Or choose the best of both worlds and mix 'n match as needed.
Noone forces you to choose one over the other (at least not for any technical reasons, I'm not diving into corporate politics here).
My thought was that web services were a better wayto
expose business logic than EJBs, but if there some
solid reason why this isn't the case I like toknow.
Web services - lightweight? Maybe that's true of
REST, but certainly not SOAP. There's an argument
that says services are more heavyweight than EJBs,
because all the XML on the wire is an expensive
protocol.
SOAP is heavy on the network, but it's essentially a rather thin layer on top of other services (if properly architected).
For example we have a SOAP layer exposing a Spring application which proxies an EJB architecture.
Next to that SOAP layer sits a traditional web application (servlets) which itself has a Spring application sitting on top of it for demonstration and testing purposes.
And then there's an SDK allowing direct access to the Spring layer (and thus almost direct access to the EJB layer).
That's the beauty of a true open architecture, each component can be built on top of another and the component underneath can function just fine without it.
Look into Spring:
http://www.springframework.org
It's a lighter alternative to EJBs, and good plumbing
for any Java EE app.While Spring can serve as an alternative for EJB in places where EJB are overkill it's of course not in competition with it.
Spring is a service layer, making use of other technologies (like EJB, like AOP, like ORM) to provide data and other services (like Struts, like JSF, like JSP) to provide that data to requesters. -
Servlets and java.util.concurrent
Hey --
I know one is not supposed to spawn their own threads from Servlets and EJBs, but is it also 'bad form' to use Callables from a Servlet or EJB? If not can something similar be done safely?
I need to be able to (a) submit a file to be processed (b) give the user back a 'got it, will work on it' response, (c) let the user see the status of his 'job' and (4) open the results when complete.
The file processing would be running outside of the normal send request/return response path which is, of course, a synchronous process. I don't see a way, other than spawning a thread in that servlet (or another servlet which manages the 'jobs') to provide for 'long running processes.'
Thanks for any insight.
- Z -
Message was edited by:
zelmakHey --
I know one is not supposed to spawn their own threads from Servlets and EJBs, but is it also 'bad form' to use Callables from a Servlet or EJB? If not can something similar be done safely?
I need to be able to (a) submit a file to be processed (b) give the user back a 'got it, will work on it' response, (c) let the user see the status of his 'job' and (4) open the results when complete.
The file processing would be running outside of the normal send request/return response path which is, of course, a synchronous process. I don't see a way, other than spawning a thread in that servlet (or another servlet which manages the 'jobs') to provide for 'long running processes.'
Thanks for any insight.
- Z -
Message was edited by:
zelmak
Maybe you are looking for
-
Client threads block forever in SSLSocketImpl.startHandshake
Hi -- We have an application which has 4 threads polling a webservice over HTTPS every 1-2 minutes. We don't control the server platform or webservice framework. We've encountered a problem where one by one the threads stop polling. This has occurred
-
Hi, I have installed OBIEE and I am trying to edit the default repository. My machine also has the 10g client installed. I have created an ODBC Data Source to a 10g database. In the repository it is possible to load the table definitions into the phy
-
Have to reinstall iTunes each time I want to sync
So I upgraded all my software and finally got my iPad 2 to sync, but now I have to reinstall iTunes each time I want to sync either my iPad or my iPod. It's not as much of a hardship as some of the folks are having in these discussions but it doesn't
-
Table descriptions vanish when ADO dataset is converted
Hi there, with this coding I am able to read an ADO dataset and add the included tables (together with their fields) to the report. Unfortunately, if the tables in the ADO dataset had descriptions (added as alias), these texts are gone once I have co
-
$PTWSCLIENTREF Displayed in Portlet
In our production environment, a .NET portlet displays $PTWSCLIENTREF at the top. This does not occur in our dev environment. Both setups are running Portal 5.0.2 and .NET web controls 2.1 Beta. I haven't been able to track down why this is displayin