Problem compiling with a final static statement
I'm trying to compile a code that i obtained from jad. The error is:
MethodInvoke.java:269: illegal start of type
^
At the final of the code i got:
static final
{ //here appear the problem
try
pool = new ObjectPool(com.test.wsp.main.MethodInvoke.class);
catch(Exception exception)
throw new ExceptionInInitializerError("could not initialize the worker pool, exception=" + com.tess.hometop.gateways
.utils.Utils.parse(exception));
Could anyone explain me which is the problem?
Thanks
I'm trying to compile a code that i obtained from jad. The error is:
MethodInvoke.java:269: illegal start of type
^
At the final of the code i got:
static final
{ //here appear the problem
try
pool = new ObjectPool(com.test.wsp.main.MethodInvoke.class);
catch(Exception exception)
throw new ExceptionInInitializerError("could not initialize the worker pool, exception=" + com.tess.hometop.gateways
.utils.Utils.parse(exception));
Could anyone explain me which is the problem?
Thanks
Similar Messages
-
Problems compiling with packages
Hi,
I wonder if anyone could help me.
I have had problems compiling using a package. I have altered the classpath in autoexec.bat with:
SET CLASSPATH=%classpath%;C:\jdk1.3.1_02\classes;.
the package class files are stored in C:\jdk1.3.1_02\classes\helliker\id3
and I have imported the class with:
import helliker.id3.*;
I am getting the following error:
C:\My Documents\Uni work\mp3 project\test\Driver.java:1: package helliker.id3 does not exist
import helliker.id3.*;
^
Can anybody help?
Thanks,
DavePerhaps the version of Windows you are using does not use autoexec.bat. For example, in NT and XP, you set Classpath using ControlPanel/System/Advanced/Environment Variables.
Perhaps there is a typo in your Classpath, for example an extra space.
On a command line, try this:
javac -classpath C:\jdk1.3.1_02\classes C:\My Documents\Uni work\mp3 project\test\Driver.java
If that works, then definitely Classpath is not set as you think it is. -
Problem compiling with IVParameterSpec
I'm trying to build a password file that will be created by one program and read by a different one using CipherInput/OutputStreams. I believe that I need a repeatable key so that as I write the file, I can also read it.
I'm trying to use cipher.init (Cipher.ENCRYPT_MODE, key, ivSpec) with ivSpec set to the same array of bytes in both my read and write routines. When I try to compile the write class, I get an error at my import statement for the IVParameterSpec.
Line 78: import javax.crypto.spec.IVParameterSpec;Error:
[javac] C:\rat\jtim\src\com\baesystems\jtim\RemotePassword.java:78: cannot resolve symbol
[javac] symbol : class IVParameterSpec
[javac] location: package spec
[javac] import javax.crypto.spec.IVParameterSpec;
Do I need to load something else into the JDK to get IVParameterSpec? What could I be doing wrong?just a spelling mistake.
javax.crypto.spec.IvParameterSpecThe "v" in Iv is the small V, not the capital V.
Thanks. You'd think after 15 years of Unix, I'd be able to catch a case error. -
I am new to java.
I have recently installed jdk-1.3.1_01 and am able to compile and run basic java programs. However, when trying to compile HelloWorldSwing.java, I get the following error:
HelloWorldSwing.java:6: error:Cannot find class "JFrame" [JLS 8]
Is this a classpath problem? Please help!yes, I'm sure the code is right. What is strange is that when I first installed jdk, I was able to compile and run the swing program. Once I closed the terminal, though, and opened a new one, I was unable to compile. I'm using Linux Mandrake 8.1. Any ideas?
-
SUNWspro iostream error while compiling with SunStudio 10
We are getting the following error when we try to compile the C++ code using SunStudio 10 on Sun Solaris Sparc server.
We made couple of changes in the source code 1) whereever we have stream.h we replaced it with iostream.h and 2) include fstream.h whereever required.
Can anyone tell us where did it go wrong.
+ /opt/SUNWspro/bin/CC -g -O -DHAWK -mt -lclntsh -lsocket -lnsl -I/export/home/StandardComponents/SC/include -I../../mylib -I../../include -I/opt/SUNWspro/prod/include/CC/Cstd -I. -I- -D_TRACE_ -c collectDborMtoInfo.c
"/opt/SUNWspro/prod/include/CC/Cstd/iostream.h", line 20: Error: Use ";" to terminate declarations.
"/opt/SUNWspro/prod/include/CC/Cstd/iostream.h", line 20: Error: A declaration was expected instead of "'\n'".
"/opt/SUNWspro/prod/include/CC/Cstd/iostream.h", line 20: Error: Use ";" to terminate declarations.
"/opt/SUNWspro/prod/include/CC/Cstd/iostream.h", line 20: Error: A declaration was expected instead of "'\n'".
4 Error(s) detected.Remove the -I directive that points into the compiler installation. You should not have have -I or -L options that point into the compiler installation area, into /usr/include, or into /usr/lib. The CC compiler driver knows where to find system headers and libraries, and in what order to search the directories. If you force a different search order, you can break something.
If removing -I/opt/SUNWspro/prod/include/CC/Cstd does not fix the problem, compiling with -P or -E will show you the preprocessor output, and looking at the lines with the errors will usually show the source of the problem quickly.
BTW, you should be aware that the ".h" form of the C++ headers, like <iostream.h> and <fstream.h>, is not standard. Using them is not portable, because not all C++ implementations provide them, and those that do often have different content. -
Building regular DLL based on static libs compiled with _AFXDLL
I am trying to build a regular DLL that depends upon a set of static libs I get from elsewhere. The static libs are compiled with _AFXDLL and _AFXEXT and /MD. (The static libs are used by a different application that uses shared MFC libs.)
I can link the dll, but when it runs it fails to find CRuntimeType information for classes in those static libs. Specifically, some source in the static libs is calling:
AFX_MODULE_STATE *afxs = AfxGetModuleState();
and looking thru the afxs->m_classList which happens to be NULL. (There should be lots of classes there.)
Currently my regular DLL is linking agains the static MFC libs.
To be clear, I do not want to export any MFC classes from my dll, the MFC classes are only used internally by the static libs I'm linking my dll against. That's why I am using a regular (not mfx extension) dll.
Do I need to link my dll with shared mfc? I have a fair amount of exported functions. I would have to add
AFX_MANAGE_STATE(AfxGetStaticModuleState( ))
to every exported function right?Ok, I've tried a few things and I know more of what's going on.
I linked my dll with the shared mfc (_AFXDLL) and added the AFX_MANAGE_STATE(AfxGetStaticModuleState( )) to some of the exported functions to try it out. It switches to the dll's AFX_MODULE_STATE alright, but the class list is empty. If I break in the CWinApp initializer (before any exported functions are called) for the dll, the class list is there. So where did it go?
Well I stepped thru in the debugger and here's what's happening:
_CRT_INIT creates the AFX_MODULE_STATE for the dll and AfxClassInit() gets called lots of times to add the runtime class info. Looks like this is being done by static constructors in the static libs I'm linking my dll against. So far so good.
Then after that, InternalDllMain comes along and calls AfxInitExtensionModule( state, ... )
Here's the problem, AfxInitExtensionModule, in addition to modifing it's state argument like you would expect it to, it also has this curious line:
pModuleState->m_classList.m_pHead = pModuleState->m_pClassInit;
where pModuleState is the current (dll's) state. So my class list is wiped out because the m_pClassInit slot is NULL. The AFX_MODULE_STATE constructer sets the m_pClassInit member to NULL. Looks like it's supposed to be some kind of backup so I have no clue what AfxInitExtensionModule is doing what it's doing.
Is this a bug or do I still not have something set up right??? -
Button in Bex Analyser 7.0 - problem with setting up Static Parameters
Hello,
I know a similar problem has been discussed here already, but I am still having problems with setting up Static Parameters of my Button in BEx Analyser 7.0, so that I can pass Variable values from that button to my query.
This is what I do - in Static Parameters of my Button I set the following values:
Name Index Value
DATA_PROVIDER 0 DP_1
CMD 0 PROCESS_VARIABLES
SUBCMD 0 VAR_SUBMIT
VAR_NAME 0 0RMA_FIP
VAR_VALUE 0 004/2010
As a result, I would like the value 004/2010 to be passed to variable 0RMA_FIP (which is mandatory) and the query to be executed with that value. For some reason, however, the value is not passed correctly, and instead the variable is filled with a blank or not filled at all, and I am getting a message "Specifiy value for variable Fiscal year/period". What do I do wrong?
Just to give you a broader picture - I would like to later use this logic to pass more than one variables into a query, including a hierarchy node, and read the values from an Excel worksheet - however, after many attempts to do so, I started playing with just one variable to figure out what the problem was.
I have already seen the following two threads and SAP notes on passing variable values from the button:
Re: Button in BEx Analyzer 7.0
Re: How to set variables values via VBA.
http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/f0881371-78a1-2910-f0b8-af3e184929be?quicklink=index&overridelayout=true
Can anyone please advise?
Cheers,
ALI managed to figure it out myself!
Instead of VAR_VALUE I need to enter VAR_VALUE_EXT, and it works fine.
I will mark this thread as "answered". -
Problem in compiling with -g option
I am using forte5.1 compiler. While compiling my whole source code with -g option, for some of the files, the compilation is successfully but for some files I am getting en error as ">> Assertion (../link/dbg_stcomm.cc, line 271) while processing srsCallbacks.C at line 0. Error code 1. make:Fatal error". If I try to compile the whole source code without -g option my whole compilation is successfull. I have downloaded all the required patches for this. Previously I was using compiler 5.0 and I was not getting any error with -g option. Can u just tell me why am I facing this problem specifically with forte5.1 and not with 5.0. How can I resolve this problem so as to compile the whole source code with -g option?
Hi,
I think you will need patch:
Patch-ID# 109490-01
Synopsis: C++ 5.1: Patch for Forte Development 6 C++ compiler
As it appears that you are hitting bug id # 4312608
"Assertion: (../links/dbg_stcomm.cc, line 271)"
Can you confirm whether you are having this patch by doing:
"CC -V" or "showrev -p"
Thanks,
Gopinath.
Sun - DTS. -
Creating a 1 page scrolling site - problems with the final section scrolling too far
I have created a 1 page scrolling site that works fine apart from the final section, which scrolls too far. My site is made up of a pinned headr, a pinned footer, and 4 sections (defined by rectangles - each one 1011 pixels high). I have used scroll effects to bring the items in and out.
The site can be viewed here: Home
The problem is with the contact us section, where you seem to be able to scroll further than the bottom section.
These are my document set up settings:
so my height is set to 4042 (though I have tried it with 4044 - 4x1011 - it makes no difference. When I click on the link to the contact section it looks fine, but I then seem to be able to scroll further down, and this seems dependant on the monitor / browser size. The problem is more pronounced with a smaller monitor / browser size in height.
I have tried everything I can think of to make it not scroll beyond what the anchor takes it to when I click on the link, but whatever I do the problem seems to persist.
I would welcome any suggestions on this, and also any general feedback on the site. But help with the problem first please.
Many Thanks in advance - I would be happy to post the muse file but cannot seem to find a way to do this.
IanThanks for the help. Is there a way that I can upload the file for someone to look at - I have tried your suggestion but cannot find any empty text boxes or anything at the bottom. I have gone top right and tried the upload file section but it tells me that I am not allowed the create the content.
Actually i'll put it in dropbox and share it that way.
Dropbox - YESS2.muse
Hopefully someone with more knowledge than me can see what I have done wrong - it is my first time doing a 1 page scrolling site so it might be a school boy error
Cheers
Ian -
I've been trying to do the tutorials in a book titled Apache Jakarta-Tomcat as part of my introduction to JSP. I'm new to Java but do know the basics. I have on my machine Java 1.3, Java 1.4, Java FrameWorks 2.1 and Jython 2.1 on Win2000 Pro. So enough about my configuration. I have never worked with packages also.
I downloaded the files from the books site due to the fact I make a lot of typos when hand coding Java (I've become a pretty good debugger of my own code). But everytime I go to compile the *.java I get error messages. So below you will find HelloTag.java and beneath that the error messages that are thrown when I try and compile it. I tested other bits of *.java and have had no problem compiling them. Is there a JSP module I'm missing?
Am I doing something wrong or am I missing something from my configuration.
Marijan Madunic
package chapter2;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspTagException;
import javax.servlet.jsp.tagext.TagSupport;
public class HelloTag extends TagSupport
public void HelloTag() {
// Method called when the closing hello tag is encountered
public int doEndTag() throws JspException {
try {
// We use the pageContext to get a Writer
// We then print the text string Hello
pageContext.getOut().print("Hello");
catch (Exception e) {
throw new JspTagException(e.getMessage());
// We want to return SKIP_BODY because this Tag does not support
// a Tag Body
return SKIP_BODY;
public void release() {
// Call the parent's release to release any resources
// used by the parent tag.
// This is just good practice for when you start creating
// hierarchies of tags.
super.release();
D:\Java\JDK 1.3\bin>javac HelloTag.java
HelloTag.java:3: cannot resolve symbol
symbol : class JspException
location: package jsp
import javax.servlet.jsp.JspException;
^
HelloTag.java:4: cannot resolve symbol
symbol : class JspTagException
location: package jsp
import javax.servlet.jsp.JspTagException;
^
HelloTag.java:5: cannot resolve symbol
symbol : class TagSupport
location: package tagext
import javax.servlet.jsp.tagext.TagSupport;
^
HelloTag.java:7: cannot resolve symbol
symbol : class TagSupport
location: class chapter2.HelloTag
public class HelloTag extends TagSupport
^
HelloTag.java:14: cannot resolve symbol
symbol : class JspException
location: class chapter2.HelloTag
public int doEndTag() throws JspException {
^
HelloTag.java:20: cannot resolve symbol
symbol : variable pageContext
location: class chapter2.HelloTag
pageContext.getOut().print("Hello");
^
HelloTag.java:24: cannot resolve symbol
symbol : class JspTagException
location: class chapter2.HelloTag
throw new JspTagException(e.getMessage());
^
HelloTag.java:28: cannot resolve symbol
symbol : variable SKIP_BODY
location: class chapter2.HelloTag
return SKIP_BODY;
^
HelloTag.java:37: cannot resolve symbol
symbol : variable super
location: class chapter2.HelloTag
super.release();
^
9 errorsWell, it looks like you've not got the servlet development kit JAR on your classpath. I think it'll probably be called servlet.jar on your system. Add that to the classpath if it's not already there.
Incidentally, you've bumped into one of the areas Java's slightly lenient - declaring a method that looks like a constructor:
public HelloTag() { }
public void HelloTag() { }The first is a constructor, the second is a normal method. I'm assuming you intended to have the former instead of the latter.
Anyway, hope this helps. -
A set of specific conditions has to be met before SQLite will use an index when the LIKE operator is used in the statement:
http://www.sqlite.org/optoverview.html (see section 4.0).
One of those conditions is that the prepared statement has to be compiled with sqlite3_prepare_v2.
Is Adobe using sqlite3_prepare_v2 or sqlite3_prepare?
ThanksA set of specific conditions has to be met before SQLite will use an index when the LIKE operator is used in the statement:
http://www.sqlite.org/optoverview.html (see section 4.0).
One of those conditions is that the prepared statement has to be compiled with sqlite3_prepare_v2.
Is Adobe using sqlite3_prepare_v2 or sqlite3_prepare?
Thanks -
Static Methods with all Final Parameters
Gurus,
I know the synchronization and static method question has been hashed out ad infinitum here. However, I was thinking of a slight twist. (Did a search but could not find something related to this. If this has already been posted, my apologies).
Suppose you have a static method in which all of the parameters in the method signature are declared final. Let's assume also that you are not performing an operation with a high latency (say, database or network operations).
Would it be "safe" to leave the static method unsynchronized in a multi-threaded environment? Would the final keyword(s) ensure that, throughout method execution, there is no longer a race condition?
Would there be a difference between a primitive:
static final public void doSomething(final int param) {}
And an object that has mutator methods:
static final public void doSomething(final List param) {}
Basically, not having a formal CS background, I'm not sure how static methods are actually invoked on a low-level. It probably varies across JVM's, and maybe this question doesn't make much sense. However, I thought I would throw this out to see if anyone had implemented something similar.
I might be giving "final" too much credit., but what would actually happen in a multi-threaded environment?
Thanks much!
- Saish
"My karma ran over your dogma." - AnonI know the synchronization and static method question
has been hashed out ad infinitum here. What question's that then?
Suppose you have a static method in which all of the
parameters in the method signature are declared final.
Let's assume also that you are not performing an
operation with a high latency (say, database or
network operations).
Would it be "safe" to leave the static method
unsynchronized in a multi-threaded environment?Whether or not the parameters are final makes no difference - method parameters are local to the method and so are only visible to the current thread anyway. So making them final will have no effect on anything goning on in any other thread.
Whether or not you are performing operations has no effect on whether or not you can call a method thread-safe. It might mean there is less contention and it might make race conditions less likely, but it won't eliminate them.
So the answer is: If your would be thread safe with non-final parameters, then it will still be thread-safe when the parameters are all final. If it is not thread-safe with non-final parameters, then it will still not be thread safe with final parameters.
Would the final keyword(s) ensure that, throughout
t method execution, there is no longer a race
condition?No. Absoloutely not. -
Problem in compile with JDeveloper
Compile with JDeveloper failded if the class didn't implement the abstract method of it's super abstract class. But it is ok wiht other IDE(VisualCafe, Eclipse, JBuilder...).
It seems that JDeveloper is more strict than other IDEs.
Anyone can tell me how to avoid this error? TIA.I've found out the reason.
JDeveloper will try to compile all the source files the project used even they're not added into the project.
I have ClassA extend abstract ClassB, and ClassB extend abstract ClassC and implement the abstract methods of ClassC, they can all be compiled. And then I got a wrong source file of classB which didn't has the methods. Maybe I've kept this wrong source file for a long time but didn't get any trouble until I began to use JDeveloper and got the error.
Since I didn't add ClassB into the project and classB.class didn't changed. So I didn't noticed that a wrong source file caused the problem.
Thank you! :-) -
Problem with my Final Cut express HD's livetype & soundtrack programs
Hi everyone, hope someone could help me
In 2006 i but my Final cut Express HD for my laptop Macbook. I have used a lot, it always worked.
I haven't used it this year and the only new thing a did to my laptop was installed the snowleopard software is now 10.6.8. But yesterday, i try to save a project in my LIVETYPE and SOUNDTRACK (programs that come with the Final Cut Express HD) it automatically close up deleting everything and appear a window saying: that quit unexpectedly and push reopen and repeat the error over and over again.
the program (Livetype and Soundtrack) opens and are install perfectcly but it doesn't let you save or export anything it automatically close it up.
Final cut is the only one that let you save projects.
I have install and uninstall it many time and it still doesn't work.
I will like to know what happens? and how can i fix it?!
Thank you so much
best regards
isabellaThanks for your help! i try it and i thought it help, because this time the installation ask me new things like for example: my seriel number, etc. something the program didn't before. But in the end everything is install perfectly but it repeat the same problem when i try to save a project in livetype or soundtrack but not in final cut. This is what appears in my screen:
Thanks again!
regard -
Linker problem compiling static binary
Hi,
I am trying to produce a statically linked binary of an app. I have written, but I get the following error message when I use -static in CFLAGS:
/usr/bin/ld: cannot find -lgtk-x11-2.0
collect2: ld returned 1 exit status
make: *** [xnec2c] Error 1
The library seems to be there:
5b4az src # locate gtk-x11-2.0
/usr/lib/libgtk-x11-2.0.so.0
/usr/lib/libgtk-x11-2.0.so
/usr/lib/libgtk-x11-2.0.so.0.800.6
This is using arch 0.7. I installed arch 0.7.1 on my second hard disk but have the same problem. The app. compiles and runs if -static is not used in CFLAGS.
My thanks in advance for any hints!phrakture wrote:Umm in order to statically linked, you need a static library - not a "so" which stands for "shared object" - you're looking for libgtk-x11-2.0.a
Thanks! How did I ever manage to write Linux software :oops:
I will see what I can do to fix this...
Maybe you are looking for
-
Smart Playlist JUST for 'Free Songs of the Week?'
I would like to create a Smart playlist comprising exclusively the 'Free Songs of the Week' from the iTunes Store. So when I get the weekly 'Free Song,' it goes right into that list. But I need some sort of 'unique identifier' that allows this to hap
-
Error -23 cannot download purchased LP on computer,downloaded song without problem
I purchased an LP Miranda Lambert Platinum and it has not downloaded to my computer. In itunes-it says error -23. It has loaded on my itunes on iphone
-
Safari running very slow, freezing and unexpectantly quiting
Please help!!! this started about a week ago and is driving me mad! I have changed the proxies, turned off extensions and reset safari Here is the EtreCheck Hardware Information: MacBook Air (11-inch, Late 2010) MacBook Air - mode
-
Blue screen after log on shut down to protect computer.
Can anyone help with my options. Im running windows vista. Everytime i start my laptop after the log in screen i get a blue screen telling me my computer is shutting down for its protection. Wat do i do?
-
In the "LabWindows/CVI OS Support Roadmap" is statement of the actually supported Windows versions. I am additional interested in prognoses how lon the Windows versions will be supported (XP,Windows 7, XP Embedded, Embedded Standard).