Calling package name error?
How can I call class.function from timeline?? with package name
package game {
internal class carnode {
public function carnode() {
function printtrace():void{
trace("Tesitng package name");
Usage
var car:game.carnode=new game.carnode();
car;
You have to import the class first:
import game.carnode;
var car:carnode=new carnode();
You also need to change internal to public.
And remove the printtrace function from the carnode function. Nesting functions is very poor coding practice.
Similar Messages
-
So, i'm doing this on my own app. I made an update for an older app that was build using Native Android. But this time, i used Adobe AIR... The catch is Adobe likes to append a "air." to the front of your package name without asking you. So basically I can't upload my update because it has a new package name is now "air.com.mycompany.myapp" rather than the original "com.mycompany.myapp"
Basically I'm going through this guide..
http://helpx.adobe.com/air/kb/opt-out-air-application-analytics.html
I followed all the steps, made all the adjustments to the androidmanifest.xml like it asks.
But after going along with the above guide, with no issues when i get to the step that says
"Run the following command to create the resource file for the updated AndroidManifest.xml:"
I run this..
"/Users/brybam/Documents/eclipse/android-sdk-mac_x86/platform-tools/aapt" package -f -M AndroidManifest.xml -F resources.arsc -I "/Users/brybam/Documents/eclipse/android-sdk-mac_x86/platforms/android-8/android.jar" -S ./res
But I keep getting the same error regarding the xml files in res/layout
./res/layout/expandable_chooser_row.xml:1: error: Error parsing XML: not well-formed (invalid token)
./res/layout/expandable_multiple_chooser_row.xml:1: error: Error parsing XML: not well-formed (invalid token)
./res/layout/main.xml:1: error: Error parsing XML: not well-formed (invalid token)
./res/layout/multiple_file_selection_panel.xml:1: error: Error parsing XML: not well-formed (invalid token)
./res/layout/ssl_certificate_warning.xml:1: error: Error parsing XML: not well-formed (invalid token)
The guide doesn't say anything about these xml files, and im not sure what to do with these or how to handle them.
If i go into the res/layout folder, and just delete these (i know they're necessary. But i just deleted them as a test, to get through the rest of the guide...)
I was able to get through the rest of the steps in the guide fine, make an apk, and put it on my phone...only to find out the app will crash the moment you try to run it. Probably because i deleted the layout xml files...But i cant get the command i need to run above to accept them!
So, earlier in the guide they have me use thing thing called the "AXMLPrinter2.jar" to make the AndroidManifest.xml readable so i can edit it.
I run something like this:
java -jar "/Users/brybam/Desktop/repackage/AXMLPrinter2.jar" AndroidManifest.xml > AndroidManifest.xml.bk
This makes a new file "AndroidManifest.xml.bk" and i can edit that.
So, I was thinking with all of these layout xml files, maybe I could run this "AXMLPrinter2.jar" on them and then edit them. Because right now if you open them they're not human readable, and its hard for me to work on them if they're not...
I tried this thinking i could do the same thing...
java -jar "/Users/brybam/Desktop/repackage/AXMLPrinter2.jar" main.xml > main.xml.bk
Just get a blank file and a console erorr when trying to use the AXMLPrinter2.jar on the layout xml files...
java.lang.ArrayIndexOutOfBoundsException: 67
at android.content.res.StringBlock.getShort(StringBlock.java:231)
at android.content.res.StringBlock.getString(StringBlock.java:91)
at android.content.res.AXmlResourceParser.getName(AXmlResourceParser.java:140)
at test.AXMLPrinter.main(AXMLPrinter.java:56)
So, I think my whole issue is based around these XML files not being converted to human readable before i try and re-package....
EDIT:::
Ok, so I found a site that talks about the error I'm getting but it's in chinese, and even after translating the page...I'm still not well versed with terminal and this stuff to get it.
It reads:
"Error.
Final conclusion:
In minSdkVersion <= 7, AXMLPrinter2.jar can normally decompile xml file
Greater than 7 can not be normal decompile xml file (AndroidManifest.xml except)
Give way to share a batch decompile xml file:
First, create a *. Txt file
Stresses inside the content authoring
for / r layout%% a in (*. xml) do @ java-jar AXMLPrinter2.jar "%% a" >> "%% a". txt
Then this txt file extension into bat form, and this BAT the file and AXMLPrinter2.jar on the same directory will be decompiled xml into the layout directory
Decompilation results can be generated by executing the bat file multiple xml files."
- http://hi.baidu.com/ghcghc/item/ecbaa1ce997cb225a0b50ac2
Maybe someone with more know-how could explain what they're explaining? I get that he's saying the issue im seeing appears when you're using minSdK <=7 but I need to use minSdk 8. Does anyone understand this work around? And how I might go about it on a Mac with terminal?
I wish adobe would make it easy to remove the "air." from the package name. If they want to convert old Native devs to AIR devs...the transition needs to be seamless. But now I'm about to have to go back to Native because I can't update an app I already have out on the market with an air app.Hello~
I also tried to remove "air." package name in air application. And i encounter the same problem.
I do not find any solution to decode the xml inside res folder by AXMLPrinter2.jar. And those xml inside is compressed which is unreadable.
However, what you can do is copying the structure of res folder. And go to your air sdk file path - adobeair-sdk-folder/lib/android/lib/resources/
Replace those file exists in your res folder. And copy "values" folder to your res folder.
Hope this solve your problem~ -
How to call a stored procedure using its package name in Oracle
hi
we're doing a JDBC scenario where we call a stored procedure(a.prc) using its package name(b)The stored procedure has In /Out/IN-OUT parameter.
i have got 2 queries:
1- How to call the stored procedure using it's package.
2- How to capture the In/Out parameter in the response.hi Prateek
thanks for the reply.
However when i tried mapping it to Package.procedure, communication channel throws the error saying that Package.proceudre needs to be declared.
As i said , the procedure has IN-OUT parameter too.In oracle we need to write a block if we want to read the IN-OUT parameter.
How to get the IN-OUT parameter in XI? -
My problem is this. I have the following 3 packages.
layer1.layer2a
layer1.layer2a.layer3
layer1.layer2b
I have a interface in layer2a that is either public to everyone or private just to that package. I need for layer2b NOT to have access to it but for all packages that start with layer1.layer2a to have access to it. So package layer1.layer2a.layer3 would have access to it and package layer1.layer2b would not.
I thought that if I could get the calling classes package name I could return a null value if the package name does not start with layer1.layer2a, however the below code always returns null.
this.getClass().getPackage(); //returns null
this.getClass().getDeclaringClass() //returns null
All of my classes definetly have package names so I'm not sure why the first line returns null. And yes I know that the first line will not return the calling classes package. I was just testing it.
Can anyone help me with this? If you have a better solution to my problem please post.
Below is my code example.
package layer1.layer2a;
public class DataFile {
private String userId="test";
public String getUserId(){
//System.out.println("package name = "+this.getClass().getPackage());
//System.out.println("calling class is = "+this.getClass().getDeclaringClass());
return userId;
-----------------------calling class---------------------------
package layer1.layer2a;
public class MyTest{
public void callDataFile(){
DataFile df = new DataFile();
String s = df.getUserId();
System.out.println("s = "+s);
}So package layer1.layer2a.layer3 would have access to it and package layer1.layer2b would not.Not possible.
There is no hierarchial relationship between packages. Given the following packages:
A.B
A.B.C
A.Z
The package A.B.C has the same relationship to A.B as it does to A.Z. There is no way to give expose something to one package without exposing it to all other packages.
Solutions:
-Look at the design again. Maybe it can be refactored to provide a different solution.
-Just expose it, and document that the interface should only be used in a certain way. -
it says there is an error "package name is Adobe Reader XI, upgrading at base path / installer. The upgrade failed.
It does this at 81%. I am using a MACit says there is an error "package name is Adobe Reader XI, upgrading at base path / installer. The upgrade failed.
It does this at 81%. I am using a MAC -
Javadoc: error Illegal package name: JNI
Hi,
After writting the Java code using native method, Like
package jni;
public class jniFile {
static{
System.loadLibrary("jniFile");
public jniFile() {
System.out.println("Inside constructor ");
private native void printMessage(String msg);
public static void main(String[] args) {
jniFile m= new jniFile();
m.printMessage("String from java");
I tried to create the header file using javah -jni jniFile.
i got "javadoc: error - Illegal package name: "D:\JNI\build\classes\jni" error.
Can any one help me.
Thanks in advance.The jni package which i used is a user defined one.
Now i changed it to jniPack.
Still i cant able to create a header file.
I am using netbean IDE 5.0.
I got the following error
C:\Documents and Settings\GUNR2818>javah -jni D:\JNI\build\classes\jniPack\jniPack
javadoc: error - Illegal package name: "D:\JNI\build\classes\jniPack\jniPack"
1 error -
why did I get an error message; installer: Package name is Adobe reader XI (11.0.10) installer: Certificate used to sign package is not trusted. Use -allowUntrusted to override?
Hi sgtwalker1226,
For Which operating system are you downloading the installer?
Regards,
Rahul -
Javadoc: error - Illegal package name: ""
When I try to generate javadoc through IntelliJ IDEA 5.1.2 I get this result:
/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/bin/javadoc -package -splitindex -author -version
-classpath /Users/jonsjoberg/Desktop/mysql-connector-java-3.1.13/mysql-connector-java-3.1.13-bin.jar
-sourcepath /Users/jonsjoberg/programmering/storage/src -d
/Users/jonsjoberg/programmering/storage
/Users/jonsjoberg/programmering/storage/src/GeneralFunctions.java se.rifotech.databasefunctions
/Users/jonsjoberg/programmering/storage/src/MainWindow.java
/Users/jonsjoberg/programmering/storage/src/HistoryTableModel.java
/Users/jonsjoberg/programmering/storage/src/databaseStatements.java
/Users/jonsjoberg/programmering/storage/src/RedListTableModel.java
/Users/jonsjoberg/programmering/storage/src/OpenWindows.java
/Users/jonsjoberg/programmering/storage/src/EntityWindow.java
/Users/jonsjoberg/programmering/storage/src/ShowAllTableModel.java
/Users/jonsjoberg/programmering/storage/src/ShowAllWindow.java
/Users/jonsjoberg/programmering/storage/src/HistoryWindow.java
Loading source file /Users/jonsjoberg/programmering/storage/src/GeneralFunctions.java...
Loading source file /Users/jonsjoberg/programmering/storage/src/MainWindow.java...
Loading source file /Users/jonsjoberg/programmering/storage/src/HistoryTableModel.java...
Loading source file /Users/jonsjoberg/programmering/storage/src/databaseStatements.java...
Loading source file /Users/jonsjoberg/programmering/storage/src/RedListTableModel.java...
Loading source file /Users/jonsjoberg/programmering/storage/src/OpenWindows.java...
Loading source file /Users/jonsjoberg/programmering/storage/src/EntityWindow.java...
Loading source file /Users/jonsjoberg/programmering/storage/src/ShowAllTableModel.java...
Loading source file /Users/jonsjoberg/programmering/storage/src/ShowAllWindow.java...
Loading source file /Users/jonsjoberg/programmering/storage/src/HistoryWindow.java...
javadoc: error - Illegal package name: ""
Loading source files for package se.rifotech.databasefunctions...
1 error
javadoc exited with exit code 1
What seems to be the problem? Is it in my code? In HistoryWindow?My previous analysis was incorrect -- I had overlooked the line "Loading source files for package se.rifotech.databasefunctions...", so that package is being loaded.
The error message means it's encountered an empty string on the command line that it's trying to process as a package name.
I'm not familiar with how IntelliJ runs javadoc. It's interesting that the error Illegal package name "" occurs before the loading of the databasefuncitons package. That tells me there is possibly something before the line "se.rifotech.databasefunctions". I would make sure there are no newlines in the entire command.
BTW, are you use you want to use the -package option? That is somewhat unusual. It says you want to document the package-private members. People often mistakenly think it means they want to document packages.
http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/javadoc.html#package
-Doug -
I sometimes get the following error randomly -
Package Validation Error
ADDITIONAL INFORMATION:
Error at MY_PACKAGE_PLUS[Connection manager "MY_DATABASE"]: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80040E4D.
An OLE DB record is available. Source: "Microsoft SQL Server Native Client 10.0" Hresult: 0x80040E4D Description: "Login failed for user 'USERNAMEZ'.".
Error at MY_PACKAGE_PLUS [Log provider "SSIS log provider for SQL Server"]: SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER. The AcquireConnection method call to the connection manager "MY_DATABASE" failed with error
code 0xC0202009. There may be error messages posted before this with more information on why the AcquireConnection method call failed.
(Microsoft.DataTransformationServices.VsIntegration)
My package name in SSIS/BIDS is MY_PACKAGE, but in the error I see MY_PACKAGE_PLUS, which was the name of an older version of the package. This error goes away when I close SSIS and then restart it. I wonder why this happens and how do I fix it
? Is this some bug in SSIS ? The same package runs without errors in SQL server agent.
Thanks.It seems the old package reference still exists in your project bin folder or inside stproj file. WHich is why it tries to validate the older package each time when you start the project.
Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs -
Hi,
I created a package in eclipse with 3 .java files under it.
In each of the three java files I have included the "package testpackage;" clause at the top.
My first 2 files (lets call them one.java and two.java) is referenced in three.java, thus I use the import statement for both one and two in three.java.
After I compile all 3 successfully in Eclipse, I go to the command line, to the specific directory (testpackage) and run: java one, but I get the message:
NoClassDefFoundError: 1 (wrong name: testpackage/one)
What is wrong?I found that you need to be in the PACKAGE directory when you execute the "java" command, not the directory containing the .class file(s). For example, if you have the following statement in your java program:
package buServer;
Your .class files (BUreceiver.class in my case) will reside in a directory named buServer. You need to be in the directory ABOVE the one that contains your class files (the package directory) and execute the program as shown below:
java buServer/BUreceiver
The above assumes that the current directory is in your CLASSPATH or is given by the " -cp ." on the java command line.
The basic problem, I think, is that CLASSPATH points to directories that are supposed to contain .class files. When you use a package, you have to give the fully quallified name of the class with a root beginning in one of the directories in the CLASSPATH. In my case, the "package" statement says my class should be in a <CLASSPATH>\buServer\ directory. When I was in the buServer directory (containing my .class files) and added it to the CLASSPATH, there was no <CLASSPATH>\buServer\ directory, since the buServer\ directory was inside CLASSPATH. However, when I tried to execute it without qualifying it with the "buServer", it saw the package statement in the class file that was there and gave me the "wrong name" error.
Another solution would have been to take out the package statement from the program. -
Function not found when package name exists with same name as schema name
Hi all, any help would be appreciated :)
I found an issue with pl/sql resolving a functions location when the db has a package name with the same as the db schema name.
My example:
-- arbitrary test function, not in any package
create or replace FUNCTION testFunc
inTest IN VARCHAR2
RETURN VARCHAR2
AS
BEGIN
RETURN 'a';
END;
-- There is a package called "FM" with functions that are not referenced or used in this example and the db schema is "FM".
-- The following PL/SQL fails with the message: "ORA-00904: "FM"."TESTFUNC": invalid identifier"
select cursor (select testFunc('a') from dual) from dual;
-- The following PL/SQL works:
select * from (select testFunc('a') from dual);
As mentioned the function testFunc is NOT in the FM package. This issue does not happen when I remove the FM package. So it seems like there is an issue with cursors calling functions when there exists any package with the same name as the db schema.
Can anyone tell me why this happens and also what I can add to force the function that is not in any package to be referenced (without Oracle trying to look in the FM package)?
DB: Oracle 11.2.0.2
thanks!
PaulHi Paul,
In general I would not advice to have schema and objects with the same name.
Here is what documentation is saying here: How Name Resolution Differs in PL/SQL and SQL
PL/SQL uses the same name-resolution rules as SQL when the PL/SQL compiler processes a SQL statement, such as a DML statement. For example, for a name such as HR.JOBS, SQL matches objects in the HR schema first, then packages, types, tables, and views in the current schema.
PL/SQL uses a different order to resolve names in PL/SQL statements such as assignments and subprogram calls. In the case of a name HR.JOBS, PL/SQL searches first for packages, types, tables, and views named HR in the current schema, then for objects in the HR schema.As you can see above when using PL/SQL for your case Oracle searches first for packages, types, tables, and views named FM in the current schema, then for objects in the FM schema.
And because a package FM is found it is raising an error due to the fact that the procedure could not be found in that package.
I hope this clarify.
Regards.
Al -
Oracle Invalid Column Name Error in JSP
I was wondering if anyone could provide some help. I am new to JSP, Beans and Oracle and I am getting a java.sql.SQLException: ORA-00904: invalid column name error when I run the JSP below. The Java Bean's code it is referencing is also included and this bean is just storing information from the server from a previous login page.
Eventually I need to display more columns from the database using this JSP, but since I can even get this one working, I am at a loss!
PLEASE HELP!!!!
I have even tried to replace the beans reference in the sql with just a login and password I know exists in the database! Same error... Help!
I am running Tomcat and Oracle 9i!
<!--
Assign-->
<html>
<head>
<title>Student Signon on page</title>
</head>
<body bgcolor="#FDF5E6">
<h1 align="center">>Student Signon on page</h1>
<%@ page import="java.sql.*" %>
<%@ page import="BeanAs2.Bean5b" %>
<%
String driverClassString = "oracle.jdbc.driver.OracleDriver";
String driverConnectString;
driverConnectString = "jdbc:oracle:thin:@midas2:1521:globaldb";
String user = "system";
String passwd = "manager";
%>
<jsp:useBean id="Bean5b" class="BeanAs2.Bean5b" />
<jsp getProperty id = "Bean5b" property = "login" />
<jsp getProperty id = "Bean5b" property = "pswd" />
<%
Connection connection = null;
try {
Class.forName(driverClassString);
connection = DriverManager.getConnection(driverConnectString, user, passwd);
catch (Exception e) {
out.println("Cannot close connect to database!"+e);
if (connection != null) {
String login =Bean5b.getpassword();
String pswd =Bean5b.getStudentlogin();
String sql = "SELECT studentinfo.familyname FROM STUDENTINFO WHERE studentinfo.username='login' AND studentinfo.password='pswd';";
try { // execute the query
//SELECT studentinfo.familyname FROM STUDENTINFO WHERE studentinfo.username='s40079703' AND studentinfo.password='p4007swd'
Statement stmt = connection.createStatement();
ResultSet rst;
rst = stmt.executeQuery(sql);
// Fetch the query result, and dispaly them in a table
while (rst.next()) {
%>
<tr>
<td> <%= rst.getString("system.teaching.code") %> </td>
</tr>
<%
stmt.close();
connection.close();
} catch(Exception e) {
out.println("Cannot fetch data from database!"+e);
%>
</body></html>
package BeanAs2;
import java.util.*;
public class Bean5b {
// all variables must not be public in a bean
private String Studentlogin;
private String password;
public String getStudentlogin() {
return this.Studentlogin;
public String getpassword() {
return this.password;
public void setStudentlogin(String login) {
this.Studentlogin = login;
public void setpassword(String pswd) {
this.password = pswd;Hi
Thanks for your reply, I should of looked at my code before I copied over. The field should of been "studentinfo.familyname" which I was calling, I have just been changing so much code in this to try and see what the problem is, I didnt fix this before I copied this over.... trust me, I have tried everything........ Hence when I correctly called the "concatination the login name and password to the query properly" as you pointed out, I got rid of the error, BUT now it returning NO DATA????? (the table is populated - I have checked this!!!!)
The table I am trying to get information from sits under a schema called system. It has the following columns;
STUDENTID NUMBER 8
FAMILYNAME VARHCAR 60
GIVENNAME VARCHAR 60
USERNAME VARCHAR 9
PASSWORD VHARCHAR 60
The database is called globaldb. My computer is called Midas2
Whats more, the query works in Oracle sql*plus!!! Returning the relevent data!!!
Actually here is the code for the JSP, with all the changes and none of the mistakes of my previous post...........,
Pleaes help!!!
<html>
<head>
<title>Student Signon on page</title>
</head>
<body bgcolor="#FDF5E6">
<h1 align="center">>Student Signon on page</h1>
<%@ page import="java.sql.*" %>
<%@ page import="BeanAs2.Bean5b" %>
<%
String driverClassString = "oracle.jdbc.driver.OracleDriver";
String driverConnectString;
driverConnectString = "jdbc:oracle:thin:@midas2:1521:globaldb";
String user = "system";
String passwd = "manager";
%>
<jsp:useBean id="Bean5b" class="BeanAs2.Bean5b" />
<jsp getProperty id = "Bean5b" property = "login" />
<jsp getProperty id = "Bean5b" property = "pswd" />
<%
Connection connection = null;
try {
Class.forName(driverClassString);
connection = DriverManager.getConnection(driverConnectString, user, passwd);
catch (Exception e) {
out.println("Cannot close connect to database!"+e);
if (connection != null) {
String login =Bean5b.getpassword();
String pswd =Bean5b.getStudentlogin();
String sqlQuery;
sqlQuery = ("SELECT studentinfo.familyname FROM STUDENTINFO WHERE studentinfo.username='" + login + "' AND studentinfo.password='" + pswd + "'"); %>
<% try { // execute the query
Statement stmt = connection.createStatement();
ResultSet rst;
rst = stmt.executeQuery(sqlQuery);
// Fetch the query result, and dispaly them in a table
while (rst.next()) {
%>
<tr>
<td> <%= rst.getString("studentinfo.familyname") %> </td>
</tr>
<%
stmt.close();
connection.close();
} catch(Exception e) {
out.println("Cannot fetch data from database!"+e);
%>
</body></html> -
AUR won't accept PKGBUILD with numbers in the Package Name
Trying to submit a PKGBUILD called:
gstreamer0.10-pitfdll-cvs
I am getting an error "Invalid name: only lowercase letters are allowed."
Does this mean that numbers are not allowed in the package names in AUR?
The error goes away once I remove the numbers but that creates other errors, such as a mismatch with the name in the PKGBUILD file.
This package is just another plugin for the gstreamer0.10 series of packages in Arch.B4 I forget what started this little mess, allow me to present:
# Contributor: Kurt B Cox <kurtbcox>
pkgname=gstreamer0.10-pitfdll-cvs
pkgver=20060421
pkgrel=1
pkgdesc="A set of plugins for Gstreamer for proprietary codecs"
url="http://pitfdll.sourceforge.net"
license="GPL"
depends=('gstreamer0.10-base' 'codecs')
makedepends=('cvs')
groups=(gstreamer0.10-plugins)
provides=('gstreamer0.10-pitfdll')
conflicts=('gstreamer0.10-pitfdll')
options=('NOLIBTOOL')
_cvsroot=":pserver:anonymous:@pitfdll.cvs.sourceforge.net:/cvsroot/pitfdll"
_cvsmod="pitfdll"
build() {
cd $startdir/src
msg "Connecting to $_cvsmod.sourceforge.net CVS server...."
cvs -z3 -d $_cvsroot co -D $pkgver -f $_cvsmod
msg "CVS checkout done or server timeout"
msg "Starting make..."
[ -d $_cvsmod-build ] && rm -r $_cvsmod-build
cp -r $_cvsmod $_cvsmod-build
cd $_cvsmod-build
./autogen.sh --prefix=/usr --with-dlldir=/usr/lib/win32
make || return 1
make DESTDIR=$startdir/pkg install || return 1
# vim:syntax=sh -
Package name ending with .java
Hi,
I have some trouble with a package name ending with "fragments.java". When I use 'packagenames' javadoc complains when it reaches that package.
I'm guessing javadoc thinks it's a source file and tries to parse it as such.
I have found a workaround by using 'subpackages' instead of 'packagenames' but I want it work with ant, which doesn't support the subpackages flag.
Is there a way to get around this?
- HenrikNot at all.
Assume that there is a package called something.smthing.java
Then this won't work:
<javadoc sourcepath="${src_dir}" destdir="${doc_dir}"
packagenames="something.*"/>
It will give the following error message because it thinks it is a source file:
[javadoc] Loading source file something.smthing.java...
[javadoc] error: cannot read: something.smthing.java
So, you can get around that by doing like this instead:
<javadoc sourcepath="${src_dir}" destdir="${doc_dir}"
packagenames="something"
additionalparam="-subpackages something"/>
Which gives the -subpackages option to javadoc. -
Will a jni header accept a package name with "." in between
My java class for native function call is included in a package with name like "xxx.yyy.zzz"
So when I edit the jni class in header file generated to include the package name ,it shows error.
Is it possible to write jni class for a native function defined in java class which such package name?My java class is like this.
package aaa.bbb.ccc;
public class Sample{
static {
try {
System.loadLibrary("WMSMS");
} catch (UnsatisfiedLinkError e) {
System.err.println("WMSMS.dll failed to load. \n" + e);
System.exit(1);
final static native int SendSMS(boolean a, boolean b, String SMSC,String phno, String msg);
public static int sendSMS(String phoneno, String message){
int msent = SendSMS(false,true,"",phoneno,message);
return msent;
}The header file generated has function like:
JNIEXPORT jint JNICALL Java_Sample_SendSMS
(JNIEnv *, jclass, jboolean, jboolean, jstring, jstring, jstring);So I changed it to
JNIEXPORT jint JNICALL Java_aaa.bbb.ccc_WMSMS_SendSMS
(JNIEnv *, jclass, jboolean, jboolean, jstring, jstring, jstring);But then the cpp code showed errors on compiling.
I dont want to change package name ,since all other classes of the project are included in it and we use this format to easily distinguish the packages (for more clarity) .
Otherwise using a simple package name works fine and i m able to call the cpp dll with the jni.
Maybe you are looking for
-
Using a variable instead of a table reference
I have a table that contains a dblink name. I would like to have a procedure that reads the link into a variable and uses that link in select statements. So far, I cannot get this to work. Any ideas?
-
"Your request is temporarily unable to be processed. Please try again later" iTunes Store
I have a user with a new iPad2, who has set up an iTunes account. It takes her username and password, which it recognizes (it fails if she fat-fingers it). Then it says that it is a new account, and offers her the terms and conditions which she agr
-
How do I change default page from USA to United Kingdom
HHow do I change default page from USA to uk
-
BT email accounts rejecting emails we send on beha...
Hi I work for a company that hosts multiple databases for customers in the Estate and Letting industry and we offer the facility for them to email their clients through our system. We affectivly send the emails on behalf of the user from our server u
-
How can i make something look like it was embossed in PS?
I have a simple shape...a rectangle filled with a solid color. It is a separator bar on a poster. I want the top of the bar to have highlight and the bottom of the bar to be darkened. (As if I brought it into PS and applied an emboss filter) I tried