Step Through java.* Classes With JDB
Here is a simple program:
public final class HelloWorld {
private HelloWorld() {
public static void main(String[] args) {
System.out.println("Hello, World!");
}I compile it with the -g option, and run it in jdb:
javac -g HelloWorld.java
jdb HelloWorld
I set a breakpoint in the main function...now I'm wondering why I can't step through the String constructor (or whatever magic happens behind the String literal syntax) and the println method calls. When I use step, it just skips over them! I find that I can set breakpoints in library methods, and use list to see the source, but as soon as I step it flies out of the library method and back to mine. Does anybody know what gives? Is it because the libraries aren't compiled with the -g option???
Thanks for your quick input. It seems you're right about the libraries. I made a dummy class compiled with the -g:none option, added some more lines in the first class (compiled with -g), and ran it through jdb. It stepped over the methods from the class with no debug info...same way as before.
This is annoying. Sun should really provide debug versions of their libraries.
So how does JBuilder let you step through library methods? Did they take the Sun source and recompile it? Do they have a magic debugger?
Similar Messages
-
How to display value from java class with output generated with toplink
i hava a requirement of displaying (distance ie calculated in java class) with output generated by query.
ie if output is like
school name (distance)
physical address
here the school name and physical address are retrived from database.Hi,
ValueHolders are used by the JSF internal framework. To work with an object (attributes) in a managed bean you don't need to make it returning a value holder.
Create a POJO, provide accessor methods and register it as a managed bean. Access it from JSF with EL
Frank -
PI 7.1 Access to Dynamic Configuration through Java Class
My Current scenario involves IDCO -> FILE communications in PI 7.1 using XSL where the file name is dynamic.
I have attempted calling a Java Class from XSL with the use SAPXMLTOOL kit option set in the adaptor and it works but I need to be able to call the transform method
public void transform(TransformationInput arg0, TransformationOutput arg1)
from XSL so I can access the message and update the File Name via Dynamic Configuration.
Whilst I can call a static class with in the object I can not call transform with the correct arguments (arg0, arg1). I need access to arg0 (payload) to set/figure out the filename. I can calculate the filename in XSL and pass it to the Java but in a static method it is useless as it need to access the arg0 which is a object and obviously non-static context.
Is this possible ? How do I get access to Dynamic Configuration from XSL through Java in 7.1 ?
I have successfully called a static method but that is no help.
Thanks in advance.Suraj,
Unfortunately you link isnt operational but thankyou anyway, I have managed to call as Java class as per my original post, but a static method does not allow me to get a handle to the Dynamic Configuration Variables in the message.
It seems importing the 7.0 LIBS may be an option and Im not entirely sure I have that option.
It certainly isnt possible to use the JDK5 XML implementation to even call a static method on an Java OBJ from XSL (obviously the USE SAPXMLTOOLKIT option is there for a reason).
I think and again I could be wrong but direct access via XSLT..
LINK:http://help.sap.com/saphelp_nwpi71/helpdata/EN/e2/e13fcd80fe47768df001a558ed10b6/frameset.htm
Is what Im looking for, I shall report back success or failure but the doco seems to fit the bill. Im not sure why I wanted to instatiate a sperate Java class when it can all exist in the XSLT. -
How can I execute a java class with arguments from an air application built from mxml?
I have an mxml application. It has a button, and when that button select event occurs, I want my mxml air app to pass arguments to a java class I have built, which resides in a package path on my system. I need to be able to pass several arguments to my java method from my mxml call. How do I do this, and what config files are necessary? For the simple task I want to engineer, can you show me an example of a properly configured config file? My java class has been executed at the command line in the past as follows:
java -cp %CP% com.abc.prism.queue.EmitMessage XYZ "my message text" 192.12.13.14 5672
where %CP% is an env variable that tells my class the classpath it runs with, and XYZ, "my message text", the IP address, and the port are the arguments I must pass from mxml to my java class. How do I accomplish this?
How do I make known to the java class I call from mxml the %CP% class path? It tells my java class where to find various rabbitMQ jars.Hi,
You need to use Integration technology like BlazeDS or LCDS. -
Send mail through CL_BCS class with normal priority
Hello guys!!!
I'm trying to send email through CL_BCS class, and it's work fine!
But, always sent with high priority, and I need to send whith normal priority.
I tried this:
DATA: o_send_request TYPE REF TO cl_bcs,
o_document TYPE REF TO cl_document_bcs.
o_document = cl_document_bcs=>create_document(
i_type = 'HTM'
i_text = msgbody
i_subject = subject
i_importance = '5' ).
And this:
CALL METHOD o_send_request->send_request->setu_priority
EXPORTING
i_priority = o_send_request->cp_priority_normal.
Unfortunately, don't works.
Any idea?
Thanks!!!
Kleber S. KieferHi,
Please try the following solution:
* set mail importance to normal
TRY.
lo_document ?= lo_send_request->document( ).
lo_document->set_importance( i_importance = '5' ).
CATCH cx_sy_move_cast_error.
ENDTRY.
In addition, in the Alert framework, which send emails with high priority, it controls the document's importance and then send out the emails with high priority.
* create send request, document etc..
TRY.
lo_document = cl_document_bcs=>create_document(
i_type = l_texttype
i_text = lt_text
i_importance = '1'
i_language = ls_langu_recipient-langu
i_subject = l_subject_short
i_length = l_so_obj_len ). -
Integrate java class with forms
dear friends,
i use forms9i under windows2000,
i try to implement a java class for a bean area.
i have some classes who oracle demo provide.
I DO the following :
save HTMLTextArea.class in <oracle_home>/forms90/java
and property palette of bean i write the class name in implementation class property HTMLTextArea
and also set the Forms60_Builder_Classpath varibale in registry(c:\ora9ids\forms90\java\HTMLTextArea so when i run this form then received an error
" java.lang.NoClassDefFoundError: HTMLTextArea (wrong name: oracle/forms/demos/HTMLTextArea).
plz solve this problem.I presume that you have to create the full path oracle/forms/demos/HTMLTextArea.class in the forms90/java folder...else,if you save there the java class without the full path (wich corespondds to the package oracle.forms.demos),the server won't find it..
However,this is bad practice,to keep the class file on the server...create a jar file with this class,and add it the archive_jini tag in formsweb.cfg file..place the jar file in forms90/java folder -
Link java class with custom taglib in Nitrox
Hi,
I am creating a set of Nitrox custom libraries for my company, and I need a tag with the following behavior:
The tag insert window has to contain a select combo with information retrieved from a file or a database.
So, my questions are:
1) How can I call java classes from tlei or tagedit files?
2) What does it mean the following tag?
<editor-class>com.m7.wide.struts.tags.tagedit.StrutsSelectTagEditor</editor-class>
3) What does it mean this other tag?
<default-bundle>com.m7.wide.struts.resources.html-resources</default-bundle>
4) Do you have any online documentation about tagedit files and the related classes?
I am using Eclipse 3.1 and Nitrox 3.0.0 M2
Thanks in advance,
AlbertoThe Workshop Java API for tag customization is not public for the time being, sorry for the inconvenience.
-
Deployment a java class with Oracle92
Good morning i'm a new friend.
Today i have build a java class to send email with attach,testing this class in jdeveloper is all ok,but when i try to deploy into my database i've an error message:
ORA-29545: classe di formato errato: at offset 265 of package1.mypackage.JEmail.SendEmail expecting a class-javax.activation.DataHandler but encountered a class-javax.activation.DataHandler.
In java class i import:
import java.io.*;
import javax.mail.*;
import javax.mail.Multipart.*;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMultipart;
import javax.mail.internet.MimeBodyPart;
import javax.mail.internet.MimeMessage;
import javax.activation.*;
import javax.activation.DataHandler;
import java.util.*;
How can i do?
Thanks a lot
Guerrieri PaoloHi,
You need to use Integration technology like BlazeDS or LCDS. -
XSLT mapping calls Java class, with hardcoded values-problem at Transport
Hi All,
I know the subject may be misguiding, but i need some suggestions how to handle the following scenario.
From my XSLT mapping, i am calling a java function which performs a data connection to an oracle database and then returns some values, whcih i have mapped in the mapping.
The problem is, i have hardcoded the Connection parameters....
and now that we transport these objects to production, the connection parameters will change.
I thought of two solutions
1) i create a new java class for Production system
2) i define the parameters as input arguemnts to my method, whcih is called from XSLT mapping
But in both cases, if theres any chg in future, there will a dependancy on one of the objects to be changed and sent again.
What is the suggested way? is there nothing like a property file(like in EP), where you define dependant parameters...and the file is only changed.
XI Gurus, please suggest me the correct way to handle.....
Thanks a lot.
MonaMona,
This is what i do..
1) Parametrize ur current calling class,
2) define a separate class called dbConnect.java there, you have all your parameters that way when there is a change your main program is untouched, and you just need to change the dbconnect.
The call from your current class will be just like
dbConnect.Runsql("sql as a string");
the runSql can then internally call
dbConnect().connect(); //that should do the connection opening.
then create a prepared statement from your string input and call the db.......
this is the implementation that would be best suited for your scenario, you can further parametrize the method to where you can add the database params from the calling xml..so all that needs to be done when the machine is changed or any param is changed is ..modify the xml........not too bad was that.....
Regards
Ravi -
Using java classes with Forms 6i
Hello everyone,
I want to use some Java.io functionality in Forms 6i but I'm not sure how to go about doing this. How can I access java classes from a forms application?
Thanks,
WesUse th Java Importer - information on otn.oracle.com/products/forms or in the on line help.
Regards
Grant Ronald
Forms Product Management -
Basic Java Class with prints records out of the DEPT table
Can some one show a basic java class which will query the DEPT table, and print them out?
Nagarjuna,
the Oracle DBMS JDBC Developer's Guide is full of code examples.
http://download.oracle.com/docs/cd/B19306_01/java.102/b14355/toc.htm
--olaf -
How to debug Java adventure with jdb
Hi,
I'm learning J2ee and I'd like to use and debug
Java adventure. I tried to find some information but found nothing.
What I tried to debug , is to start the j2ee server by adding the following options into the bin/asadmin.bat file:
-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n
This it doesn't work because the j2ee server is started with the javaw.exe virtual machine. So I'm stuck here.
My first question: 1- what visual debugger is great to debug J2ee apps ??
I'd like to known what are the steps to:
2- how to start the j2ee server in order to attach the jdb or a visual
debugger ?
3- when starting the j2ee server, what do i have to do in order to step
into the code source of Java adventure and follow function calls ?
4- how do I have to start the jdb to attach to the J2ee server ?
5- Any useful tip to debug J2ee apps ! :-)
Thanks in advance !
WaltereoHi,Hello
I'm learning J2ee and I'd like to use and debug
Java adventure. I tried to find some information but
found nothing.
What I tried to debug , is to start the j2ee server by
adding the following options into the bin/asadmin.bat
file:
-Xdebug
ug
-Xrunjdwp:transport=dt_socket,address=8000,server=y,sus
end=nThat looks OK.
This it doesn't work because the j2ee server is
started with the javaw.exe virtual machine. So I'm
stuck here.javaw.exe implies you are on a win32 machine. The default
debugging transport on win32 is shared memory... but you specify
a socket connection on the debugee command line above. This
means you need to specify sockets on the debugger side as well.
For example:
jdb -connect com.sun.jdi.SocketAttach:hostname=localhost,port=8000
Note the port number (8000) matches the value you specified
when starting the debugee.
>
My first question: 1- what visual debugger is great
to debug J2ee apps ??For a list of debugging tools, check this web page:
http://java.sun.com/products/jpda/using.html
Many of these products work well in a J2EE environment.
Most of them are either free, or come with an introductory
"try before you buy" offer.
I'd like to known what are the steps to:
2- how to start the j2ee server in order to attach
the jdb or a visual
debugger ?You are on the right track with the flags/options you
mentioned.
3- when starting the j2ee server, what do i have to
do in order to step
into the code source of Java adventure and follow
low function calls ?The code you want to examine needs to be compiled
with the "-g" flag added to the javac command line.
When -g is specified, javac will save information
in the .class files that is used later during debugging.
4- how do I have to start the jdb to attach to the
J2ee server ?See above...
For more coverage on this topic, refer to:
JPDA Connection and Invocation Details
http://java.sun.com/j2se/1.4.2/docs/guide/jpda/conninv.html
5- Any useful tip to debug J2ee apps ! :-)That is a bit outside the scope of this forum... sorry.
Any useful tips will depend on what J2EE app server you
are using. Most of the well-known servers come with
a debugging guide. For example, take a look at:
Debugging J2EE Applications in the SunOne Application Server
documentation:
http://docs.sun.com/source/817-2171-10/dgdebug.html
Thanks in advance !Best Regards... -
Checking textbox through java class which is called in jsp
I have created a text box in html and if the string entered by user is a alphabet it will not show any message ,else it should display a error message..These checking validations of textbox is done in java and called in jsp;
a.html
<font size="4">Enter the search keyword:</font><input type="text" name="key" ><br>
and also submit button is there which goes to main.jsp
main.jsp
<%@page import="gaveshan.checking;"%>
<%
checking ch=new checking();
String trans=request.getParameter("key");
out.println(ch.ParseClean(trans));
session.setAttribute( "trans", trans );
%>
checking.java
package gaveshan;
import java.awt.event.*;
public class checking
{ public String ParseClean(String str)
if(str.length()==100||str.length()==0)
return "Enter String Properly";
for(int i=0;i<str.length();i++)
if(!(str.charAt(i)>65&&str.charAt(i)<122))
return "Enter String Properly";
it is not givng any message when user enters the input in textbox
it is not showing any errorUsing javascript.
var lwr = 'abcdefghijklmnopqrstuvwxyz';
var upr = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
function isValid(parm) {
for (i=0; i<parm.length; i++) {
if (val.indexOf(parm.charAt(i),0) == -1) return false;
return true;
}- vignesh -
How to create java classes when multiple xsd files with same root element
Hi,
I got below error
12/08/09 16:26:38 BST: [ERROR] Error while parsing schema(s).Location []. 'resultClass' is already defined
12/08/09 16:26:38 BST: [ERROR] Error while parsing schema(s).Location []. (related to above error) the first definition appears here
12/08/09 16:26:38 BST: Build errors for viafrance; org.apache.maven.lifecycle.LifecycleExecutionException: Internal error in the plugin manager executing goal 'org.jvnet.jaxb2.maven2:maven-jaxb2-plugin:0.7.1:generate': Mojo execution failed.
I tried genarate java classes from multiple xsd files, but getting above error, here in .xsd file i have the <xe: element="resultClass"> in all .xsd files.
So I removed all .xsd files accept one, now genarated java classes correctly. but i want to genarte the java classes with diffrent names with out changing .xsd
Can you please tell me any one how to resolve this one......
regards
prasad.nadendlaGregory:
If you want to upload several Java classes in one script the solution is .sql file, for example:
set define ?
create or replace and compile java source named "my.Sleep" as
package my;
import java.lang.Thread;
public class Sleep {
public static void main(String []args) throws java.lang.InterruptedException {
if (args != null && args.length>0) {
int s = Integer.parseInt(args[0]);
Thread.sleep(s*1000);
} else
Thread.sleep(1000);
create or replace and compile java source named "my.App" as
package my;
public class App {
public static void main(String []args) throws java.lang.InterruptedException {
System.out.println(args[0]);
exit
Then the .sql file can be parsed using the SQLPlus, JDeveloper or SQLDeveloper tools.
HTH, Marcelo. -
I have a web dynpro track. In my DC I use a java class that is in the src/packages directory. Somehow the connection between my SpiritCalendar.java class on my PC and the one in the repository have come apart. The repository browser shows the SpiritCalendar.Java class with the local house symbol next to it and the words SpiritCalendar.java <Name Clash>.
The differences between the two versions is just one method so I'm not scared of deletes. Natually, this is stopping the build since I use the new method.
Any guidance on how to fix this?
DianeI just tried to do an Edit File in this Folder from my UTIL folder. The other Java Class checked out fine. The SpiritCalendar class gave a Sync Failed due to the name clash
08:25:57.693 SYNC (FAILED: File has local-remote name clash) SpiritCalendar.java
(D:\NWDI Development Configuration\4\DCs\spiritaero.com\cats\emp\timevrfy\_comp\src\packages\com\spiritaero\cats\empl\util\SpiritCalendar.java)
08:38:59.360 SUCCEEDED: Created activity act_w_MTEHRC2_spiritaero_2e_com_MTE_2d_CATS_2d_CUSTOM_dev_inactive_u_s0002916_t_2009_01_30_14_38_59_GMT_de7d6ee2-3a90-4d19-92ee-9f0873308fff
08:39:01.172 EDIT (SKIPPED: File is local-only) SpiritCalendar.java
(D:\NWDI Development Configuration\4\DCs\spiritaero.com\cats\emp\timevrfy\_comp\src\packages\com\spiritaero\cats\empl\util\SpiritCalendar.java)
08:39:01.469 EDIT StringUtility.java (D:\NWDI Development Configuration\4\DCs\spiritaero.com\cats\emp\timevrfy\_comp\src\packages\com\spiritaero\cats\empl\util\StringUtility.java)
08:39:02.110 ==> Finished in 985ms. 1 file succeeded (8428 bytes). 1 file skipped (51066 bytes).
Maybe you are looking for
-
FUNCTION MODULE FOR AUTOMATIC MAIL GENERATION
Hello, I want to generate an automatic mail of a scheduled report on everyday basis. the output spool req of scheduled report in generated n saved inside the system. Could you please help me in generating automatic mail through that saved spool reque
-
Document Management and Workflow Packages
Hello SAP Community, My company is considering a document management solution integrated with a work flow package in regards to automating and providing visibility into our entire account payable process. I was wondering if anyone out there has imple
-
What is better HDMI audio or Optical audio?
Just wondering. If optical is better, will the optical port cancel out the HDMI Audio?
-
I re-edited a FCP 7 project for someone. The sequence settings are: 1440x1080 HD (1440x1080( (16:9) and the compressor is HDV 1080i60 He's going to drop it into premier on his side on a PC. I exported it two different ways. Once with this codec: Line
-
How can i edit payment method if i signed up for non payment
How can i edit payment method if i signed up for non payment?