Error while trying to setup a Jython interpreter - java

I wanted to boot up a Jython interpreter inside the plugin, then execute files inside the interpreter.
package com.jakob.jython;
import org.bukkit.plugin.java.JavaPlugin;
import org.python.core.PyObject;
import org.python.util.PythonInterpreter;
import java.io.IOException;
import java.io.InputStream;
import java.util.logging.Logger;
public class EmbeddedJython extends JavaPlugin {
private static final Logger log = Logger.getLogger("Minecraft");
private PythonInterpreter interpreter;
private PyObject plugin;
public void onEnable() {
log.info("JythonTest enabled");
this.interpreter = new PythonInterpreter();
log.info("Jython interpreter fired up and cooking on gas");
log.info("Loading Python Plugin");
InputStream pythonScript = EmbeddedJython.class.getResourceAsStream("MyPlugin.py");
this.interpreter.execfile(pythonScript, "MyPlugin.py");
log.info("Getting plg method.");
this.plugin = this.interpreter.get("plg");
log.info("Plugin loaded");
log.info(plugin.invoke("onEnable").toString());
}
public void onDisable() {
log.info(plugin.invoke("onDisable").toString());
log.info("Jython disabled");
}
}
In other tests I can get the Jython interpreter up and running strings I hand it but when I use the above snippet I end up with an exception that looks something like this:
11:03:38 [SEVERE] Error occurred while enabling JythonTest v0.12 (Is it up to da
te?): null
java.io.IOException: Stream closed
at java.io.BufferedInputStream.getInIfOpen(Unknown Source)
at java.io.BufferedInputStream.fill(Unknown Source)
at java.io.BufferedInputStream.read(Unknown Source)
at org.python.core.ParserFacade.adjustForBOM(ParserFacade.java:371)
at org.python.core.ParserFacade.prepBufReader(ParserFacade.java:298)
at org.python.core.ParserFacade.prepBufReader(ParserFacade.java:288)
at org.python.core.ParserFacade.parse(ParserFacade.java:183)
at org.python.core.Py.compile_flags(Py.java:1717)
at org.python.util.PythonInterpreter.execfile(PythonInterpreter.java:235
)
at com.jakob.jython.EmbeddedJython.onEnable(EmbeddedJython.java:26)
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:125)
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader
.java:750)
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManage
r.java:253)
at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:132)
at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:110)
at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:218)
at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:205)
at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:145)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:265)
at net.minecraft.server.ThreadServerApplication.run(SourceFile:394)
java.io.IOException: java.io.IOException: Stream closed
at org.python.core.PyException.fillInStackTrace(PyException.java:70)
at java.lang.Throwable.<init>(Throwable.java:181)
at java.lang.Exception.<init>(Unknown Source)
at java.lang.RuntimeException.<init>(Unknown Source)
at org.python.core.PyException.<init>(PyException.java:46)
at org.python.core.PyException.<init>(PyException.java:43)
at org.python.core.Py.JavaError(Py.java:481)
at org.python.core.ParserFacade.fixParseError(ParserFacade.java:104)
at org.python.core.ParserFacade.parse(ParserFacade.java:186)
at org.python.core.Py.compile_flags(Py.java:1717)
at org.python.util.PythonInterpreter.execfile(PythonInterpreter.java:235
)
at com.jakob.jython.EmbeddedJython.onEnable(EmbeddedJython.java:26)
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:125)
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader
.java:750)
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManage
r.java:253)
at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:132)
at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:110)
at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:218)
at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:205)
at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:145)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:265)
at net.minecraft.server.ThreadServerApplication.run(SourceFile:394)
Caused by: java.io.IOException: Stream closed
at java.io.BufferedInputStream.getInIfOpen(Unknown Source)
at java.io.BufferedInputStream.fill(Unknown Source)
at java.io.BufferedInputStream.read(Unknown Source)
at org.python.core.ParserFacade.adjustForBOM(ParserFacade.java:371)
at org.python.core.ParserFacade.prepBufReader(ParserFacade.java:298)
at org.python.core.ParserFacade.prepBufReader(ParserFacade.java:288)
at org.python.core.ParserFacade.parse(ParserFacade.java:183)
... 13 more
Could it be I'm using execfile wrong?
Or is it an error or something I'm missing in how InputStream works?

