Servlet deploy to 9ias
Hi oracle team,
I have a servlet in jdev903 run is OK but to deploy 9iAS
903 ocour 500 Internal Server Error
java.lang.UnsupportedClassVersionError: request/Servlet2 (Unsupported major.minor version 48.0)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:488)
is 9ias bug?
package request;
import javax.servlet.ServletException;
import javax.servlet.http.*;
import java.io.PrintWriter;
import java.io.IOException;
public class Servlet1 extends HttpServlet
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
response.setContentType("text/html");
PrintWriter out = response.getWriter();
out.println("<html>");
out.println("<head><title>Servlet1</title></head>");
out.println("<body>");
out.println("<p>The servlet has received a GET. This is the reply.</p>");
out.println("</body></html>");
out.close();
You should recompile your servlet against JDK 1.3, not JDK 1.4 (or upgrade your iAS to 9.0.4)
[JDK 1.4 uses class file version 48.0]
Rob
Team JDev
Similar Messages
-
Hi all,
I have been trying to deploy a servlet to iAS. I have done following steps:
1) Created jar with the class files of http servlet/ dbservlet
2) copied it to ..\iAS\Apache\Jserv\servlets
3) Tried to call the simple http servlet http://koivu.fincosta.com/servlets/test1.Servlet1 or http://koivu.fincosta.com/servlet/test1.Servlet1
and get http 404 error (page not found)
I have tried also to define a wrapper.classpath in the jserv.properties for the jar.
The JD's on-line manual is really confusing on this matter and haven't seen any example on OTN either.
I would be very gratefull if somebody could tell me the steps for correct servlet deployment for iAS.
Best regards,
nullsigh
google: "eclipse war". First result:
http://www.java-tips.org/other-api-tips/eclipse/how-to-make-war-file-in-eclipse.html
I don't know if this applies to your version of Eclipse, but I hope you get the idea that a knowledge problem is not a valid reason to post in a forum; you do a google query in stead. It is the difference between being lazy and passing the problem to someone else, or being a proper developer and doing some research. -
Deployment profile for a business component deployed to 9ias?
I am trying to build a deployment profile so I can deploy my business component to an oc4j instance on my remote 9iAS machine.
In jdeveloper version 9.0.3, the "Business Component Deployment Wizard for EJB session bean" prompts for a both a "Deploy to Connection" and a "Server Connection".
I am specifying a connection to a "9i Application Server - Remote DCM" for the <deploy to connection> prompt. Per the documentation and the wizard .. you must then specify a server connection.
I don't understand the server connection piece ... The <new button> for the "server connction" only lets me build a connection a standalone OC4J. I am trying to deploy to a 9ias oc4j instance on a remote machine. I am suppose to somehow specify a connection to the remote 9ias oc4j instance as if it were a standalone instance? How do I build and specify this connection?Thanks Frank.
My jdevloper help system describes how to deploy to 9ias, and I have not yet spotted anything in the fine print that nullifies this.
The release notes that came with Jdeveloper version 9.0.3.10.35 show a compatibility matrix for deployments to 9ias version 9.0.3 ... my scenario is listed as supported. They note that deployment to 9ias 9.0.2 of bc4j is not suported, and J2EE/WebServices deployment has DCM issues.
FYI ... I have a TAR openned on this subject, and Metalink support personnel seems to be pretty close to declaring this a bug (internal bug#2597292 and internal bug#2495251). Specifically these bugs relate to JBO component versions 9.0.3.9.51 and 9.0.3.10.12 in reagrds to DCM connections to 9ias. If this is the case then it looks like 9iAS deployment is not supported. -
How to access contextRoot in Servlet deployed in an ear in Weblogic 81
Hi,
I need to access the contextRoot or webapp name from a startup servlet deployed in WebLogic. I've tried the following;
getServletContext().getRealPath("/") return null.
getServletContext().getServerInfo() returns Weblogic 8.1 service pack 3...
getServletContext().getServletContextName() display the <display-name> value from my web.xml.
What I want is the <context-root> value in the EARs application.xml.
I tried the following JNDI lookup and the lookup failed but the error message contained the contextRoot.
String name = (String) jndiContext.lookup("java:/comp/env/namespace");
log.info("jndiContextlookup namespace = "+name);
Any help would be GREATLY appreciated. This should be easy!!
ShaneHi VR
From Weblogic Admin Console, Deployments, on right side click on the link named with your EAR Application. It opens detailed page with more tabs. Click on the tab named Targets. Here select your WebService module and click on Change Targets button. Uncheck the server where it is targetted (Deployed), click on Yes. And activate the changes.
Thanks
Ravi Jegga -
Cannot display BIG5 characters for web applications deployed to 9iAS
I have just installed the J2EE and Webcache module of Oracle9iAS Release 2 to
my Windows NT Server 4.0 and deployed a simple web application to it. However,
I found that the JSP cannot display chinese (Big5) characters correctly. My JSP
is something like:
<%@ page contentType="text/html; charset=BIG5" %>
<HTML><BODY>
<% String s = SOME_BIG5_CHARACTERS; %>
<%= s %>
</BODY></HTML>
On the other hand, I tried to re-direct the standard output to a log file and
do the following in my servlet.
System.out.println(SOME_BIG5_CHARACTERS);
Now, the Big5 characters CAN be displayed correctly in the log file. So, I am
confused with where the problem is.
Here are my settings to my 9iAS:
1) Using regedit, I have set the NLS_LANG variable of the corresponding
ORACLE_HOME to TRADITIONAL CHINESE_TAIWAN.ZHT16BIG5
2) In the file %ORACLE_HOME%\Apache\Jserv\conf\jserv.properties, I have
inserted the following line:
wrapper.env=NLS_LANG=TRADITIONAL CHINESE_TAIWAN.ZHT16BIG5
3) In the file %ORACLE_HOME%\Apache\Apache\conf\httpd.conf, I have added the
following line:
PassEnv NLS_LANG
4) In the file %ORACLE_HOME%\opmn\conf\opmn.xml, I have added the following
line to the corresponding OC4J instance:
<environment>
<prop name="NLS_LANG" value="TRADITIONAL CHINESE_TAIWAN.ZHT16BIG5"/>
</environment>
5) For my application server, I set the java option with -Dfile.encoding=Big5
6) I have replaced the file font.properties with font.properties.zh_TW under
%ORACLE_HOME%\jdk\jre\lib.
7) I have set the following in the file orion-web.xml of my web application:
<orion-web-app
deployment-version="9.0.2.0.0"
default-charset="Big5"
jsp-cache-directory="./persistence"
temporary-directory="./temp"
internationalize-resources="false"
default-mime-type="application/octet-stream"
servlet-webdir="/servlet/">
</orion-web-app>
Anyone have idea on fixing my problem? Thanks in advance.
Regards,
KaeI met a similar problem before but not exactly your case. When I compile the JSP by Jdeveloper, it will convert the chinese characters to strange characters. It makes me crazy to handle the chinese characters ...
Anyway, by my experience, you better isolate the chinese characters from your JSP or Java programs. Instead, put all language dependent text in a properties file and then use native2ascii to covert your properties file into Unicode. Of course, u need to change your page charset to UTF-8.
U can get more idea from the following site.
Brief Description of Internationalization:
http://java.sun.com/products/jdk/1.2/docs/guide/internat/faq.html
Detail Tutorial:
http://java.sun.com/docs/books/tutorial/i18n/
Native-to-ASCII converter:
http://java.sun.com/products/jdk/1.2/docs/tooldocs/win32/native2ascii.html -
I deployed ejb with a client application successfully in oracle 9ias .
http server by default listens on port 80
i tried the servlet to ejb example by running the makeit.bat file in
$ORACLE_HOME\javavm\demo\demo\examples\servlets\basic\servletToejb\makeit.bat
in this batch file while reaching the sess_sh session shell it' connecting to 8080
since no port was listening on 8080 . i changed the httpd.conf to chane the listen port pf http from 80 to 8080 and again runthe bat file . i got the error
</admin/shell> not found error. i read through the document provided for oracle 9ias oracle servlet engine deployment.
but i couldn't solve the prob .so can u pls send me how to solve this prob??
and how to deploy a new servlet especially how to create the servlet context ??
Thanks And Regards
Adarshhi:
please copy your servlet class file to Java Web Server 2.0 root/servlets directory.
then invoke your servlet use command like this http://machine name:8080/servlet/your servlet name. don't add 's' character after servlet word. so enjory it! -
OC4J 9.0.2 deployment on 9iAS 1.0.2.2.2
Hi,
I have installed the OC4J v9.0.2 on Windows by itself. I was trying to find out if there is a way in which I can deploy the 9.0.2 OC4J on a Oracle9iAS 1.0.2.2 installation on Windows (for Windows there has not been any release of the 9iAS Rel 2 yet) ? If so, what configurations do I need to change for Apache and HTTP Server so that Apache will be able to host OC4J ? Any information will be appreciated.
Thanks in advance.I have the same problem. Please advice if you found an answer. Thanks in advance.
-
How to run a pure java application client with ear deployed on 9ias
Hello all,
We want to run a pure java application client which is packed with target bean in the same ear file. In the application-client.xml we refer to some EJBs.
We deployed the ear file which contains ejb jar module and application client module to oracle 9ias 904 through enterprise manager on unix. The jndi.properties we used looks like this
java.naming.factory.initial=com.evermind.server.rmi.ApplciationClientInitialContextFactory
java.naming.provider.url=opmn:ormi://opmn_host:opmn_port:oc4j_instance_name/application_name
java.naming.security.principal=test
java.naming.security.credentials=test
Is there anybody knows how to run such an application client? Do we need to provide such a jndi.properties or not at all?
Thanks,
9ias userRefer OpenEJB User - Oracle ADF Essential and TomEE+
Also refer Bug in tomee 1.5.2. Fixed in 1.6.
https://issues.apache.org/jira/browse/TOMEE-756 -
Whats the best way to get the server name in a servlet deployed to a cluster?
Hi,
I have a servlet in a web application that is deployed to a cluster, just
wondering what is the best way to get the name of the node that the server is
running on at run time??
Thanks
Please try to modify the following code and test for your purpose: (check Weblogic
class document for detail)
import javax.naming.*;
import weblogic.jndi.*;
import weblogic.management.*;
import weblogic.management.configuration.*;
import weblogic.management.runtime.*;
MBeanHome home = null;
try{
//The Environment class represents the properties used to create
//an initial Context. DEfault constructor constructs an Environment
//with default properties, that is, with a WebLogic initial context.
//If unset, the properties for principal and credentials default to
//guest/guest, and the provider URL defaults to "t3://localhost:7001".
Environment env = new Environment();
//Sets the Context.PROVIDER_URL property value to the value of
//the argument url.
if(admin_url!=null){
env.setProviderUrl(admin_url);
//Sets the Context.SECURITY_PRINCIPAL property to the value of
//the argument principal.
env.setSecurityPrincipal(username);
//Sets the value of the Context.SECURITY_CREDENTIAL property to
//the value of the argument cedentials
env.setSecurityCredentials(password);
//Returns an initial context based on the properties in an Environment.
ctx = env.getInitialContext();
}else ctx = new InitialContext();
home = (MBeanHome) ctx.lookup(MBeanHome.ADMIN_JNDI_NAME);
ctx.close(); //free resource
// or if looking up a specific MBeanHome
//home = (MBeanHome) ctx.lookup(MBeanHome.JNDI_NAME + "." + serverName);
DomainMBean dmb = home.getActiveDomain(); //Get Active Domain
ServerMBean[] sbeans = dmb.getServers(); //Get all servers
if(sbeans!=null){
for(int s1=0; s1<sbeans.length; s1++){
String privip = sbeans[s1].getListenAddress();
sbeans[s1].getName();
sbeans[s1].getListenPort();
WebServerMBean wmb = sbeans[s1].getWebServer();
}catch(Exception ex){
"Gao Jun" <[email protected]> wrote:
>Is there any sample code? Thanks
>
>Best Regards,
>Jun Gao
>
>"Xiang Rao" <[email protected]> wrote in message
>news:[email protected]...
>>
>> Sure. You can use the Weblogic management APIs to query ServerBean.
>>
>>
>> "Me" <[email protected]> wrote:
>> >
>> >Thanks for your reply, i was hoping to find a better way for example
>> >a class in
>> >weblogic API.
>> >
>> >Thanks
>> >
>> >"Xiang Rao" <[email protected]> wrote:
>> >>
>> >>Physical: InetAddress.getLocalHost().getHostName()
>> >>Weblogic: System.getProperty("weblogic.Name");
>> >>
>> >>
>> >>"Me" <[email protected]> wrote:
>> >>>
>> >>>Hi,
>> >>> I have a servlet in a web application that is deployed to a
>cluster,
>> >>>just
>> >>>wondering what is the best way to get the name of the node that
>the
>> >>server
>> >>>is
>> >>>running on at run time??
>> >>>
>> >>>Thanks
>> >>
>> >
>>
>
>
-
Servlet deployment in Weblogic
Hi,
Its a very simple thing but somehow its not working.Saw many sites ,but the solution is the same.But its still not working..can anyone help.
Well..I have written a simple servlet that prints Hello.I am trying to deploy it in Weblogic 6.1.But when i invoke it thru the brwser the web server simply cannot find the servlet..i mean therez no error etc..its just 'Error 404--Not Found
From RFC 2068 Hypertext Transfer Protocol -- HTTP/1.1:
10.4.5 404 Not Found
The server has not found anything matching the Request....'
I have modified the web.xml file and added this..
<servlet>
<servlet-name>DataFetchServlet</servlet-name>
<servlet-class>DataFetchServlet.class</servlet-class>
<servlet-mapping>
<servlet-name>DataFetchServlet</servlet-name>
<url-pattern>quickStartServlet</url-pattern>
</servlet-mapping>
</servlet>
i am calling the servlet like this
http://localhost:7001/quikStartServlet
but in vain..am i missing somehting?
I have put the class into classes directory of the WEB-INF directory as specified by BEA Weblogic docs.
thanx in advanceWhat context is the servlet in? Did you put in
the "default web application" (either the one
furnished by the WLS install or one that you so
designated in the configuration)? If not, then that
part of your URL is missing. E. g.
http://localhost:7001/webappname/nameFromWebXml
That right.
But the user is also missing a '/' before the url pattern.
<servlet-mapping>
<servlet-name>DataFetchServlet</servlet-name>
<url-pattern>/quickStartServlet</url-pattern>
</servlet-mapping>
Try that. -
Error: java.lang.NullPointerException in servlet deployment
Hi!!!
Im trying to deploy a servlet created in Jdeveloper on OC4J, but got the Error: java.lang.NullPointerException when the Jdeveloper is deploying the servlet.
The containers are running, so I don't know what is the problem....
ThanksIf you could give a little more info it would help. The web.xml for example, if your mapping it correctly, etc...
-
hi all,
i first post in java fundamental then i realize it should be in servlet sorry if u ppl suppose it repeated.
i have a problem about which i search lot but didnt find any answer.
i made an servlet and deploy it in tomcat.
My directory structure is according to standard under midp folder. In my web.xml under WEB-INF/classes
i wrote
<web-app>
<servlet>
<servlet-name>bob</servlet-name>
<servlet-class>HitServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>bob</servlet-name>
<url-pattern>/hits</url-pattern>
</servlet-mapping>
</web-app>
and acces it with http://localhost:8080/midp/hits
it says hits not avaiable
but when i change this section
<servlet-mapping>
<servlet-name>bob</servlet-name>
<url-pattern>/servlet/HitServlet</url-pattern>
</servlet-mapping>
and access http://localhost:8080/midp/servlet/HitServlet
it works.
i cant understand y this happen bcz i wanna access it like
http://localhost:8080/midp/hits
what should i have to do?
plz help me.Uh, you said that your web.xml is under /WEB-INF/classes? That's not the right place, it goes under /WEB-INF/.
But...to answer your question, I see nothing wrong with your servlet and servlet mapping entries. A test on one of my apps worked perfectly.
What App Server are you running? Did you stop it, redeploy, then restart it and then access the page?
There's something else going on, because there's nothing wrong with your mapping. -
How to get the Application name/fullpath in a servlet deployed in WebLogic
Hi ,
Just like we can get the domain root directory from weblogic.management.DomainDir
String root = DomainDir.getRootDir() ;and domain name from weblogic.management.configuration.DomainMBean
DomainMBean domainMBean = MBeanUtils.getDomainMBean();
String domainName = domainMBean.getName() ;How can i get , the application name in which the servlet is deployed from inside the same servlet ? Which API from weblogic provides that information ?
for eg : application path = Middleware/user_projects/domains/Domain_1/servers/AdminServer/upload/webapp1.war
and application name = webapp1.war
Edited by: Tom on Mar 31, 2011 9:32 PMNot sure about Weblogic Specific API however you can use Java API.
public void init(ServletConfig config) throws ServletException {
// TODO Auto-generated method stub
System.out.println(config.getServletContext().getRealPath(""));
System.out.println(config.getServletContext().getContextPath());
output:
C:\Documents and Settings\user\KEDB\KEDBRISKIT\WebContent --- Application Path
/KEDBRISKIT --- Application Name
-Akshay -
Client web browser closes abruptly when accessing forms deployed using 9iAS 1.0. 2
I am using 9iAS 1.0.2 on W2K server with SP3.I could successfully launch the application on web browser at server side.Hoever when I try to access from client machine the first time it install the Jinitiator and the web browser gets closed.
why it is happening? Appreciate any thoughts!
ThanksThe problem here is the SOAP engine running on Oracle9iAS 1.0.2.2 is a lower version than that running on Oracle9iAS 9.0.3/OC4J 9.0.3.
To get them to interoperate (e.g. 1.0.2.2 calling 9.0.3), you would have to do the following:
1. Build your Web service in OC4J 9.0.3/JDev 9.0.3
2. Deploy to 9.0.3 environment
3. Build a Web service client on the 1.0.2.2 environment, not using any 9.0.3 libraries (see below for a link to a paper to do this)
Conversely if you wanted to call from a OC4J 9.0.3 Web service client to a Oracle9iAS 1.0.2.2 Web service, you would have to do the following:
1. Build your Web service on 1.0.2.2 using 1.0.2.2 libraries
2. Deploy this to a 1.0.2.2 environment
3. Build a client to the 1.0.2.2 Web service using the 9.0.3 libraries
The reason it likely is not working is that it looks like you are mixing two different generations of SOAP libraries.
See the link below for how to build and consume Web services using Oracle9iAS 1.0.2.2:
http://otn.oracle.com/tech/webservices/htdocs/soapr1/ExploreSOAP1022.html
At the end of that paper is a link to another paper showing how to use JDeveloper 3.2 to build a Web service for 1.0.2.2 - it shows how to use its libraries versus the libraries that came with 9.0.3.
Mike. -
How do you define system property with OC4J. OAS versions allow you to do that. I have servlet 2.1 compatible application that I want to deploy into oc4j without code changes. Any ideas?
Or if you don't want to use property files you can use the ServletContext class which has two methods:
public String ServletContext.getInitParameter(String name)
public Enumaration ServletContext.getInitParameterNames()
The init parameters for a context are specified in the web.xml deployment descriptor for the context using the <context-param> tag. Example:
<web-app>
<context-param>
<param-name>rmihost</param-name>
<param-value>localhost</param-value>
</context-param>
<context-param>
<param-name>rmiport</param-name>
<param-value>1099</param-value>
</context-param>
</web-app>
To find the context init parameters in a servlet you can do:
try {
ServletContext context = getServletContext();
String rmihost = context.getInitParameters("rmihost");
int rmiport = Integer.parseInt(context.getInitParameter("rmiport"));
} catch (Exception e) {
}
Maybe you are looking for
-
Is there a way to connect iPod Touch to internet over my computer?
I don't have wifi, but I have internet and I can't get an app to update without wifi. I really can't connect through my iTunes on my computer? This seems kind of strange. Don't know which "generation" it is it was a gift. It may be the one right befo
-
Urgent help - Unable to open operator
Hello Friends, Need urgent help and suggestions... It started since this morning. When we open ODI Dev/Prod instance repositoy operator it gives this message. Error: Corrupted module. Unable to connect. See the license information in the 'About'...'m
-
When I try to update my iPod touch to iOS4.3 I'm told to go to Devices in iTunes, then Summary. I can't find Summary.
-
Asking for return type with constructor
import java.swing.*; public class firstWindow extends JFrame public static final int WIDTH = 300; public static final int HEIGHT = 200; public FirstWindow() super(); setSize(WIDTH,HEIGHT); JLabel newLabel
-
Hi Where exactly can I download the Adobe Audition CS6 installer for Mac? Thanks