Problem with JDeveloper
900423Nov 15 2011 — edited Nov 19 2011Hi,
I'm new to jDeveloper. I have successfully coded but when i run my program im getting an exception or error. here is the result. Im using jDeveloper 10.1.3
I got below error when i run the client:
"D:\Softz\Programming stuff\jdevstudio10135\jdk\bin\javaw.exe" -client -classpath "D:\Softz\Programming stuff\jdevstudio10135\jdev\mywork\EJB_Lab\Lab\classes;D:\Softz\Programming stuff\jdevstudio10135\j2ee\home\lib\ejb30.jar;D:\Softz\Programming stuff\jdevstudio10135\toplink\jlib\toplink-essentials.jar;D:\Softz\Programming stuff\jdevstudio10135\j2ee\home\lib\activation.jar;D:\Softz\Programming stuff\jdevstudio10135\j2ee\home\lib\ejb.jar;D:\Softz\Programming stuff\jdevstudio10135\j2ee\home\lib\jms.jar;D:\Softz\Programming stuff\jdevstudio10135\j2ee\home\lib\jta.jar;D:\Softz\Programming stuff\jdevstudio10135\j2ee\home\lib\mail.jar;D:\Softz\Programming stuff\jdevstudio10135\j2ee\home\lib\servlet.jar;D:\Softz\Programming stuff\jdevstudio10135\jdev\system\oracle.j2ee.10.1.3.43.6\embedded-oc4j\.client;D:\Softz\Programming stuff\jdevstudio10135\j2ee\home\oc4j.jar;D:\Softz\Programming stuff\jdevstudio10135\j2ee\home\lib\oc4j-internal.jar;D:\Softz\Programming stuff\jdevstudio10135\opmn\lib\optic.jar;D:\Softz\Programming stuff\jdevstudio10135\toplink\jlib\toplink.jar;D:\Softz\Programming stuff\jdevstudio10135\toplink\jlib\toplink-oc4j.jar;D:\Softz\Programming stuff\jdevstudio10135\toplink\jlib\antlr.jar" lab.SessionEJBClient
javax.naming.CommunicationException: Connection refused: connect [Root exception is java.net.ConnectException: Connection refused: connect]
at com.evermind.server.rmi.RMIClient.lookup(RMIClient.java:311)
at com.evermind.server.rmi.RMIClientContext.lookup(RMIClientContext.java:59)
at javax.naming.InitialContext.lookup(InitialContext.java:351)
at lab.SessionEJBClient.main(SessionEJBClient.java:15)
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:507)
at java.net.Socket.connect(Socket.java:457)
at java.net.Socket.<init>(Socket.java:365)
at java.net.Socket.<init>(Socket.java:207)
at com.evermind.server.rmi.RMIClientConnection.createSocket(RMIClientConnection.java:802)
at oracle.oc4j.rmi.ClientSocketRmiTransport.createNetworkConnection(ClientSocketRmiTransport.java:59)
at oracle.oc4j.rmi.ClientRmiTransport.connectToServer(ClientRmiTransport.java:75)
at oracle.oc4j.rmi.ClientSocketRmiTransport.connectToServer(ClientSocketRmiTransport.java:69)
at com.evermind.server.rmi.RMIClientConnection.connect(RMIClientConnection.java:765)
at com.evermind.server.rmi.RMIClientConnection.sendLookupRequest(RMIClientConnection.java:247)
at com.evermind.server.rmi.RMIClientConnection.lookup(RMIClientConnection.java:231)
at com.evermind.server.rmi.RMIClient.lookup(RMIClient.java:302)
... 3 more
Process exited with exit code 0.
when i run the server i get below error msg:
[Starting OC4J using the following ports: HTTP=8988, RMI=23891, JMS=9227.]
D:\Softz\Programming stuff\jdevstudio10135\jdev\system\oracle.j2ee.10.1.3.43.6\embedded-oc4j\config>
"D:\Softz\Programming stuff\jdevstudio10135\jdk\bin\javaw.exe" -client "-Doracle.home=D:\Softz\Programming stuff\jdevstudio10135" -classpath "D:\Softz\Programming stuff\jdevstudio10135\j2ee\home\oc4j.jar;D:\Softz\Programming stuff\jdevstudio10135\jdev\lib\jdev-oc4j-embedded.jar" -Xverify:none -XX:MaxPermSize=256m -DcheckForUpdates=adminClientOnly -Doracle.application.environment=development -Doracle.j2ee.dont.use.memory.archive=true -Doracle.j2ee.http.socket.timeout=500 -Doc4j.jms.usePersistenceLockFiles=false oracle.oc4j.loader.boot.BootStrap -config "D:\Softz\Programming stuff\jdevstudio10135\jdev\system\oracle.j2ee.10.1.3.43.6\embedded-oc4j\config\server.xml"
[waiting for the server to complete its initialization...]
11/11/15 23:27:18 SEVERE: XMLApplicationServerConfig.sortApplicationConfigReferences Error instantiating application at file:/D:/jdevstudio10135/jdev/system/oracle.j2ee.10.1.3.43.6/embedded-oc4j/applications/datatags.ear: Unable to get ApplicationConfig for datatags : Error creating deployment directory: IO Error: The system cannot find the path specified
Nov 15, 2011 11:27:18 PM com.evermind.server.XMLDataSourcesConfig parseRootNode
INFO: Legacy datasource detected...attempting to convert to new syntax.
11/11/15 23:27:19 SEVERE: XMLApplicationServerConfig.store There are some configuration failures in following application(s). Please correct the problem and restart oc4j. : datatags
11/11/15 23:27:20 Error initializing server: At least one valid code-source or import-shared-library element is required for shared-library "global.libraries" in /D:/Softz/Programming stuff/jdevstudio10135/jdev/system/oracle.j2ee.10.1.3.43.6/embedded-oc4j/config/server.xml.
11/11/15 23:27:21 Fatal error: server exiting
Process exited with exit code 1.
n Here is my code:
SessionEJBBean.java
package lab;
import java.math.BigDecimal;
import javax.ejb.Stateless;
@Stateless(name="SessionEJB")
public class SessionEJBBean implements SessionEJB {
public SessionEJBBean() {
}
public BigDecimal poundToYen(BigDecimal pounds) {
BigDecimal result = pounds.multiply(yenRate);
return result.setScale(2,BigDecimal.ROUND_UP);
}
public BigDecimal poundToEuro(BigDecimal pounds) {
BigDecimal result = pounds.multiply(euroRate);
return result.setScale(2,BigDecimal.ROUND_UP);
}
BigDecimal yenRate = new BigDecimal("211.6");
BigDecimal euroRate = new BigDecimal("1.46");
}
Here is my client code:
SessionEJBBean.java
package lab;
import java.math.BigDecimal;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import oracle.toplink.essentials.mappings.converters.Converter;
public class SessionEJBClient {
public static void main(String [] args) {
try {
final Context context = getInitialContext();
SessionEJB sessionEJB = (SessionEJB)context.lookup("SessionEJB");
// Call any of the Remote methods below to access the EJB
SessionEJBClient converter = (SessionEJBClient)context.lookup("Converter");
BigDecimal param = new BigDecimal("100.00");
// BigDecimal amount = converter.poundToYen(param);
BigDecimal amount = sessionEJB.poundToYen(param);
System.out.println(param+" Pounds is "+amount+" Yen");
amount = sessionEJB.poundToEuro(param);
System.out.println(param+" Pounds is "+amount+" Euros");
} catch (Exception ex) {
ex.printStackTrace();
}
}
private static Context getInitialContext() throws NamingException {
// Get InitialContext for Embedded OC4J
// The embedded server must be running for lookups to succeed.
return new InitialContext();
}
}
Im stuck with this problem could solve the issue??
All comments are highly welcome. please help me out.