Are you sure that EmbeddedJython.class.getResourceAsStream("MyPlugin.py"); is finding the resource?
If it can't find the resource, getResourceAsStream will return a null, and it is possible that the Jython interpreter will treat that as an empty (closed) stream.
Your application should probably check this, rather than assuming that getResourceAsStream has succeeded.
If I private File pythonFile = new File('MyScirpt.py'); and then hand getResourceAsStream(pythonFile.getAbsolutePath());
That won't work. The getResourceAsStream method looks for resources on the classloader's classpath, and expects a path that can be resolved relative to some entry on the classpath.
You probably want to do this:
private File pythonFile = new File('MyScirpt.py');
InputStream is = new FileInputStream(pythonFile);
and pass the is to the interpreter. You also need to arrange that the stream is always closed when the interpreter has finished ... by whatever mechanism that happens.

I see in the stacktrace, there is a reference to adjustForBOM (BOM = Byte Order Mark).
This could mean that your file MyPlugin.py is stored in a different encoding to other files that are working for you.
Can you try re-saving the file with a different encoding, say UTF-8?

Related

IOException Loading Data into BlazegraphEmbedded

I'm having an issue loading my Blazegraph properties file into an embedded instance. When I try to import my .properties file into my Java class, I get the following error:
Exception in thread "main" java.io.IOException: Stream closed
at java.io.BufferedInputStream.getInIfOpen(Unknown Source)
at java.io.BufferedInputStream.read1(Unknown Source)
at java.io.BufferedInputStream.read(Unknown Source)
at sun.nio.cs.StreamDecoder.readBytes(Unknown Source)
at sun.nio.cs.StreamDecoder.implRead(Unknown Source)
at sun.nio.cs.StreamDecoder.read(Unknown Source)
at java.io.InputStreamReader.read(Unknown Source)
at java.io.Reader.read(Unknown Source)
at java.util.Properties$LineReader.readLine(Unknown Source)
at java.util.Properties.load0(Unknown Source)
at java.util.Properties.load(Unknown Source)
at blazegraph_tinkerpop_tryout.blazegraph_data_load.loadProperties(blazegraph_data_load.java:55)
at blazegraph_tinkerpop_tryout.blazegraph_data_load.main(blazegraph_data_load.java:32)
Call to loadProperties function from main:
Properties props = loadProperties("sampleprops.properties");
My loadProperties function (checking to see whether file path is valid, then sending to reader):
public static Properties loadProperties(String resource) throws IOException
{
Properties p = new Properties();
Path path = Paths.get(resource);
Boolean bool = Files.exists(path);
if (bool)
{
System.out.println("File was found. Attempting data load...");
InputStream is = blazegraph_data_load.class.getResourceAsStream(resource);
p.load(new InputStreamReader(new BufferedInputStream(is)));
return p;
}
System.out.println("The file you entered was not found.");
return null;
}
Here is what my file sampleprops.properties looks like:
com.bigdata.journal.AbstractJournal.bufferMode=DiskRW
com.bigdata.journal.AbstractJournal.file=blazegraph.jnl
I have been following the setup instructions from the sample Blazegraph app described here. If it makes a difference, I am using the Blazegraph/Tinkerpop3 implementation found here.
I found a workaround: I switched my getResourceAsStream method to a FileInputStream method.
The problem was with the placement of my properties file. The FileInputStream method seems more forgiving in where you place the file.

What are environment properties for Payara InitialContext from free standing Java Client

