OC4J's servlet and Weblogic's EJB problem
Hi all,
Is it possible to look up the weblogic.jndi.WLInitialContextFactory from servlet deployed into OC4J ?
I copied weblogic.jar and MyEJB.jar to \j2ee\home\lib and re-started OC4J.
When the servlet runs for the first time, I can see the following displayed:
java.lang.InternalError: error initializing kernel
at weblogic.kernel.Kernel.ensureInitialized(Kernel.java:86)
at weblogic.jndi.WLInitialContextFactoryDelegate.<init>(WLInitialContextFactoryDelegate.java:166)
at java.lang.Class.newInstance0(Native Method)
at java.lang.Class.newInstance(Unknown Source)
at weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialContextFactory.java:147)
at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.init(Unknown Source)
at javax.naming.InitialContext.<init>(Unknown Source)
at myServlet.doGet(myServlet.java:41)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:195)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:309)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:336)
at com.evermind[Oracle9iAS (9.0.2.0.0) Containers for J2EE].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:684)
at com.evermind[Oracle9iAS (9.0.2.0.0) Containers for J2EE].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:269)
at com.evermind[Oracle9iAS (9.0.2.0.0) Containers for J2EE].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:735)
at com.evermind[Oracle9iAS (9.0.2.0.0) Containers for J2EE].server.http.HttpRequestHandler.run(HttpRequestHandler.java:243)
at com.evermind[Oracle9iAS (9.0.2.0.0) Containers for J2EE].util.ThreadPoolThread.run(ThreadPoolThread.java:64)
Next time servlet's response is as follows:
500 Internal Server Error
weblogic.common.internal.VersioningError: No WebLogic packages defined in CLASSPATH
at weblogic.common.internal.VersionInfo.<init>(VersionInfo.java:39)
at weblogic.common.internal.VersionInfo.initialize(VersionInfo.java:77)
at weblogic.common.internal.VersionInfo.theOne(VersionInfo.java:63)
at weblogic.rjvm.t3.T3JVMConnection.connect(T3JVMConnection.java:106)
at weblogic.rjvm.t3.T3JVMConnection.createConnection(T3JVMConnection.java:164)
at weblogic.rjvm.Protocol.createConnection(Protocol.java:206)
at weblogic.rjvm.ConnectionManager.findOrCreateConnection(ConnectionManager.java:999)
at weblogic.rjvm.ConnectionManager.bootstrap(ConnectionManager.java:285)
at weblogic.rjvm.ConnectionManager.bootstrap(ConnectionManager.java:242)
at weblogic.rjvm.RJVMManager.findOrCreateRemoteInternal(RJVMManager.java:220)
at weblogic.rjvm.RJVMManager.findOrCreate(RJVMManager.java:188)
at weblogic.rjvm.RJVMFinder.findOrCreateRemoteServer(RJVMFinder.java:178)
at weblogic.rjvm.RJVMFinder.findOrCreate(RJVMFinder.java:149)
at weblogic.rjvm.ServerURL.findOrCreateRJVM(ServerURL.java:207)
at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialContextFactoryDelegate.java:311)
at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialContextFactoryDelegate.java:211)
at weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialContextFactory.java:149)
at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.init(Unknown Source)
at javax.naming.InitialContext.<init>(Unknown Source)
at myServlet.doGet(myServlet.java:41)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:195)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:309)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:336)
at com.evermind[Oracle9iAS (9.0.2.0.0) Containers for J2EE].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:684)
at com.evermind[Oracle9iAS (9.0.2.0.0) Containers for J2EE].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:269)
at com.evermind[Oracle9iAS (9.0.2.0.0) Containers for J2EE].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:735)
at com.evermind[Oracle9iAS (9.0.2.0.0) Containers for J2EE].server.http.HttpRequestHandler.run(HttpRequestHandler.java:243)
at com.evermind[Oracle9iAS (9.0.2.0.0) Containers for J2EE].util.ThreadPoolThread.run(ThreadPoolThread.java:64)
The 41th line of myServlet.java is as follows:
Context jndiContext = new InitialContext(env);
OC4J and Weblogic ara installed on the different computers.
The same myServlet.class deployed into other Weblogic (installed on the same computer as OC4J) works correctly.
What I did miss ?
SY,
Oleksandr Bozhyk
yes....if you are using only hibernate3.jar and no other jars from hibernate then you need this jars for hibernate to work.
antlr-2.7.6rc1.jar
asm.jar
asm-attrs.jar
cglib-2.1.3.jar
commons-collections-2.1.1.jar
commons-logging-1.0.4.jar
dom4j-1.6.1.jar
ehcache-1.1.jar
hibernate3.jar
jaas.jar
jaxen-1.1-beta-7.jar
jdbc2_0-stdext.jar
jta.jar
log4j-1.2.11.jar
ojdbc14.jar
xerces-2.6.2.jar
xml-apis.jar
if you are missing any of those, hibernate won't work.
You can check in MyEclipse which jars hibernate needs to run successfully. Just go under Window/Preferences, and there go under MyEclipse/Project Capabilities/Hibernate and select tab Hibernate 3.1 and under Library modules select Hibernate 3.1 Core Libraries, and you will see which jars hibernate need. ;)
Similar Messages
-
JBuilder 5 and WebLogic 6.1 Problem (1) ??
I use JBuilde5 and WebLogic 6.1 to develop a statusful session bean.
I use WLS default server
( -Dweblogic.Domain=mydomain -Dweblogic.Name=myserver ) to be our
application server.
First I add a EJB , and it seems successful.
After I use wizard to create a EJB Test Client , and want to test the
result.
The error happens in below :
javax.naming.NameNotFoundException: Unable to resolve NumberGDemo.
Resolved: '' Unresolved:'NumberGDemo' ; remaining name ''
at $Proxy46.lookup(Unknown Source)
at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:339)
at javax.naming.InitialContext.lookup(InitialContext.java:350)
at
numberguest.NumberGDemoTestClient1.<init>(NumberGDemoTestClient1.java:27)
at numberguest.Jsp1Bean.<init>(Jsp1Bean.java:5)
at jsp_servlet.__jsp1._jspService(__jsp1.java:93)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
:265)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
:304)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
:200)
at
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletCo
ntext.java:2495)
at
weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java
:2204)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)-- Calling
create()
-- Failed: create()
and I find the error line is Line 6 ( see below ) , lookup for NumberGDemo
in JNDI fail.
But If I change to use BEA example server
( -Dweblogic.Domain=examples -Dweblogic.Name=examplesServer ) , All is OK.
1. try {
2. //get naming context
3. Context ctx = getInitialContext();
4.
5. //look up jndi name
6. Object ref = ctx.lookup("NumberGDemo");
7.
8. //cast to Home interface
9. numberGDemoHome = (NumberGDemoHome) PortableRemoteObject.narrow(ref,
NumberGDemoHome.class);
10. }
11. catch(Exception e) { ... }
I think there are some setting I miss in WLS default server , Who can help
me to find the question answer ??
Thank in advance ....
Alan JangThank Chuck ...
Finally , I find the problem which is not the deployment in mydomain or
exampleserver
I find the problem is that JBuilder 5 can not deploy EJB fine into WLS6.1.
You should deploy EJB by using WLS6.1 console and then JNDI Lookup will
success.
If you do that , the same EJB redeployment thru JBuilder 5 afterward are all
fine,
That is why I always fail in mydomain but success in example server
because I have ever deployed the EJB by WLS6.1 console manually.
I think the deployment mechanism between WLS6.1 and WLS 6.0 is different.
"Chuck" <[email protected]> ¼¶¼g©ó¶l¥ó
news:3c3b4b6e$[email protected]..
>
Alan,
Given that it works in the 'examples' domain, are you sure you deployedthe jar
file that contains the EJB in the 'mydomain'? If it wasn't deployedsuccessfully
for the default 'mydomain' you would receive a failure on the JNDI lookup.
I would read thru some of our online documentation on jar deployments andthe
domain concepts - - here are some relevant links
http://edocs.bea.com/wls/docs61/programming/packaging.html#1054161
http://edocs.bea.com/wls/docs61/adminguide/overview.html#1030874 -
File upload using Servlets and Weblogic
Hi,
I need to write a servlet that can upload a .doc file to a folder on the server. Can someone please let me know abot the code i need to write, as i am a novice in servlets.
Thanks in advance
buddy0303Another, simpler (we think), such package is Jenkov HTTP Multipart File Upload. It's a servlet filter which can work in front of both servlets and JSP's. The servlet filter parses the uploaded file and stores it temporarily on the servers disk. When the servlet or JSP executes afterwards, it can obtain all the information about the file, from the request attributes. There is a decent manual for HTTP Multipart File Upload on the website.
Just search for "Jenkov HTTP Multipart" on Google and you'll find it. HTTP Multipart is free, open source, Apache Licsense. -
URLConnection and Weblogic 6.1 Problem
I am trying to create a URL connection to a secure site from within a JSP. This is the code I am using
try {
System.setProperty("java.protocol.handler.pkgs", "com.sun.net.ssl.internal.www.protocol");
URL url = new URL("https://secure2.mde.epdq.co.uk/cgi-bin/CcxBarclaysEpdqEncTool.e");
URLConnection conn = (URLConnection)url.openConnection();
conn.setDoOutput(true);
conn.setUseCaches(false);
conn.setRequestProperty("content-type", "application/x-www-form-urlencoded");
OutputStream outStream = conn.getOutputStream();
} catch(IOException e) {
e.printStackTrace();
}The problem is that when conn.getOutputStream() is executed I receieve a fatal handshake error. I am running the JSP on weblogic 6.1 with JDK1.3. I have added the JSSE libs and made the necessary changes in java.security.
I can run the same code as a stand-alone application (using jdk1.3 still) with no problems. However once deployed to weblogic 6.1 it crashes. It does work on WL 8.1 (but this is not an option).
I have enabled ssl debugging within WL and receive the following
####<28-Nov-07 17:15:05 GMT> <Debug> <SSL> <dt04230> <hwserver> <ExecuteThread: '12' for queue: 'default'> <> <> <000000> <Before license check - client CipherSuites: [3,9,8,0] server CipherSuites: [3,9,8,0]>
####<28-Nov-07 17:15:05 GMT> <Debug> <SSL> <dt04230> <hwserver> <ExecuteThread: '12' for queue: 'default'> <> <> <000000> <No SSL/Domestic License found>
####<28-Nov-07 17:15:05 GMT> <Debug> <SSL> <dt04230> <hwserver> <ExecuteThread: '12' for queue: 'default'> <> <> <000000> <After license check - client CipherSuites: [3,9,8,0] server CipherSuites: [3,9,8,0]>
####<28-Nov-07 17:15:05 GMT> <Info> <SSL> <dt04230> <hwserver> <ExecuteThread: '12' for queue: 'default'> <> <> <000000> <V2 client hello sent: version = 3.0, cipherSpecs = 4 {3, 9, 8, 0}, sessionID = 0 , challenge = 32 474da2196582eaff9b46529ac4ee36f563c13815a67e92bb385d72226f66ed7d>
####<28-Nov-07 17:15:05 GMT> <Info> <SSL> <dt04230> <hwserver> <ExecuteThread: '12' for queue: 'default'> <> <> <000000> <Decrypting 2 bytes...>
####<28-Nov-07 17:15:05 GMT> <Info> <SSL> <dt04230> <hwserver> <ExecuteThread: '12' for queue: 'default'> <> <> <000000> < Finished decrypting 2 bytes>
####<28-Nov-07 17:15:05 GMT> <Info> <SSL> <dt04230> <hwserver> <ExecuteThread: '12' for queue: 'default'> <> <> <000000> < Read throughput = Infinity bytes/sec>
####<28-Nov-07 17:15:05 GMT> <Info> <SSL> <dt04230> <hwserver> <ExecuteThread: '12' for queue: 'default'> <> <> <000000> <contentLen = 2, padding.length = 0, MAC.length = 0, len = 2>
####<28-Nov-07 17:15:05 GMT> <Info> <SSL> <dt04230> <hwserver> <ExecuteThread: '12' for queue: 'default'> <> <> <000000> <Available on alertStream: 2>
####<28-Nov-07 17:15:05 GMT> <Info> <SSL> <dt04230> <hwserver> <ExecuteThread: '12' for queue: 'default'> <> <> <000000> <Aborting session>
####<28-Nov-07 17:15:05 GMT> <Info> <SSL> <dt04230> <hwserver> <ExecuteThread: '12' for queue: 'default'> <> <> <000000> <Alert: fatal handshake_failure>
####<28-Nov-07 17:15:05 GMT> <Info> <SSL> <dt04230> <hwserver> <ExecuteThread: '12' for queue: 'default'> <> <> <000000> <Aborting session> I have not changed any of WL's keystores from the default settings but I would have thought it would use the standard java cacerts which is obviously fine as I ran the app stand-alone.
If any body has faced this issue or knows of a possible solution I would greatly appreciate any response.
ThanksAs you said, it could be the WLS6 truststore which doesn't contain the certificate authority. Just check which files are used (cacerts, cacerts.jks,..), and maybe you can find it by checking the option startup : -Dweblogic.security.SSL.trustedCAKeyStore
It doesn't matter when the exception is triggered (you can do an explicit handshake, or just write in the socket and then wait for an implicit handshake) -
Need some project titles that can be done in java servlets and jsp or ejb
I am final year cs engg student. I have completed course in java,j2ee. I have done the library management project in servlet. I need some project titles for my final year project. My interests includes, networking, desktop applications.
Saish wrote:
I'm not sure how to help other than to advise you will probably have the best success with something that interests you personally. You mention desktop applications and networking. Perhaps start with something Swing (or JavaFX) and perhaps use that to monitor a network, detect intrusions, dynamically load balance, etc. Really, it's whatever will stimulate you through a long project. If you have an idea in mind, but are having difficulties with how to come up with a spiffy title, then post more detail, and we can try and help.
- SaishThanks Saish for your nice response.
Whether It is possible to implement the cloud computing ? Is it possible ? -
Webcenter and weblogic for windows 7 64 bit
hi all,
I have laptop which has windows 7 64 bit
i want to install webcenter 11g and weblogic. i did not find 64 bit version. does any one know, where can i find 64 bit version download ?
thx
ddThere isn't realy a 64 bit version but you can use the 32 bit version.
I also have a laptop with windows 7 64 bit and i have installed webcenter and weblogic without any problems. -
Hi!
I need help. I'm working with OC4J 9.0.2.0.0a behind Apache. In my application a have to obtain data of DataBase and show it in a fdf. To do that i have done a class that obtains the data and a servlet that show it in a fdf using classes of Adobe. The Adobe jar's name is jFdfTk. The servlet runs ok at port 7777, but when i change to port 80 the fdf doesn't show data. I can't understand why.
Does anyone have the same problem??
Can anyone help me??
Does anyone know why??
Thanks!I see now that I can use the old method of JNDI
lookup with the 3rd party messaging from a web
container, I just can't use the java:comp/resource/MQSeries logical JNDI location.
document: oracle 9ias Container for J2EE,
Services Guide
Release 2(9.0.3)
Aug 2002
Part No A97690-01
Chapter 9 Page 9-2
I am having trouble with this statement;
The ResourceProvider interface enables you to plug in
third-party message
providers for JMS connections. For Oracle JMS, this
allows EJBs, servlets, and OC4J
clients to access many different queue
implementations.
(OK good so far,)
With third-party message
providers, only EJBS can access queue
implementations. The resources are available
under java:comp/resource/ as the default JMS
resources.
WHAT? I can't do asynchronous messaging from a web
App to a MDB with a 3rd party JMS implementation?
What gives?
Can someone tell me this is not true please -
Problem calling a method in a servlet witch returns remote ejb
Hi, I have a problem combining servlets ands ejbs, I expose my problem :
What I have :
1 . I have a User table into a SGBD with two attributes login and pass.
2 . I have a UserBean linked to User table with a remote interface
3 . I have a stateless UserSessionBean with a remote interface
4 . I have a UserServlet linked to a jsp page which allows me to add users
5 . I use Jboss
What is working ?
1 - I have a method newUser implemented in my UserSessionBean :
public class UserSessionBean implements SessionBean {
private SessionContext sessionContext;
private UserRemoteHome userRemoteHome;
public void ejbCreate() throws CreateException {
// Initialize UserRemoteHome
// Method to add a new user
public UserRemote newUser(String login, String password) {
UserRemote newUser = null;
try {
newUser = userRemoteHome.create(login, password);
} catch (RemoteException ex) {
System.err.println("Error: " + ex);
} catch (CreateException ex) {
System.err.println("Error: " + ex);
return newUser;
}2 - When I test this method with a simple client it works perfectly :
public class TestEJB {
public static void main(String[] args) {
Context initialCtx;
try {
// Create JNDI context
// Context initialization
// Narrow UserSessionHome
// Create UserSession
UserSession session = sessionHome.create();
// Test create
UserRemote newUser = session.newUser("pierre", "hemici");
if (newUser != null) {
System.out.println(newUser.printMe());
} catch (Exception e) {
System.err.println("Error: " + e);
e.printStackTrace();
Result : I got the newUser printed on STDOUT and I check in the User table (in the SGBD) if the new user has been created.
What I want ?
I want to call the newUser method from the UserServlet and use the RemoteUser returned by the method.
What I do ?
The jsp :
1 - I have a jsp page where a get information about the new user to create
2 - I put the login parameter and the password parameter into the request
3 - I call the UserServlet when the button "add" is pressed on the jsp page.
The Servlet :
1 - I have a method doInsert which call the newUser method :
public class UserServlet extends HttpServlet {
private static final String CONTENT_TYPE = "text/html";
// EJB Context
InitialContext ejbCtx;
// Session bean
UserSession userSession;
public void init() throws ServletException {
try {
// Open JNDI context (the same as TestClient context)
// Get UserSession Home
// Create UserSession
userSession = userSessionHome.create();
} catch (NamingException ex) {
System.out.println("Error: " + ex);
} catch (RemoteException ex) {
System.out.println("Error: " + ex);
} catch (CreateException ex) {
System.out.println("Error: " + ex);
protected void service(HttpServletRequest req, HttpServletResponse resp) throws
ServletException, IOException {
* Does insertion of the new user in the database.
public void doInsert(HttpServletRequest req, HttpServletResponse resp) throws
ServletException, IOException {
try {
// Get parameters to create the newUser
String login = req.getParameter("login");
String password = req.getParameter("password");
// Create the newUser
System.out.println("Calling newUser before");
UserRemote user = userSession.newUser(login, password);
System.out.println("Calling newUser after");
} catch (Exception e) {
// Clean up resources
public void destroy() {
Result :
When I run my jsp page and click on the "add" button, I got the message "Calling newUser before" printed in STDOUT and the error message :
ERROR [[userservlet]] Servlet.service() for servlet userservlet threw exception
javax.servlet.ServletException: loader constraints violated when linking javax/ejb/Handle class
at noumea.user.UserServlet.service(UserServlet.java:112)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:153)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
at java.lang.Thread.run(Thread.java:534)
Constat :
I checked into my SGBD and the new user has been created.
The error appears only when the method return Remote ejbs, if I return simples objects (Strings, int..) it works.
What can I do to resolve this problem ?
Thank you."Why do you want to servlet to gain access to another EJB through the stateless session bean. Why cant the servlet call it directly ?"
Because I want to access to the informations included in the entity bean UserBean (which is remote).
You said that it is a bad design, but how can I access to my UserBean ejbs from the session bean if I don't do that ?
For example I want a List of all users to be seen in a jsp page :
1 - I call the method getUserList which returnsan ArrayList of UserRemote.
2 - I iterate over the ArrayList to get the users parameters to be seen.
As the other example (newUser), when I do
ArrayList users = (ArrayList) userSession.getUserList(); with the simple client it works, but in the servlet I got the same error.
But, if I call directly the findAll method (as you'are saying) in the servlet
ArrayList users = (ArrayList) userRemoteHome.findAll(); it works...
I think that if my servlet calls directly entity ejbs, I don't need UserSession bean anymore. Is that right ?
I precise that my design is this :
jsp -> servlet -> session bean -> entity bean -> sgbd
Is that a bad design ? Do I need the session bean anymore ?
Thank you. -
A problem with servlets with WebLogic 4.5.1 SP11
Hello,
We have developed a client that connects to servlets in WebLogic 4.5.1. Some of the servlets use sessions to store data, and they receive some parameters from the client to retrieve information from a database.
When we use WebLogic 4.5.1, everything works fine. However, when we upgrade it to Service Pack 11, we find a problem. If we make a servlet that receives some parameters, but it does no use sessions, everything is correct. If we make a servlet that does not receive any parameter, and we use sessions, we find no problem either. But if we make a servlet that receives parameters and uses sessions within the doPost() method, there is an exception when we call the method Request.getSession(true).
I would thank any help about this point, since I'm not sure if this is the result of a bug, or if there is a new parameter that we have to set in the file weblogic.properties, or any other reason.
The code of our servlet is as simple as follows:
public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException {
ObjectInputStream in = new ObjectInputStream(request.getInputStream());
String arg = null;
String arg2 = null;
String arg3 = null;
try{
arg = (String)in.readObject();
arg2 = (String)in.readObject();
arg3 = (String)in.readObject();
}catch(Exception e){
// Get the session and the counter param attribute
HttpSession session = request.getSession(true);
// WE GET THE EXCEPTION AT THIS POINT.
Integer ival = (Integer) session.getValue("simplesession.counter");
if (ival == null)
// Initialize the counter
ival = new Integer(1);
else
// Increment the counter
ival = new Integer(ival.intValue() + 1);
// Set the new attribute value in the session
session.putValue("simplesession.counter", ival);
// Output data
ObjectOutputStream out = new ObjectOutputStream(response.getOutputStream());
out.writeObject(ival);
out.close();
On the other hand, the client invokes the serlvets using the following code:
public int servletClient(String usuario,String password) {
int numero = 0;
try{
// Input parameters
Serializable[] objs = {"login",usuario, password};
// Invokes the servlet
ObjectInputStream in = ServletWriter.postObjects(urlServlet, objs); // SEE BELOW...
// Get the results
numero = ((Integer)in.readObject()).intValue();
in.close();
}catch(Exception e){
e.printStackTrace();
static public ObjectInputStream postObjects(URL servlet, Serializable objs[]) throws Exception
URLConnection con = servlet.openConnection();
con.setDoInput(true);
con.setDoOutput(true);
con.setUseCaches(false);
con.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
// Write the arguments as post data
ObjectOutputStream out = new ObjectOutputStream(con.getOutputStream());
int numObjects = objs.length;
for (int x = 0; x < numObjects; x++) {
out.writeObject(objs[x]);
out.flush();
out.close();
return new ObjectInputStream( con.getInputStream() );
// THE CLIENT CODE FINISHES HERE
The exception we get is the following:
Mon Feb 21 13:47:41 GMT-02:00 2000:<E> <ServletContext-Servlets> Servlet failed with RuntimeException
Mon Feb 21 13:47:41 GMT-02:00 2000:<E> <ServletContext-Servlets> java.io.IOException: Unexpected end of POST data. Read 0 bytes. Content-length = 20
at java.lang.Throwable.<init>(Compiled Code)
at java.lang.Exception.<init>(Compiled Code)
at java.io.IOException.<init>(Compiled Code)
at weblogic.servlet.internal.ServletRequestImpl.mergePostParams(Compiled Code)
at weblogic.servlet.internal.ServletRequestImpl.parseQueryParams(Compiled Code)
at weblogic.servlet.internal.ServletRequestImpl.getParameter(Compiled Code)
at weblogic.servlet.internal.ServletRequestImpl.initSessionInfo(Compiled Code)
at weblogic.servlet.internal.ServletRequestImpl.getSession(Compiled Code)
at SGBA.servlets.HelloWorldServlet.doPost(Compiled Code)
at javax.servlet.http.HttpServlet.service(Compiled Code)
at javax.servlet.http.HttpServlet.service(Compiled Code)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(Compiled Code)
at weblogic.servlet.internal.ServletContextImpl.invokeServlet(Compiled Code)
at weblogic.servlet.internal.ServletContextImpl.invokeServlet(Compiled Code)
at weblogic.socket.MuxableSocketHTTP.invokeServlet(Compiled Code)
at weblogic.socket.MuxableSocketHTTP.execute(Compiled Code)
at weblogic.t3.srvr.ExecuteThread.run(Compiled Code)
--------------- nested within: ------------------
weblogic.utils.NestedRuntimeException: cannot parse POST parameters of request /HelloWorldServlet
- with nested exception:
[java.io.IOException: Unexpected end of POST data. Read 0 bytes. Content-length = 20]
at java.lang.Throwable.<init>(Compiled Code)
at java.lang.Exception.<init>(Compiled Code)
at java.lang.RuntimeException.<init>(Compiled Code)
at weblogic.utils.NestedRuntimeException.<init>(Compiled Code)
at weblogic.servlet.internal.ServletRequestImpl.mergePostParams(Compiled Code)
at weblogic.servlet.internal.ServletRequestImpl.parseQueryParams(Compiled Code)
at weblogic.servlet.internal.ServletRequestImpl.getParameter(Compiled Code)
at weblogic.servlet.internal.ServletRequestImpl.initSessionInfo(Compiled Code)
at weblogic.servlet.internal.ServletRequestImpl.getSession(Compiled Code)
at SGBA.servlets.HelloWorldServlet.doPost(Compiled Code)
at javax.servlet.http.HttpServlet.service(Compiled Code)
at javax.servlet.http.HttpServlet.service(Compiled Code)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(Compiled Code)
at weblogic.servlet.internal.ServletContextImpl.invokeServlet(Compiled Code)
at weblogic.servlet.internal.ServletContextImpl.invokeServlet(Compiled Code)
at weblogic.socket.MuxableSocketHTTP.invokeServlet(Compiled Code)
at weblogic.socket.MuxableSocketHTTP.execute(Compiled Code)
at weblogic.t3.srvr.ExecuteThread.run(Compiled Code)
I hope all this information can help you making an idea of our problem. We will be looking forward to receiving your answer.
Thanks in advance,
Frankie Carrero.
Hello,
We have developed a client that connects to servlets in WebLogic 4.5.1. Some of the servlets use sessions to store data, and they receive some parameters from the client to retrieve information from a database.
When we use WebLogic 4.5.1, everything works fine. However, when we upgrade it to Service Pack 11, we find a problem. If we make a servlet that receives some parameters, but it does no use sessions, everything is correct. If we make a servlet that does not receive any parameter, and we use sessions, we find no problem either. But if we make a servlet that receives parameters and uses sessions within the doPost() method, there is an exception when we call the method Request.getSession(true).
I would thank any help about this point, since I'm not sure if this is the result of a bug, or if there is a new parameter that we have to set in the file weblogic.properties, or any other reason.
The code of our servlet is as simple as follows:
public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException {
ObjectInputStream in = new ObjectInputStream(request.getInputStream());
String arg = null;
String arg2 = null;
String arg3 = null;
try{
arg = (String)in.readObject();
arg2 = (String)in.readObject();
arg3 = (String)in.readObject();
}catch(Exception e){
// Get the session and the counter param attribute
HttpSession session = request.getSession(true);
// WE GET THE EXCEPTION AT THIS POINT.
Integer ival = (Integer) session.getValue("simplesession.counter");
if (ival == null)
// Initialize the counter
ival = new Integer(1);
else
// Increment the counter
ival = new Integer(ival.intValue() + 1);
// Set the new attribute value in the session
session.putValue("simplesession.counter", ival);
// Output data
ObjectOutputStream out = new ObjectOutputStream(response.getOutputStream());
out.writeObject(ival);
out.close();
On the other hand, the client invokes the serlvets using the following code:
public int servletClient(String usuario,String password) {
int numero = 0;
try{
// Input parameters
Serializable[] objs = {"login",usuario, password};
// Invokes the servlet
ObjectInputStream in = ServletWriter.postObjects(urlServlet, objs); // SEE BELOW...
// Get the results
numero = ((Integer)in.readObject()).intValue();
in.close();
}catch(Exception e){
e.printStackTrace();
static public ObjectInputStream postObjects(URL servlet, Serializable objs[]) throws Exception
URLConnection con = servlet.openConnection();
con.setDoInput(true);
con.setDoOutput(true);
con.setUseCaches(false);
con.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
// Write the arguments as post data
ObjectOutputStream out = new ObjectOutputStream(con.getOutputStream());
int numObjects = objs.length;
for (int x = 0; x < numObjects; x++) {
out.writeObject(objs[x]);
out.flush();
out.close();
return new ObjectInputStream( con.getInputStream() );
// THE CLIENT CODE FINISHES HERE
The exception we get is the following:
Mon Feb 21 13:47:41 GMT-02:00 2000:<E> <ServletContext-Servlets> Servlet failed with RuntimeException
Mon Feb 21 13:47:41 GMT-02:00 2000:<E> <ServletContext-Servlets> java.io.IOException: Unexpected end of POST data. Read 0 bytes. Content-length = 20
at java.lang.Throwable.<init>(Compiled Code)
at java.lang.Exception.<init>(Compiled Code)
at java.io.IOException.<init>(Compiled Code)
at weblogic.servlet.internal.ServletRequestImpl.mergePostParams(Compiled Code)
at weblogic.servlet.internal.ServletRequestImpl.parseQueryParams(Compiled Code)
at weblogic.servlet.internal.ServletRequestImpl.getParameter(Compiled Code)
at weblogic.servlet.internal.ServletRequestImpl.initSessionInfo(Compiled Code)
at weblogic.servlet.internal.ServletRequestImpl.getSession(Compiled Code)
at SGBA.servlets.HelloWorldServlet.doPost(Compiled Code)
at javax.servlet.http.HttpServlet.service(Compiled Code)
at javax.servlet.http.HttpServlet.service(Compiled Code)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(Compiled Code)
at weblogic.servlet.internal.ServletContextImpl.invokeServlet(Compiled Code)
at weblogic.servlet.internal.ServletContextImpl.invokeServlet(Compiled Code)
at weblogic.socket.MuxableSocketHTTP.invokeServlet(Compiled Code)
at weblogic.socket.MuxableSocketHTTP.execute(Compiled Code)
at weblogic.t3.srvr.ExecuteThread.run(Compiled Code)
--------------- nested within: ------------------
weblogic.utils.NestedRuntimeException: cannot parse POST parameters of request /HelloWorldServlet
- with nested exception:
[java.io.IOException: Unexpected end of POST data. Read 0 bytes. Content-length = 20]
at java.lang.Throwable.<init>(Compiled Code)
at java.lang.Exception.<init>(Compiled Code)
at java.lang.RuntimeException.<init>(Compiled Code)
at weblogic.utils.NestedRuntimeException.<init>(Compiled Code)
at weblogic.servlet.internal.ServletRequestImpl.mergePostParams(Compiled Code)
at weblogic.servlet.internal.ServletRequestImpl.parseQueryParams(Compiled Code)
at weblogic.servlet.internal.ServletRequestImpl.getParameter(Compiled Code)
at weblogic.servlet.internal.ServletRequestImpl.initSessionInfo(Compiled Code)
at weblogic.servlet.internal.ServletRequestImpl.getSession(Compiled Code)
at SGBA.servlets.HelloWorldServlet.doPost(Compiled Code)
at javax.servlet.http.HttpServlet.service(Compiled Code)
at javax.servlet.http.HttpServlet.service(Compiled Code)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(Compiled Code)
at weblogic.servlet.internal.ServletContextImpl.invokeServlet(Compiled Code)
at weblogic.servlet.internal.ServletContextImpl.invokeServlet(Compiled Code)
at weblogic.socket.MuxableSocketHTTP.invokeServlet(Compiled Code)
at weblogic.socket.MuxableSocketHTTP.execute(Compiled Code)
at weblogic.t3.srvr.ExecuteThread.run(Compiled Code)
I hope all this information can help you making an idea of our problem. We will be looking forward to receiving your answer.
Thanks in advance,
Frankie Carrero.
-
WLS6.1sp1 stateful EJB problem = load-balancing and fail over
I have three problem
1. I have 2 clustered server. my weblogic-ejb-jar.xml is here
<?xml version="1.0"?>
<!DOCTYPE weblogic-ejb-jar PUBLIC '-//BEA Systems, Inc.//DTD WebLogic 6.0.0 EJB//EN'
'http://www.bea.com/servers/wls600/dtd/weblogic-ejb-jar.dtd'>
<weblogic-ejb-jar>
<weblogic-enterprise-bean>
<ejb-name>DBStatefulEJB</ejb-name>
<stateful-session-descriptor>
<stateful-session-cache>
<max-beans-in-cache>100</max-beans-in-cache>
<idle-timeout-seconds>120</idle-timeout-seconds>
</stateful-session-cache>
<stateful-session-clustering>
<home-is-clusterable>true</home-is-clusterable>
<home-load-algorithm>RoundRobin</home-load-algorithm>
<home-call-router-class-name>common.QARouter</home-call-router-class-name>
<replication-type>InMemory</replication-type>
</stateful-session-clustering>
</stateful-session-descriptor>
<jndi-name>com.daou.EJBS.solutions.DBStatefulBean</jndi-name>
</weblogic-enterprise-bean>
</weblogic-ejb-jar>
when i use "<home-call-router-class-name>common.QARouter</home-call-router-class-name>"
and deploy this ejb, exception cause
<Warning> <Dispatcher> <RuntimeException thrown b
y rmi server: 'weblogic.rmi.cluster.ReplicaAwareServerRef@9 - jvmid: '2903098842
594628659S:203.231.15.167:[5001,5001,5002,5002,5001,5002,-1]:mydomain:cluster1',
oid: '9', implementation: 'weblogic.jndi.internal.RootNamingNode@5f39bc''
java.lang.IllegalArgumentException: Failed to instantiate weblogic.rmi.cluster.B
asicReplicaHandler due to java.lang.reflect.InvocationTargetException
at weblogic.rmi.cluster.ReplicaAwareInfo.instantiate(ReplicaAwareInfo.ja
va:185)
at weblogic.rmi.cluster.ReplicaAwareInfo.getReplicaHandler(ReplicaAwareI
nfo.java:105)
at weblogic.rmi.cluster.ReplicaAwareRemoteRef.initialize(ReplicaAwareRem
oteRef.java:79)
at weblogic.rmi.cluster.ClusterableRemoteRef.initialize(ClusterableRemot
eRef.java:28)
at weblogic.rmi.cluster.ClusterableRemoteObject.initializeRef(Clusterabl
eRemoteObject.java:255)
at weblogic.rmi.cluster.ClusterableRemoteObject.onBind(ClusterableRemote
Object.java:149)
at weblogic.jndi.internal.BasicNamingNode.rebindHere(BasicNamingNode.jav
a:392)
at weblogic.jndi.internal.ServerNamingNode.rebindHere(ServerNamingNode.j
ava:142)
at weblogic.jndi.internal.BasicNamingNode.rebind(BasicNamingNode.java:36
2)
at weblogic.jndi.internal.BasicNamingNode.rebind(BasicNamingNode.java:36
9)
at weblogic.jndi.internal.BasicNamingNode.rebind(BasicNamingNode.java:36
9)
at weblogic.jndi.internal.BasicNamingNode.rebind(BasicNamingNode.java:36
9)
at weblogic.jndi.internal.BasicNamingNode.rebind(BasicNamingNode.java:36
9)
at weblogic.jndi.internal.RootNamingNode_WLSkel.invoke(Unknown Source)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:296)
So do i must use it or not???
2. When i don't use "<home-call-router-class-name>common.QARouter</home-call-router-class-name>"
, there's no exception
but load balancing does not happen. According to the document , there's must load
balancing when i call home.create() method.
my client program goes here
DBStateful the_ejb1 = (DBStateful) PortableRemoteObject.narrow(home.create(),
DBStateful.class);
DBStateful the_ejb2 = (DBStateful) PortableRemoteObject.narrow(home.create(3),
DBStateful.class);
the result is like that
the_ejb1 = ClusterableRemoteRef(203.231.15.167 weblogic.rmi.cluster.PrimarySecon
daryReplicaHandler@4695a6)/397
the_ejb2 = ClusterableRemoteRef(203.231.15.167 weblogic.rmi.cluster.PrimarySecon
daryReplicaHandler@acf6e)/398
or
the_ejb1 = ClusterableRemoteRef(203.231.15.125 weblogic.rmi.cluster.PrimarySecon
daryReplicaHandler@252fdf)/380
the_ejb2 = ClusterableRemoteRef(203.231.15.125 weblogic.rmi.cluster.PrimarySecon
daryReplicaHandler@6a0252)/381
I think the result should be like under one... isn't it??
the_ejb1 = ClusterableRemoteRef(203.231.15.167 weblogic.rmi.cluster.PrimarySecon
daryReplicaHandler@4695a6)/397
the_ejb2 = ClusterableRemoteRef(203.231.15.125 weblogic.rmi.cluster.PrimarySecon
daryReplicaHandler@6a0252)/381
In this case i think the_ejb1 and the_ejb2 must have instance in different cluster
server
but they go to one server .
3. If i don't use "<home-call-router-class-name>common.QARouter</home-call-router-class-name>",
"<replication-type>InMemory</replication-type>" then load balancing happen but
there's no fail-over
So how can i get load-balancing and fail over together??
I have three problem
1. I have 2 clustered server. my weblogic-ejb-jar.xml is here
<?xml version="1.0"?>
<!DOCTYPE weblogic-ejb-jar PUBLIC '-//BEA Systems, Inc.//DTD WebLogic 6.0.0 EJB//EN'
'http://www.bea.com/servers/wls600/dtd/weblogic-ejb-jar.dtd'>
<weblogic-ejb-jar>
<weblogic-enterprise-bean>
<ejb-name>DBStatefulEJB</ejb-name>
<stateful-session-descriptor>
<stateful-session-cache>
<max-beans-in-cache>100</max-beans-in-cache>
<idle-timeout-seconds>120</idle-timeout-seconds>
</stateful-session-cache>
<stateful-session-clustering>
<home-is-clusterable>true</home-is-clusterable>
<home-load-algorithm>RoundRobin</home-load-algorithm>
<home-call-router-class-name>common.QARouter</home-call-router-class-name>
<replication-type>InMemory</replication-type>
</stateful-session-clustering>
</stateful-session-descriptor>
<jndi-name>com.daou.EJBS.solutions.DBStatefulBean</jndi-name>
</weblogic-enterprise-bean>
</weblogic-ejb-jar>
when i use "<home-call-router-class-name>common.QARouter</home-call-router-class-name>"
and deploy this ejb, exception cause
<Warning> <Dispatcher> <RuntimeException thrown b
y rmi server: 'weblogic.rmi.cluster.ReplicaAwareServerRef@9 - jvmid: '2903098842
594628659S:203.231.15.167:[5001,5001,5002,5002,5001,5002,-1]:mydomain:cluster1',
oid: '9', implementation: 'weblogic.jndi.internal.RootNamingNode@5f39bc''
java.lang.IllegalArgumentException: Failed to instantiate weblogic.rmi.cluster.B
asicReplicaHandler due to java.lang.reflect.InvocationTargetException
at weblogic.rmi.cluster.ReplicaAwareInfo.instantiate(ReplicaAwareInfo.ja
va:185)
at weblogic.rmi.cluster.ReplicaAwareInfo.getReplicaHandler(ReplicaAwareI
nfo.java:105)
at weblogic.rmi.cluster.ReplicaAwareRemoteRef.initialize(ReplicaAwareRem
oteRef.java:79)
at weblogic.rmi.cluster.ClusterableRemoteRef.initialize(ClusterableRemot
eRef.java:28)
at weblogic.rmi.cluster.ClusterableRemoteObject.initializeRef(Clusterabl
eRemoteObject.java:255)
at weblogic.rmi.cluster.ClusterableRemoteObject.onBind(ClusterableRemote
Object.java:149)
at weblogic.jndi.internal.BasicNamingNode.rebindHere(BasicNamingNode.jav
a:392)
at weblogic.jndi.internal.ServerNamingNode.rebindHere(ServerNamingNode.j
ava:142)
at weblogic.jndi.internal.BasicNamingNode.rebind(BasicNamingNode.java:36
2)
at weblogic.jndi.internal.BasicNamingNode.rebind(BasicNamingNode.java:36
9)
at weblogic.jndi.internal.BasicNamingNode.rebind(BasicNamingNode.java:36
9)
at weblogic.jndi.internal.BasicNamingNode.rebind(BasicNamingNode.java:36
9)
at weblogic.jndi.internal.BasicNamingNode.rebind(BasicNamingNode.java:36
9)
at weblogic.jndi.internal.RootNamingNode_WLSkel.invoke(Unknown Source)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:296)
So do i must use it or not???
2. When i don't use "<home-call-router-class-name>common.QARouter</home-call-router-class-name>"
, there's no exception
but load balancing does not happen. According to the document , there's must load
balancing when i call home.create() method.
my client program goes here
DBStateful the_ejb1 = (DBStateful) PortableRemoteObject.narrow(home.create(),
DBStateful.class);
DBStateful the_ejb2 = (DBStateful) PortableRemoteObject.narrow(home.create(3),
DBStateful.class);
the result is like that
the_ejb1 = ClusterableRemoteRef(203.231.15.167 weblogic.rmi.cluster.PrimarySecon
daryReplicaHandler@4695a6)/397
the_ejb2 = ClusterableRemoteRef(203.231.15.167 weblogic.rmi.cluster.PrimarySecon
daryReplicaHandler@acf6e)/398
or
the_ejb1 = ClusterableRemoteRef(203.231.15.125 weblogic.rmi.cluster.PrimarySecon
daryReplicaHandler@252fdf)/380
the_ejb2 = ClusterableRemoteRef(203.231.15.125 weblogic.rmi.cluster.PrimarySecon
daryReplicaHandler@6a0252)/381
I think the result should be like under one... isn't it??
the_ejb1 = ClusterableRemoteRef(203.231.15.167 weblogic.rmi.cluster.PrimarySecon
daryReplicaHandler@4695a6)/397
the_ejb2 = ClusterableRemoteRef(203.231.15.125 weblogic.rmi.cluster.PrimarySecon
daryReplicaHandler@6a0252)/381
In this case i think the_ejb1 and the_ejb2 must have instance in different cluster
server
but they go to one server .
3. If i don't use "<home-call-router-class-name>common.QARouter</home-call-router-class-name>",
"<replication-type>InMemory</replication-type>" then load balancing happen but
there's no fail-over
So how can i get load-balancing and fail over together??
-
Jbuilder 6 enterprise and weblogic server 6.1 integration problem
hello,
i am using jbuilder 6 enterprise and weblogic server 6.1. i just got a new
workstation and imported my old project from cvs into jbuilder and
everything is fine up to this point.
the application in question is using servlet filters, so i absolutely need
web application version 2.3. it seems, though, that my jbuilder believes for
some reason that only tomcat 4 and borland enterprise server are capable of
using servlet filters. i cannot remember how i fixed this last time around,
but i did somehow. i had a recollection that the jb6_all_001 patch did the
trick, but obviously it didn't this time, at least. what is really annoying
is that the wizard does not allow me to create servlet filters and the
webapp dd editor does not allow me to configure filters, either. of course,
i can edit web.xml manually, but starting the server changes the dtd back to
2.2 and removes everything that is 2.3 specific.
please help me fix this?at the moment it is possible for me to work, though. i worked around the
problem and i set web.xml as a read only file. i still can't use wizards to
create servlets and i can't edit web.xml with jbuilder. -
Weblogic startup class: problem calling EJB's
Has anyone ever experienced a problem in using a startup class (registered in weblogic.properties)
and tried to lookup and use an EJB in the same application?
Basically, I have a startup class which registers to receive messages from an
MQ queue, and when it receives a message, it tries to do a lookup of a bean and
use it, but I receive a 'NullPointerException'.
I'm running Weblogic 5.1
(I know that Weblogic 6.0 makes use of MessageDrivenBeans, but my app isn't using
6 or EJB 2.0)
Thanks...Can you post weblogic.log? Are you sure that EJB was deployed successfully.
Also comment the PROVIDER_URL in initial context and see if that solves the problem
Viresh Garg
BEA Systems
shaun wrote:
The exception is simply a 'NullPointerException' coming from the startup class
(I don't have the old log file or I would include the trace here.). Basically,
when my startup class receives a call to the onMessage(...) method (from listening
for messages), it looks up an EJB on the server, through the InitialContect class
and gets a 'null' returned back, thereby throwing the NullPointerException.
If anyone else is successful in having a startup class which can lookup and call
an EJB within the same Weblogic server, please help.
Thanks again....
Viresh Garg <[email protected]> wrote:
Can you post the exception stack trace? Also what exactly are you doing
in startup class.
Viresh Garg
Principal Developer Relations Engineer
BEA Systems
Shaun wrote:
Has anyone ever experienced a problem in using a startup class (registeredin weblogic.properties)
and tried to lookup and use an EJB in the same application?
Basically, I have a startup class which registers to receive messagesfrom an
MQ queue, and when it receives a message, it tries to do a lookup ofa bean and
use it, but I receive a 'NullPointerException'.
I'm running Weblogic 5.1
(I know that Weblogic 6.0 makes use of MessageDrivenBeans, but my appisn't using
6 or EJB 2.0)
Thanks... -
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 -
Problem integrating Oracle 9i and Weblogic 7 with MDBs
All:
I would really appreciate an answer to this question.
Background:
- We are using Oracle 9i and Weblogic 7
- I have an MDB that receives a message, then in the onMessage(Message) method
performs a findByPrimaryKey(String).
Problem:
The deployment descriptors and the MDB all work fine when I set them up to query
against a Pointbase database and deploy to Weblogic. Everything worked fine. But
this was only a test to see if everything would work.
I now need to query against an Oracle database. I got the updated version of the
Oracle Thin Driver and put it in the WL_HOME/server/lib/classes12.zip file. I
even added it to the beginning of the classpath in the startWeblogic.cmd file.
But am still having problems.
To test the just the Oracle connection I double checked the user, password, URL,
and driver settings in a java file using JDBC connections - and they worked fine.
They just aren't working when integrated into Weblogic.
The problem lies in the Weblogic 7 server integration with Oracle 9i. The software
integrated fine when tables from a Pointbase database were queried. The only changes
made have been to make the connectivity to Oracle.
My errors are in the attached myserver.log file. If anyone knows if this is a
known problem or what the problem is please let me know.
Just FYI my settings are as follows:
Driver: oracle.jdbc.driver.OracleDriver
URL=jdbc:oracle:thin:@192.168.6.10:1521:proType1
user=protype1
password=protype1
Any advice is welcomed! I've tried everything I can think of.
Angie
[myserver_errors.txt]Hi Angela
you can try the following parameters in the FileRealm.properties to set
acl.reserve.weblogic.jdbc.connectionPool.<connectionPool>=everyone
Thomas
Angela Biche schrieb:
Thanks, I set the initial pool count to 2 and have up to 10
connections (for this testing). Unfortunately it hasn't helped
any.
The error that I am getting is an SQLException:
Exception = Access not allowed
But when I ran the java utils.dbping it makes the connection
with the connection and driver parameters I enter in the console.
I'm still open to ideas on this! :)
Thanks,
Angie -
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.
Maybe you are looking for
-
Ugly system: Can't change email address?
For some reason, my e-mail account provider had been merge by Yahoo (you know), so my e-mail address changed. Then I found that OTN not support change e-mail address?! It's a BIG surprise for me. "ALL" my service provider support change e-mail online
-
What is the best manual to help me learn Mountain Lion and the Mac?
What is the best manual to help me learn Mountain Lion and the Mac?
-
3.0 Synch Notes with Exchange?
Is it possible to synch notes with Exchange now with 3.0 - it does calendar, email etc., so I thought this would be a logical enhancement since they worked on the notes app? if it's not supported, is there anyway to synch exchange notes through some
-
Flooring pictures in adobe premiere pro
For my company we need to make nice pictures for clients, where on the adobe website could you download the adobe premiere pro
-
I cannot change the time and date on pictures just imported. So far I am back to 1795. Is anyone else having this problem?