I created two agents and it runs well. but when I add Ontology class and registered the ontology I can't create the agents... I got following errors..
Jun 1, 2012 8:56:55 AM jade.core.BaseService init
INFO: Service jade.core.management.AgentManagement initialized
Jun 1, 2012 8:56:55 AM jade.core.BaseService init
INFO: Service jade.core.messaging.Messaging initialized
Jun 1, 2012 8:56:55 AM jade.core.BaseService init
INFO: Service jade.core.mobility.AgentMobility initialized
Jun 1, 2012 8:56:55 AM jade.core.BaseService init
INFO: Service jade.core.event.Notification initialized
Jun 1, 2012 8:56:55 AM jade.core.messaging.MessagingService clearCachedSlice
INFO: Clearing cache
Jun 1, 2012 8:56:55 AM jade.mtp.http.HTTPServer <init>
INFO: HTTP-MTP Using XML parser com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser
Jun 1, 2012 8:56:55 AM jade.core.messaging.MessagingService boot
INFO: MTP addresses:
http://169.254.108.164:7778/acc
Jun 1, 2012 8:56:55 AM jade.core.AgentContainerImpl startBootstrapAgents
SEVERE: Cannot create agent STMAgent: An undeclared exception was thrown [nested java.lang.ExceptionInInitializerError]
Jun 1, 2012 8:56:55 AM jade.core.AgentContainerImpl startBootstrapAgents
SEVERE: Cannot create agent REquestAgent: An undeclared exception was thrown [nested java.lang.NoClassDefFoundError: Could not initialize class FruitOntology.FruitOntology]
Jun 1, 2012 8:56:55 AM jade.core.AgentContainerImpl joinPlatform
class paths are correct. Ontology class paths are also correct.. What is the reason for this? Plz help me............
I found error.. it is on my ontology class..
Thank you..
The crucial error message seems to be:
SEVERE: Cannot create agent REquestAgent: An undeclared exception was thrown
[nested java.lang.NoClassDefFoundError:
Could not initialize class FruitOntology.FruitOntology]
Your code is not finding class FruitOntology in the package FruitOntology (which isn't a very good package name - normally, a package name would start with a lower-case letter, and would normally follow the convention of reversing the domain name of the organization).
As you haven't shown any of your code, we can only guess why that error arises. Have you perhaps mis-spelled the name in a configuration file somewhere? Do a grep through your project to see where FruitOntology.FruitOntology occurs. It probably isn't in normal Java code, as you would get a compilation error for missing classes, unless you're using Java Reflection for some reason.
Related
I'm having trouble creating an agent with JADE.
My structure
/
Applications
jade
lib
jade.jar
jadeExamples.jar
src
examples
hello
HelloWorldAgent.class
HelloWorldAgent.java
My file HelloWorldAgent.java
package examples.hello;
import jade.core.Agent;
public class HelloWorldAgent extends Agent {
protected void setup() {
System.out.println("Hello! My name is "+getLocalName());
}
}
The steps I follow to create an agent :
/Applications/jade/src/examples/hello $ javac *.java
/Applications/jade/src/examples/hello $ java jade.Boot -gui -agents fred:examples.hello.HelloWorldAgent
Myclasspath
/Library/Java/JavaVirtualMachines/jdk-12.0.2.jdk/Contents/Home:/Applications/jade/lib/jade.jar:/Applications/jade/lib/jadeExamples.jar:/Applications/jade/src/
The output
Sep 21, 2019 5:28:05 PM jade.core.Runtime beginContainer
INFO: ----------------------------------
This is JADE 4.5.0 - revision 6825 of 23-05-2017 10:06:04
downloaded in Open Source, under LGPL restrictions,
at http://jade.tilab.com/
----------------------------------------
Sep 21, 2019 5:28:05 PM jade.imtp.leap.LEAPIMTPManager initialize
INFO: Listening for intra-platform commands on address:
- jicp://192.168.1.104:1099
Sep 21, 2019 5:28:06 PM jade.core.BaseService init
INFO: Service jade.core.management.AgentManagement initialized
Sep 21, 2019 5:28:06 PM jade.core.BaseService init
INFO: Service jade.core.messaging.Messaging initialized
Sep 21, 2019 5:28:06 PM jade.core.BaseService init
INFO: Service jade.core.resource.ResourceManagement initialized
Sep 21, 2019 5:28:06 PM jade.core.BaseService init
INFO: Service jade.core.mobility.AgentMobility initialized
Sep 21, 2019 5:28:06 PM jade.core.BaseService init
INFO: Service jade.core.event.Notification initialized
Sep 21, 2019 5:28:11 PM jade.mtp.http.HTTPServer <init>
INFO: HTTP-MTP Using XML parser com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser
Sep 21, 2019 5:28:11 PM jade.core.messaging.MessagingService boot
INFO: MTP addresses:
http://192.168.1.104:7778/acc
Hello World! My name is fred
Sep 21, 2019 5:28:11 PM jade.core.AgentContainerImpl joinPlatform
INFO: --------------------------------------
Agent container Main-Container#192.168.1.104 is ready.
--------------------------------------------
My problem
If I change the message in the HelloWorldAgent (e.g. System.out.println("Hello ! My name is "+getLocalName());), it doesn't update when I run my agent (the console says Hello World! My name is fred). And when I create a new class in the hello folder, I can't find my agent in the GUI.
What have I missed?
You have not set the classpath correctly. As mentioned in the accepted answer to 'What is a classpath and how do I set it?', your classpath can contain two entry types:
So, classpaths contain:
JAR files, and
Paths to the top of package hierarchies.
In your case you have reference ONLY the following .jar files :
/Library/Java/JavaVirtualMachines/jdk-12.0.2.jdk/Contents/Home
/Applications/jade/lib/jade.jar
/Applications/jade/lib/jadeExamples.jar
Notice that your working path /Applications/jade/src/examples/hello/ is not in the classpath. This means that your custom jade classes are not visible/accessable.
To solve your problem you have to add the additional paths you want to use in your classpaths. Usually you use the directory . to indicate that you want the "current directory" in your classpath.
Keep in mind that you have the JAR file jadeExamples.jar in your classpath. When you have a .class file for your changed HelloWorldAgent class it might not be clear which class the JVM is loading, the one from the JAR file or the .class file from the file system. Do not provide the same class with the same package in your classpath twice or even change the jadeExamples.jar file with a new changed JAR file (this might be even more confusing). Instead, create a new agent in YOUR package/namespace/directory and load it -agents foobar:your.package.and.ClassName, but ensure that the classpath is set correctly .
We have an application with a java component and a com component, the communication between which is facilitated through j-Interop.
We have been using this for almost 3 years with no major issues, but only recently we have observed that our java components fails while it tries to commumnicate with the com object with the error - Access is denied [0x00000005].
The com object is working we have testing the same, also the DCOM configurations have been verified multiple times following this exception.
The DCOM settings were verified with respect to the following link -
http://www.softwaretoolbox.com/dcom/html/configuring__local_security_settings1.html
The version we are using is j-interop-3.0.
We have also taken this up with Microsoft support, and as per the joint debugging it was inferred that the calls are not reaching the ole layer, hence we need to look into the error thrown by j-Interop.
The server environment where we are facing this problem is Windows Server R2 2008 standard and Windows Server 2016 Standard.
Is there anything that can be done differently in order to resolve this issue?
Below is the complete stack trace of the error that we are getting :
Aug 09, 2017 4:30:15 PM org.jinterop.dcom.core.JIComOxidRuntime$ClientPingTimerT
ask run
INFO: Running ClientPingTimerTask !
Aug 09, 2017 4:30:15 PM org.jinterop.dcom.core.JIComOxidRuntime$ServerPingTimerT
ask run
INFO: Running ServerPingTimerTask !
Aug 09, 2017 4:30:15 PM org.jinterop.dcom.core.JISession createSession
INFO: Created Session: 1042741037
Aug 09, 2017 4:30:16 PM org.jinterop.dcom.common.JISystem internal_dumpMap
INFO: mapOfHostnamesVsIPs: {}
Aug 09, 2017 4:30:16 PM rpc.DefaultConnection processOutgoing
INFO:
Sending BIND
Aug 09, 2017 4:30:16 PM rpc.DefaultConnection processIncoming
INFO:
Recieved BIND_ACK
Aug 09, 2017 4:30:16 PM rpc.DefaultConnection processOutgoing
INFO:
Sending AUTH3
Aug 09, 2017 4:30:16 PM rpc.DefaultConnection processOutgoing
INFO:
Sending REQUEST
Aug 09, 2017 4:30:16 PM rpc.DefaultConnection processIncoming
INFO:
Recieved FAULT
org.jinterop.dcom.common.JIException: Access is denied, please check whether the
[domain-username-password] are correct. Also, if not already done please check
the GETTING STARTED and FAQ sections in readme.htm. They provide information on
how to correctly configure the Windows machine for DCOM access, so as to avoid s
uch exceptions. [0x00000005]
at org.jinterop.dcom.core.JIComServer.init(JIComServer.java:661)
at org.jinterop.dcom.core.JIComServer.initialise(JIComServer.java:496)
at org.jinterop.dcom.core.JIComServer.<init>(JIComServer.java:460)
at TestConnectivity.initialize(TestConnectivity.java:128)
at TestConnectivity.HDAconnect(TestConnectivity.java:165)
at TestConnectivity.main(TestConnectivity.java:82)
Caused by: rpc.FaultException: Received fault. (unknown)
at rpc.ConnectionOrientedEndpoint.call(ConnectionOrientedEndpoint.java:1
41)
at rpc.Stub.call(Stub.java:113)
at org.jinterop.dcom.core.JIComServer.init(JIComServer.java:626)
... 5 more
Exited
Aug 09, 2017 4:30:16 PM org.jinterop.dcom.core.JISession postDestroy
INFO: About to destroy links for Session: 1042741037 , size of which is 0
Any help will be appreciated.
Thank you.
Hope the following solution works for you. It worked for me.
apply the following patch to the registry:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System
create or modify 32-bit DWORD: LocalAccountTokenFilterPolicy
set the value to: 1
You can refer https://answers.microsoft.com/en-us/windows/forum/windows_7-security/getting-access-is-denied-when-accessing-windows-7/23369f35-bc45-4147-9c3e-74a47d530757
--
SK
After reaching the 200 limit of indexes, i need to vacuum the indexes of my application.
Using AppEngine 1.8.6, if I launch the usual command for this operation
..\appengine-java-sdk-1.8.6\bin\appcfg.cmd vacuum_indexes C:\MyGaeProject\war
I get the following error
WARNING: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002. Windows RegCreateKeyEx(...) r
eturned error code 5.
Reading application configuration data...
ott 23, 2013 2:49:30 PM com.google.apphosting.utils.config.AppEngineWebXmlReader readAppEngineWebXml
INFO: Successfully processed C:\MyGaeProject\war\WEB-INF/appengine-web.xml
ott 23, 2013 2:49:30 PM com.google.apphosting.utils.config.AbstractConfigXmlReader readConfigXml
INFO: Successfully processed C:\MyGaeProject\war\WEB-INF/web.xml
ott 23, 2013 2:49:30 PM com.google.apphosting.utils.config.AbstractConfigXmlReader readConfigXml
INFO: Successfully processed C:\MyGaeProject\war\WEB-INF/cron.xml
ott 23, 2013 2:49:30 PM com.google.apphosting.utils.config.AbstractConfigXmlReader readConfigXml
INFO: Successfully processed C:\MyGaeProject\war\WEB-INF/queue.xml
ott 23, 2013 2:49:30 PM com.google.apphosting.utils.config.IndexesXmlReader readConfigXml
INFO: Successfully processed C:\MyGaeProject\war\WEB-INF/datastore-indexes.xml
Beginning interaction for module default...
10% Found 79 local index definitions.
Error Details:
Line 0, column 12: Unable to find property 'application' on class: com.google.apphosting.utils.config.IndexYamlReader$In
dexYaml
Unable to perform vacuum_indexes
Unable to perform vacuum_indexes
Please see the logs [C:\UserTemp\appcfg6705503051002284735.log] for further information.
PS C:\Program Files (x86)\appengine-java-sdk-1.8.6\bin> .\appcfg.cmd vacuum_indexes "C:\MyGaeProject\war"
ott 23, 2013 2:50:18 PM java.util.prefs.WindowsPreferences <init>
WARNING: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002. Windows RegCreateKeyEx(...) returned error code 5.
Reading application configuration data...
ott 23, 2013 2:50:19 PM com.google.apphosting.utils.config.AppEngineWebXmlReader readAppEngineWebXml
INFO: Successfully processed C:\MyGaeProject\war\WEB-INF/appengine-web.xml
ott 23, 2013 2:50:19 PM com.google.apphosting.utils.config.AbstractConfigXmlReader readConfigXml
INFO: Successfully processed C:\MyGaeProject\war\WEB-INF/web.xml
ott 23, 2013 2:50:19 PM com.google.apphosting.utils.config.IndexesXmlReader readConfigXml
INFO: Successfully processed C:\MyGaeProject\war\WEB-INF/datastore-indexes.xml
Beginning interaction for module default...
10% Found 0 local index definitions.
Error Details:
Line 0, column 12: Unable to find property 'application' on class:
com.google.apphosting.utils.config.IndexYamlReader$IndexYaml
Unable to perform vacuum_indexes
Unable to perform vacuum_indexes
For testing purpose, I also tried and empty datastore-indexes.xml, but nothing
Even using Linux I get the same error
Same thing with Python
02:39 PM Application: my-gae-app
02:39 PM Host: appengine.google.com
02:39 PM Fetching index definitions diff.
Email: my-gae-email
Password for my-gae-email:
Error parsing yaml file:
Unexpected attribute 'application' for object of type IndexDefinitions.
in "<string>", line 2, column 14:
application: null
^
As i can read, i'm not the only one experiencing this error
Already tried with older SDKs of Java, an new blank project and another GAE application, same problems so far
EDIT:
I updated Python SDK to latest version (1.8.6, was 1.8.5), the error above is not shown anymore, but now i'm getting another error
Error 400: --- begin server output ---
Client Error (400)
The request is invalid for an unspecified reason.
--- end server output ---
Updating to the latest SDK [1.8.6] may resolve this.
I resolved the issue for Python SDK by installing the latest SDK.
The issue I met is:
Error parsing yaml file:
Unexpected attribute 'application' for object of type IndexDefinitions.
in "<string>", line 2, column 14:
application: null
^
For GAE/J, I use a command of the form (without the drive specifier):
appcfg.cmd --email=[E-mail address] vacuum_indexes "\MyGaeProject\war"
without problem (but I have not had to use this for some time). Obviously, you can omit the --email parameter, but you might want to try without the drive specifier (and quote the war folder just for fun).
You may have two options: 1. wait for the next sdk with bug fixes, or 2. open a ticket as specified here: https://code.google.com/p/googleappengine/issues/detail?id=10168
I'm pretty used to crashing my tomcat server. But I don't think I made any changes at all and seem to have broken it completely. Was working one min then not the next.
I really hope someone can help here is the Catalina.out:
Dec 20, 2012 1:35:56 AM org.apache.catalina.startup.Embedded initDirs
SEVERE: Cannot find specified temporary folder at
Dec 20, 2012 1:35:57 AM org.apache.catalina.core.AprLifecycleListener init
INFO: Loaded APR based Apache Tomcat Native library 1.1.23.
Dec 20, 2012 1:35:57 AM org.apache.catalina.core.AprLifecycleListener init
INFO: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
Dec 20, 2012 1:35:57 AM org.apache.coyote.http11.Http11AprProtocol init
INFO: Initializing Coyote HTTP/1.1 on http-8040
Dec 20, 2012 1:35:57 AM org.apache.coyote.ajp.AjpAprProtocol init
INFO: Initializing Coyote AJP/1.3 on ajp-8042
Dec 20, 2012 1:35:57 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 587 ms
Dec 20, 2012 1:35:57 AM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Dec 20, 2012 1:35:57 AM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.33
Dec 20, 2012 1:35:57 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory docs
Dec 20, 2012 1:35:57 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory ROOT
Dec 20, 2012 1:35:57 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory myApp
Dec 20, 2012 1:35:57 AM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(/lhome/me/tomcat6/webapps/myApp/WEB-INF/lib/javax.servlet.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
Dec 20, 2012 1:35:58 AM org.apache.coyote.http11.Http11AprProtocol start
INFO: Starting Coyote HTTP/1.1 on http-8040
Dec 20, 2012 1:35:58 AM org.apache.coyote.ajp.AjpAprProtocol start
INFO: Starting Coyote AJP/1.3 on ajp-8042
Dec 20, 2012 1:35:58 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 880 ms
Error Reading TLE line 1: java.lang.Exception: TLE line 1 not valid first line
Error Creating SGP4 Satellite
Dec 20, 2012 1:36:26 AM org.apache.coyote.http11.Http11AprProtocol pause
INFO: Pausing Coyote HTTP/1.1 on http-8040
Dec 20, 2012 1:36:26 AM org.apache.coyote.ajp.AjpAprProtocol pause
INFO: Pausing Coyote AJP/1.3 on ajp-8042
Dec 20, 2012 1:36:27 AM org.apache.catalina.core.StandardService stop
INFO: Stopping service Catalina
Dec 20, 2012 1:36:30 AM org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc
SEVERE: The web application [/myApp] registered the JDBC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
Dec 20, 2012 1:36:30 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/myApp] is still processing a request that has yet to finish. This is very likely to create a memory leak. You can control the time allowed for requests to finish by using the unloadDelay attribute of the standard Context implementation.
Dec 20, 2012 1:36:30 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/myApp] appears to have started a thread named [Timer-0] but has failed to stop it. This is very likely to create a memory leak.
Dec 20, 2012 1:36:30 AM org.apache.coyote.http11.Http11AprProtocol destroy
INFO: Stopping Coyote HTTP/1.1 on http-8040
Dec 20, 2012 1:36:30 AM org.apache.coyote.ajp.AjpAprProtocol destroy
INFO: Stopping Coyote AJP/1.3 on ajp-8042
Dec 20, 2012 1:37:12 AM org.apache.catalina.startup.Catalina stopServer
SEVERE: Catalina.stop:
java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:391)
at java.net.Socket.connect(Socket.java:579)
at java.net.Socket.connect(Socket.java:528)
at java.net.Socket.<init>(Socket.java:425)
at java.net.Socket.<init>(Socket.java:208)
at org.apache.catalina.startup.Catalina.stopServer(Catalina.java:422)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.apache.catalina.startup.Bootstrap.stopServer(Bootstrap.java:338)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:416)
And I have a new log that has been created, I've never seen it before but it seems to think its something severe. A long one but here it is:
Massive Error Log I've never seen before
Your JVM's got SIGBUS. This is either a hardware problem, or a low-level JVM code bug.
siginfo:si_signo=SIGBUS: si_errno=0,
si_code=2 (BUS_ADRERR), si_addr=0x00007f0a9bb06fe5
One suspicious entry is -Djava.io.tmpdir= in your startup (i.e. temp dir is empty string). Could do funny things to JVM, though I did not test it. May be it is OK to have it like that.
jvm_args: -Dcatalina.base=/lhome/me/tomcat6
-Dcatalina.home=/usr/share/tomcat6
-Djava.endorsed.dirs=
-Djava.io.tmpdir=
-Djava.util.logging.config.file=/lhome/me/tomcat6/conf/logging.properties
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
Bottom line: I believe your hardware goes down. Backup everything.
The bomb seems to have occurred in the native method java.util.zip.ZipFile.getZipMessage() which is called by getEntry(). ZipFile had experienced an error and was trying to construct an exception message. This occurs while stopping the running webapp as part of reload.
Did you move the .war file? That can cause the problem.
These kinds of problems are hard to diagnose and fix. However, the problem is very likely to be java.io.tmpdir not being set properly. http://efod.se/blog/archive/2011/05/02/java-sigbus is a similar issue.
If that doesn't work, use apt-get to upgrade zlib and OpenJDK, and force ZipFile.getEntry() to be interpreted:
-X:CompileCommand=exclude,java/util/zip/ZipFile,getEntry
As OSB Stats said, don't trust your hardware (although it's not likely a hardware problem).
Thanks to all who gave help here.
However I fell I should answer my own question. Although I still don't fully understand why it caused such a severe exception. The problem seemed to lie with me having dropped a table on my database that the program was reading. This table was full of data that the program used to compile other data. Once I re-populated this table it was fine.
I don't know why something so simple caused such a lot of errors and never showed up in the logs as a table not found error. However I can only assume that the program was trying to run with blank data and this someone caused a severe error.
So thanks again to those who offered help!
I am using http://blog.frankel.ch/custom-loginmodule-in-tomcat tutorial for tomcat JAASRealm.I have added below in server.xml
Realm className="org.apache.catalina.realm.JAASRealm" appName="CustomLogin"
userClassNames="ch.frankel.blog.loginmodule.PlainUserPrincipal"
roleClassNames="ch.frankel.blog.loginmodule.PlainRolePrincipal"
/>
while starting server i am getting
INFO: Starting Servlet Engine: Apache Tomcat/5.5.27
Jun 8, 2012 1:18:24 PM org.apache.catalina.realm.JAASRealm parseClassNames
SEVERE: Class ch.frankel.blog.loginmodule.PlainUserPrincipal not found! Class no
t added.
Jun 8, 2012 1:18:24 PM org.apache.catalina.realm.JAASRealm parseClassNames
SEVERE: Class ch.frankel.blog.loginmodule.PlainRolePrincipal not found! Class no
t added.
Jun 8, 2012 1:18:24 PM org.apache.catalina.core.StandardHost start
INFO: XML validation disabled
Jun 8, 2012 1:18:24 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive CustomLogin.war
I am using tomcat 5.5.27. When i call my servlet authentication is working fine but authorization is having some issue and might be due to "Class not added."
Please help....
It got resolved...I added a jar containing above classes in /server/lib folder and its working fine.