I've abandoned GlassFish 4-point-anything in favor of Payara41. Amazingly GF has unresolved JDBC and JMS Resources configuration bugs. See:
Glassfish Admin Console throws java.lang.IllegalStateException when creating JDBC Pool
Payara perfectly fixed the JMS configuration issues. So all I need are the environment properties my standalone Java Client needs to get an InitialContext(env) to lookup() those Resources.
Note: InitalContext() doesn't work in a standalone. Only in an EJB Container that can look up the {Payara Home}/glassfish/lib/jndi-properties file. That file has one property so that's what I have in my code below:
Key: "java.naming.factory.initial"
Value: "com.sun.enterprise.naming.impl.SerialInitContextFactory"
That set off a series of NoClassDerfinitionFound Exceptions that led me to add these jars with these classes to my client's buildpath, and to /glassfish/lib/. They are in the order I encountered them.
"glassfish-naming.jar" w/ "com.sun.enterprise.naming.impl.SerialInitContextFactory"
"internal-api-3.1.2.jar" w/ "org.glassfish.internal.api.Globals"
" hk2-api-2.1.46.jar " w/ "org.glassfish.hk2.api.ServiceLocator"
"appserv-rt.jar" from glassfish/lib added to client build path
But now my code throws a java.lang.NoSuchMethodError for Globals.getDefaultHabitat(). Please note, below the Exception doesn't get caught in my catch block. (And I don't see it in Payara's service.log either.)
I know my client finds Globals.class, because adding it caused the NoClassDefinitionFound for ServiceLocator. Are there two "Globals.class" out there ... one w/ and one w/o that method. Or is the "Lorg" in console output really different from "org", i.e. is there a "Lorg/glassfish/hk2/api/ServiceLocator"?
I'm stuck. And this seems such a bread and butter kind of need -- environment properties a standalone Java client needs to get Payara's InitialContext -- it would be nice to be able to add it here for everyone to use (in addition to the jars I've already located.) I'd love to see Payara soar, because I love its Admin Console compared to JBoss and MayFly's XML orientation. Any suggestions? I'm stumped.Code and console output follows:
Code
package org.america3.testclasses;
import java.util.Properties;
import javax.jms.Message;
import javax.jms.MessageListener;
import javax.naming.Context;
import javax.naming.InitialContext;
import org.america3.toolkit.U;
public class Test2 implements MessageListener {
static final Properties JNDI_PROPERTIES = new Properties() {
private static final long serialVersionUID = 1L;
{/*This property key:vlaue pair is specified in Payara41/glassfish/lib/jndi-properties*/
/*The class it calls for is in Payara41/glassfish/lib/glassfish-naming.jar*/
this.put ("java.naming.factory.initial","com.sun.enterprise.naming.impl.SerialInitContextFactory");}
};
//constructor
public Test2 () {
String iAmM = U.getIAmMShort(Thread.currentThread().getStackTrace());
System.out.println(iAmM + "beg");
try {
Context jndiContext = (Context) new InitialContext(JNDI_PROPERTIES);
} catch (Exception e) {
System.out.println(" " + iAmM + "InitialContext failed to instantiate");
System.out.println(" " + iAmM + "Exception : " + e.getClass().getName());
System.out.println(" " + iAmM + "e.getMessage(): " + e.getMessage());
System.out.println(" " + iAmM + "e.getMessage(): " + e.getCause());
e.printStackTrace();
}
System.out.println(iAmM + "end");
}
public static void main(String[] args) {
Test2 messageCenter = new Test2 ();
}
public void onMessage(Message arg0) {
// TODO Auto-generated method stub
}
}
Console
Test2.<init> () beg
Exception in thread "main" java.lang.NoSuchMethodError: org.glassfish.internal.api.Globals.getDefaultHabitat()Lorg/glassfish/hk2/api/ServiceLocator;
at com.sun.enterprise.naming.impl.SerialInitContextFactory.<init>(SerialInitContextFactory.java:126)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.init(Unknown Source)
at javax.naming.InitialContext.<init>(Unknown Source)
at org.america3.testclasses.Test2.<init>(Test2.java:24)
at org.america3.testclasses.Test2.main(Test2.java:36)
PS: Could someone with enough points add a "Paraya" tag below. I mean with Glassfish's console throwing exceptions when used to configure any JNDI or JMS Resource I think many people will switch.
JAR internal-api-3.1.2.jar is for Glassfish v3, and its Globals class has a method getDefaultHabitat() that returns Habitat:
public static Habitat getDefaultHabitat() {
return defaultHabitat;
}
However, Glassfish v4 has changed method signatures, and you have to use new Glassfish v4 internal API whose Globals class has appropriate method getDefaultHabitat() that returns ServiceLocator:
public static ServiceLocator getDefaultHabitat() {
return defaultHabitat;
}
In other words, replace internal-api-3.1.2.jar with internal-api-4.1.jar which can be found on Maven Central here
You should add ${PAYARA-HOME}/glassfish/lib/gf-client.jar to your classpath as this references all the other required jars in it's META-INF/MANIFEST.MF. Please note, it uses relative path references so you really need to install Payara on the client machine.

Why can't java find my class?

I have a class that compiles without error. The class has a main method. But when I try to run it on ubuntu linux from the classes' directory I get a class not found error. I am pretty sure I am missing something dead obvious but I don't see it.
Here is my ls operation:
zookeeper#zookeeper-virtual-machine:~/zookeeper-3.4.5/programs$ ls
CreateGroup.java LsGroup.class LsGroup.java zookeeper-3.4.5.jar
Here is what happens when I to run LsGroup
zookeeper#zookeeper-virtual-machine:~/zookeeper-3.4.5/programs$ java -cp "zookeeper-3.4.5.jar" LsGroup
Exception in thread "main" java.lang.NoClassDefFoundError: LsGroup
Caused by: java.lang.ClassNotFoundException: LsGroup
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
Could not find the main class: LsGroup. Program will exit.
Here is the code for LsGroup
package org.zookeeper;
import java.io.IOException;
import java.util.List;
import java.util.concurrent.CountDownLatch;
import org.apache.zookeeper.KeeperException;
import org.apache.zookeeper.WatchedEvent;
import org.apache.zookeeper.Watcher;
import org.apache.zookeeper.ZooKeeper;
import org.apache.zookeeper.Watcher.Event.KeeperState;
public class LsGroup implements Watcher {
private static final int SESSION_TIMEOUT = 5000;
private ZooKeeper zk;
private CountDownLatch connectedSignal = new CountDownLatch(1);
public void connect(String hosts) throws IOException, InterruptedException {
zk = new ZooKeeper(hosts, SESSION_TIMEOUT, this);
connectedSignal.await();
}
#Override
public void process(WatchedEvent event) { // Watcher interface
if (event.getState() == KeeperState.SyncConnected) {
connectedSignal.countDown();
}
}
public void ls(String groupName) throws KeeperException, InterruptedException {
String path = "/" + groupName;
try {
List<String> children = zk.getChildren(path, false);
for (String child : children) {
System.out.println(path+"/"+child);
System.out.println(zk.getChildren(path +"/"+ child, false));
}
} catch (KeeperException.NoNodeException e) {
System.out.printf("Group %s does not exist\n", groupName);
System.exit(1);
}
}
public void close() throws InterruptedException {
zk.close();
}
public static void main(String[] args) throws Exception {
LsGroup lsGroup = new LsGroup();
lsGroup.connect(args[0]);
lsGroup.ls(args[1]);
lsGroup.close();
}
}
The original problem was that your class was in a package, but you were trying to load it as if it weren't in a package. You'd normally organize your source code to match your package hierarchy, then from the root of the hierarchy, you'd run something like:
java -cp .:zookeeper-3.4.5.jar org.zookeeper.LsGroup
Now that you've temporarily worked around the package issue by moving the code out of a package, the next problem is that the current directory isn't in the classpath. So instead of this:
java -cp "zookeeper-3.4.5.jar" LsGroup
You want:
java -cp .:zookeeper-3.4.5.jar LsGroup
Once you've got that working, you should move the classes back into packages, as per normal Java best practice.
You could remove the package declaration:
package org.zookeeper;
...or just place your LsGroup class in org/zookeeper directory.
The class file is supposed to live in a path like:
org/zookeeper/LsGroup.class
The -cp must include the directory that contains the org/ directory. Then you can
java -cp parent-of-org org.zookeeper.LsGroup
The message "wrong name: org/zookeeper/LsGroup" means, you have to respect the package structure of Java. Use the following directory structure:
./org/zookeeper/LsGroup.class
Then launch java org.zookeeper.LsGroup from within the current directory. The package separator "." will be translated to corresponding directory.
Your files are not under package org.zookeeper
You should be running your class from ~/zookeeper-3.4.5/org/zookeeper
Otherwise JVM won't find the classes to load.
Your class is part of the org.zookeeper package but you keep it in the root folder of your project (/zookeeper-3.4.5/programs).
The qualified name of the package member and the path name to the file are parallel (see Managing Source and Class Files), so if your package is org.zookeeper the class file should be kept in /zookeeper-3.4.5/programs/org/zookeeper
You made two mistakes:
1) You tried to run java LsGroup but you have to use the complete name including packages java org.zookeeper.LsGroup
2) your directory structure is not correct: the package org.zookeeper corresponds with the directory structure ./org/zookeeper/
If you change the directory structure and then run java from the top of this directory structure it should work

