jdk 1.7.25 CORBA idl build warning: Anonymous sequences and array are deprecated - java-7

My java project updated to jdk 1.7.25, over Solaris 10 environment, this is the first time seen that there is a new warning message in build log: Anonymous sequences and array are deprecated (build IDL)
problem: The main GUI(build by jdk 1.7.25) cannot been brought up
We think this maybe a problem(but not sure). The idl file is very simple:
$ cat UnsubscribeAttb.idl
//../../../proj/request/requestIfc/UnsubscribeAttb.idl
include ../../../proj/request/requestIfc/subscribeKey.idl
module requestIfc {
struct requestIfc {
bool subscribeKeys;
sequence<subscribeKey> UnsubscribeAttbList;
}
}
I put in "typedef" at the front of the last line, but build immediately gives an error complained this line, but didnot give me a specific reason. Looking for your help.
Thanks,
Curtis

Related

Grails application response.outputStream << fails since upgrade to Grails 3.3

I have a Grails application that I have recently upgraded to 3.3 from 2.5. Generally things are working but today we ran across a problem that seems to be shared by others but I cannot find a solution.
In a controller I have a method that appends a string to the response.outputStream.
The code now appears as
response.status = OK.value()
response.contentType = 'text/csv;charset=UTF-8'
response.setHeader "Content-disposition", "attachment; filename=rcCandidate.csv"
response.outputStream << converted
response.outputStream.flush()
response.outputStream.close()
based on a suggestion found here
http://sergiodelamo.es/grails-tips-how-to-output-csv-from-a-grails-3-controller/
This code executes just fine on my test environment
$ grails -version
| Grails Version: 3.3.5
| Groovy Version: 2.4.15
| JVM Version: 1.8.0_162
but fails badly on the production server
$ java -version
java version "1.8.0_161"
Java(TM) SE Runtime Environment (build 1.8.0_161-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.161-b12, mixed mode)
$ apt list | grep tomcat
tomcat7/trusty-security,trusty-updates,now 7.0.52-1ubuntu0.13 all [installed]
The failures are reported starting with:
org.springframework.web.util.NestedServletException: Handler dispatch failed; nested exception is java.lang.NoClassDefFoundError: javax/servlet/WriteListener
followed by a stack trace, then this
Caused by: java.lang.NoClassDefFoundError: javax/servlet/WriteListener
then more stack trace and similar messages about WriteListener
I have seen suggestions to replace this line
provided "org.springframework.boot:spring-boot-starter-tomcat"
with
compile "org.springframework.boot:spring-boot-starter-tomcat"
But as pointed out here
https://docs.grails.org/latest/guide/deployment.html
that is not a good idea, and indeed when I tried it, tomcat did not start up.
I believe I've read somewhere that I might be able to cure this problem by replacing Tomcat7 with Tomcat8; however right now I'm running Ubuntu 14.04 on the server and Tomcat8 is not on offer in the repositories, so it's not quite straightforward to test that.
Does anyone have any suggestions for me? Thanks in advance.
You can fix this by adding #CompileStatic to your method, but that is not always feasible. We have fixed this problem in our applications by adding a static utility method:
#CompileStatic
public static sendResponseData(ServletOutputStream outputStream, String s) { // but this could be byte[] s or InputStream s or whatever you need
outputStream << s
}
and then calling that instead of the left shift operation.
You may need to add additional method signatures so that they can be statically compiled but the concept is the same. If I recall correctly, the left shift operator here uses some annotation or something (clearly I don't remember details!) that is not included by default (on Tomcat 7) but is also not needed.
Note that we also added
#CompileStatic
public static flushOutputStream(ServletOutputStream outputStream) {
outputStream.flush()
}
for convenience since that one has to be statically compiled as well.

GnuCOBOL entry point not found

I've installed GnuCOBOL 2.2 on my Ubuntu 17.04 system. I've written a basic hello world program to test the compiler.
1 IDENTIFICATION DIVISION.
2 PROGRAM-ID. HELLO-WORLD.
3 *---------------------------
4 DATA DIVISION.
5 *---------------------------
6 PROCEDURE DIVISION.
7 DISPLAY 'Hello, world!'.
8 STOP RUN.
This program is entitled HelloWorld.cbl. When I compile the program with the command
cobc HelloWorld.cbl
HelloWorld.so is produced. When I attempt to run the compiled program using
cobcrun HelloWorld
I receive the following error:
libcob: entry point 'HelloWorld' not found
Can anyone explain to me what an entry point is in GnuCOBOL, and perhaps suggest a way to fix the problem and successfully execute this COBOL program?
According to the official manual of GNUCOBOL, you should compile your code with:
cobc -x HelloWorld.cbl
then run it with
./HelloWorld
You can also read GNUCOBOL wiki page which contains some exmaples for further information.
P.S. As Simon Sobisch said, If you change your file name to HELLO-WORLD.cbl to match the program ID, the same commands that you have used will be ok:
cobc HELLO-WORLD.cbl
cobcrun HELLO-WORLD
Can anyone explain to me what an entry point is in GnuCOBOL, and perhaps suggest a way to fix the problem and successfully execute this COBOL program?
An entry point is a point where you may enter a shared object (this is actually more C then COBOL).
GnuCOBOL generates entry points for each PROGRAM-ID, FUNCTION-ID and ENTRY. Therefore your entry point is HELLO-WORLD (which likely gets a conversion as - is no valid identifier in ANSI C - you won't have to think about this when CALLing a program as the conversion will be done internal).
Using cobcrun internally does:
search for a shared object (in your case HelloWord), as this is found (because you've generated it) it will be loaded
search for an entry point in all loaded modules - which isn't found
There are three possible options to get this working:
As mentioned in Ho1's answer: use cobc -x, the reason that this works is because you don't generate a shared object at all but a C main which is called directly (= the entry point doesn't apply at all)
preload the shared object and calling the program by its PROGRAM-ID (entry point), either manually with COB_PRE_LOAD=HelloWorld cobcrun HELLO-WORLD or through cobcrun (option available since GnuCOBOL 2.x) cobcrun -M HelloWorld HELLO-WORLD
change the PROGRAM-ID to match the source name (either rename or change the source, I'd do the second: PROGRAM-ID. HelloWorld.)

Too small initial heap error - stanford parser

I am trying my hands on the Stanford dependency parser. I tried running the parser from command line on windows to extract the dependencies using this command:
java -mx100m -cp "stanford-parser.jar" edu.stanford.nlp.trees.EnglishGrammaticalStructure -sentFile english-onesent.txt -collapsedTree -CCprocessed -parserFile englishPCFG.ser.gz
I am getting the following error:
Error occurred during initialization of VM
Too small initial heap
I changed the memory size to -mx1024, -mx2048 as well as -mx4096. It didn't change anything and the error persists.
What am I missing?
Type -Xmx1024m instead of -mx1024.
See https://docs.oracle.com/javase/8/docs/technotes/tools/windows/java.html
It should be -mx1024m. I skipped m.
One more thing: in the -cp, the model jar should also be included.
... -cp "stanford-parser.jar;stanford-parser-3.5.2-models.jar"...
(assuming you are using the latest version).
Otherwise an IO Exception will be thrown.
There may be some arguments that are preexisting in the IDE.
In eclipse:
Go to-> Run as-> run configuration-> Arguments
then Delete the arguments that are used previously.
Restart your eclipse.
Worked for me!

Glib-GIO-ERROR when opening an file chooser dialog

I use GTK3 , codeblcks IDE, glade3 in windows 7...
In my application i have a button which when clicked should open a gtk_file_chooser_dialog...
But gives the fillowing error..
Glib-GIO-ERROR**:No GSettings schemas are installed on the system
static void on_save_clicked(GtkWidget *widget,gpointer data)
{
GtkWidget *dialog;
//dialog=gtk_file_chooser_dialog_new("Save it",GTK_WINDOW(gtk_builder_get_object(builder,"mainwindow")),GTK_FILE_CHOOSER_ACTION_SAVE,GTK_STOCK_OK,GTK_RESPONSE_OK,GTK_STOCK_CANCEL,GTK_RESPONSE_CANCEL);
//dialog=GTK_FILE_CHOOSER_DIALOG(gtk_builder_get_object(builder,"filechooserdialog"));
gtk_widget_show_all(dialog);
gint resp=gtk_dialog_run(GTK_DIALOG(dialog));
if(resp==GTK_RESPONSE_OK)
g_print("%s\n",gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog)));
}
I use g_signal_connect(...) to call this function when the button is clicked...
I cannot understand the problem...
I got the very same error when trying to open a FileChooserDialog.
(lancer_ihm.py:1047004): GLib-GIO-CRITICAL **: g_settings_schema_source_lookup: assertion 'source != NULL' failed
(lancer_ihm.py:1047004): GLib-GIO-ERROR **: No GSettings schemas are installed on the system
Trace/breakpoint trap (core dumped)
I 'm running a Gtk3 interface with python3 on Linux.
Gtk3 and all its dependencies were installed from the sources.
I found the solution on this forum http://forum.tinycorelinux.net/index.php?topic=13699.0
I just set XDG_DATA_DIRS variable with the path to where the gtk schema files are located and it works.
$ ls /home/user1/ctcils/dusserm/applications/gtk/3.12.1/share/glib-2.0/schemas/
gschemas.compiled org.gtk.exampleapp.gschema.xml org.gtk.Settings.FileChooser.gschema.xml
org.gtk.Demo.gschema.xml org.gtk.Settings.ColorChooser.gschema.xml
$ export XDG_DATA_DIRS=/Produits/publics/x86_64.Linux.RH6/glib/2.40.0/share/:/home/user1/ctcils/dusserm/applications/gtk/3.12.1/share/
There are probably few errors in there.
If you commented both, the dialog.show_all () will produce error because, it hasn't been instantiate yet you asked to be shown.
If you use the first one, object Gtk.FileChooserDialog param has to end with NULL (in c), read the doc
If you use the second one, check your glade signal property in your glade window
Check your gtk installation
Quoting from this StackOverflow answer,
Seems you're not the one having this problem, and it also happens on Windows on MinGW. Luckily, that person gave a solution:
The thing, as it seems as I was running the test-widget example (that I
built with gtksourceview-3.0.0 using MSVC), was that I need to compile the
org.gtk.Settings.FileChooser.gschema.xml file (from GTK+-3.x, under
$(srcroot)/gtk) with the glib-compile-schemas utility that is from GLib,
which will generate gschemas.compiled in the same folder.
After that, place that gschemas.compiled file in the this folder:
$(parent_folder_of_the_gtk3_dll)\share\glib-2.0\schemas
and one will be set to use the gtkfilechooser without the puzzling
[GLib-GIO-ERROR **: Settings schema 'org.gtk.Settings.FileChooser'
is not installed] error.
I will add to my GLib project files to compile the glib-compile-schemas
utility and add to my GTK+-3.x project files to compile the
the org.gtk.Settings.FileChooser.gschema.xml shortly.

Resurrecting old PLT-Scheme project (pre-1999)

I'm trying to resurrect an old (1999 or earlier) project written in Scheme (PLT-Scheme, using the mzscheme interpreter (?) commandline tool). To make the matters worse, I don't know Scheme, or Lisp (in fact, I want to learn, but that's another story).
I have the source code of the project at:
github.com/akavel/sherman
Now, when running the code, it bails out with an error message like below:
Sherman runtime version 0.5
Hosted on MzScheme version 52, Copyright (c) 1995-98 PLT (Matthew Flatt)
reference to undefined identifier: list->block
(I've tried PLT-Scheme versions 52, 53, 103, 103p1. Earlier versions don't allow mzscheme -L option, which is referenced in the sherman.bat script used in the project. Later versions also have some more serious problems with the code or options.)
The difficulty is, that from what I see, list->block actually is defined - see: collects/sherman/BLOCK.SS line 48. So, what is wrong?
To run the code, I perform the following steps:
Download PLT-Scheme v. 103p1 (from the old versions download page - first closing the "PLT Scheme is now Racket" banner) - for Windows, use: mz-103p1-bin-i386-win32.zip.
Unzip (e.g. to directory c:\PLT).
Copy c:\sherman\collects\sherman directory with contents to: c:\PLT\collects\sherman (where c:\sherman contains the contents of the github repository).
Run cmd.exe, then cd c:\sherman.
set PATH=c:\PLT;%PATH%
sherman.bat run trivial.s
this command is in fact, from what I understand, equivalent to:
(require-library "runtime.ss" "sherman")
(parameterize ((current-namespace sherman-namespace)) (load "trivial.s"))
(current-namespace sherman-namespace)
After that, I get the error as described above (MzScheme version would be reported as 103p1 or whatever).
Could you help me solve the problem?
EDIT 2: SOLVED!
To whom it may concern, I've added a fully fledged "How to use this project" instruction on the project page, detailing the solution to the problem thanks to soegaard's help.
In short:
copy trivial.s trivial.rs
rem (the above is workaround for problems with 'r2s.exe < trivial.r > trivial.rs')
sherman.bat compile trivial.rs
sherman.bat run trivial.zo
rem (or: sherman.bat run trivial.ss)
Not an answer, but a few notes too big for a comment.
1. Sanity Check
The error message says list->block is undefined.
Make sure that the code in block.ss is run, by
inserting (display "block.ss is loaded!") in block.ss
just to make sure, the code is run.
2. Random Thoughts
The file blocks.ss begins with:
(require-library "functios.ss")
(require-library "synrule.ss")
(require-library "stream.ss" "sherman")
The file "sherman/stream.ss" is in the repository,
but where is "synrule.ss" and "functios.ss" ?
Ah... This code is old! Here is a description of
how require-library worked. It lists functios.ss
and synrule.ss as part of MzLib.
http://www.informatik.uni-kiel.de/~scheme/doc/mzscheme/node158.htm
Let's check out how require-library worked:
When require-library is used to load a file, the library name and the
resulting value(s) are recored in a table associated with the current
namespace. If require-library is evaluated for a library that is
already registered in the current namespace's load table, then the
library is not loaded again; the result(s) recorded in the load table
is returned, instead.
So when the code in block.ss is run, the names are stored in a namespace. If the current namespace is the wrong one, when the code in block.ss is evaluated, it would explain you error message of list->block being undefined.

Resources