How can I fix problems while running .exe file

I have a ThMapInfratab1-2.exefile under C:\Users\Infratab Bangalore\Desktop\Rod directory. I executed in command prompt in the following way.it's working fine.
C:\Users\Infratab Bangalore\Desktop\Rod>ThMapInfratab1-2.exe TMapInput.txt
I want to do same procedure using Java technology. using StackOverFlow guys,I tried in 2 ways.
Case 1:
Using getRuntime().
import java.util.*;
import java.io.*;
public class ExeProcess
{
public static void main(String args[]) throws IOException
{
Runtime rt = Runtime.getRuntime();
File filePath=new File("C:/Users/Infratab Bangalore/Desktop/Rod");
String[] argument1 = {"TMapInput.txt"};
Process proc = rt.exec("ThMapInfratab1-2.exe", argument1, filePath);
}
}
Case 2:
Using ProcessBuilder
import java.io.File;
import java.io.IOException;
public class ProcessBuilderSample {
public static void main(String args[]) throws IOException
{
String executable = "ThMapInfratab1-2.exe";
String argument1 = "TherInput.txt";
File workingDirectory = new File("C:/Users/Infratab Bangalore/Desktop/Rod");
ProcessBuilder pb = new ProcessBuilder(executable, argument1);
pb.directory(workingDirectory);
pb.start();
}
}
in both cases, I am getting the following error.
Error:
Exception in thread "main" java.io.IOException: Cannot run program "ThMapInfratab1-2.exe" (in directory "C:\Users\Infratab Bangalore\Desktop\Rod"): CreateProcess error=2, The system cannot find the file specified
at java.lang.ProcessBuilder.start(Unknown Source)
at ProcessBuilderSample.main(ProcessBuilderSample.java:16)
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.<init>(Unknown Source)
at java.lang.ProcessImpl.start(Unknown Source)
... 2 more
I did't figure out, what's the problem. can anyone suggest me.
I am using jre 7.
Thanks
try to use this :
import java.io.File;
import java.io.IOException;
public class ProcessBuilderSample {
public static void main(String args[]) throws IOException
{
String executable = "ThMapInfratab1-2.exe";
String argument1 = "TherInput.txt";
File workingDirectory = new File("C:/Users/Infratab Bangalore/Desktop/Rod");
ProcessBuilder pb = new ProcessBuilder("cmd", "/c","start" ,executable, argument1);
pb.directory(workingDirectory);
pb.start();
}
}
The statement
pb.directory(workingDirectory);
specifies only the working directory. This is not the directory where the executable ThMapInfratab1-2.exe is to be searched for. But it is the directory where the file you specify as argument TMapInput.txt is to be searched for. Since TMapInput.txt is not an absolute path, your programm will then search for that file relativly to the working directory.
To solve you problem you need to specify the full path for the excecutable:
String executable = "C:\\Users\\Infratab Bangalore\\Desktop\\Rod\\ThMapInfratab1-2.exe";
String argument1 = "TherInput.txt";
File workingDirectory = new File("C:\\Users\\Infratab Bangalore\\Desktop\\Rod");
Or if you do not need to the location C:\Users\Infratab Bangalore\Desktop\Rod just pass the absolute path of the file too and remove the statement pb.directory(workingDirectory);:
String executable = "C:\\Users\\Infratab Bangalore\\Desktop\\Rod\\ThMapInfratab1-2.exe";
String argument1 = "C:\\Users\\Infratab Bangalore\\Desktop\\Rod\\TherInput.txt";
Alternatively you could extend your PATH environment variable to include the location C:\Users\Infratab Bangalore\Desktop\Rod. In this case the programm will run just fine as you posted it.

PHP/Java Bridge [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Troubleshooting ClassNotFoundException when using PHP/Java bridge
Can anyone please explain me about the PHP/Java Bridge installation.
I already installed bridge in my system.
This is my HelloWorld.java code :
import javax.swing.JOptionPane;
public class HelloWorld
{
public static final String JAVABRIDGE_PORT="8081";
static final php.java.bridge.JavaBridgeRunner runner =
php.java.bridge.JavaBridgeRunner.getInstance(JAVABRIDGE_PORT);
public static void main(String args[]) throws Exception
{
runner.waitFor();
System.exit(0);
}
public void hello(String args[]) throws Exception
{
JOptionPane.showMessageDialog(null, "hello " + args[0]);
}
}
This is my HelloWorld.php code:
<?php
require_once("http://localhost:8081/JavaBridge/java/Java.inc");
$world = new java("HelloWorld");
echo $world->hello(array("from PHP"));
?>
While calling Java class from php, it is not working and it is showing the below error:
Fatal error: Uncaught [[o:Exception]:"java.lang.Exception: CreateInstance failed: new HelloWorld. Cause: java.lang.ClassNotFoundException: HelloWorld VM: 1.5.0_01#http://java.sun.com/" at: #-31 org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1438) #-30 org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1284) #-29 java.lang.ClassLoader.loadClassInternal(Unknown Source) #-28 java.lang.Class.forName0(Native Method) #-27 java.lang.Class.forName(Unknown Source) #-26 php.java.bridge.Util.classForName(Util.java:1518) #-25 php.java.bridge.JavaBridge.CreateObject(JavaBridge.java:445) #-24 php.java.bridge.Request.handleRequest(Request.java:458) #-23 php.java.bridge.Request.handleOneRequest(Request.java:510) #-22 php.java.servlet.PhpJavaServlet.handleLocalConnection(PhpJavaServlet.java:202) #-21 php.java.servlet.PhpJavaServlet.handlePut(PhpJavaServlet.java:250) #-20 php.java.servlet.PhpJavaServlet.doPut(PhpJavaServlet.java:261) #-19 javax.servlet.http.HttpServlet.service(HttpS in http://localhost:8081/JavaBridge/java/Java.inc on line 195
Can you please anyone help me on this.
Thanks in advance.
I am unfamiliar with the package you are trying to use but it looks like you need to give the full path to your class. That is java/lang/ClassNotFoundException for example for the Java Exception that is being thrown and probably something like me/mypackage/HelloWordl for the class you are trying to create.

Categories

Resources