Connecting from VB to Weblogic
Can Anyone give me the details of how to connect from VB to Weblogic?.
Thanks
There is the documentation on this in version 5.1. Look at the WebLogic COM
integration. You might also want to look at a product called Jintegra, from
Linar.com.
Michael Girdley
BEA Systems Inc
"Sethu" <[email protected]> wrote in message
news:3a11b6bf$[email protected]..
Can Anyone give me the details of how to connect from VB to Weblogic?.
Thanks
Similar Messages
-
Problem in establishing connection from MQSeries to Weblogic 7
Hello,
I was earlier having a connection established between MQSeries and Weblogic 6.1,
that is working fine but recently I have upgraded to Weblogic 7.1
Now when I try to have a connection between the MQSeries and the Weblogic 7.1
then while establishing the connection it brings down the Weblogic server i.e.
shuts it down. I am unable to track this problem. Please if any one has ever experienced
similar type of problem or has a solution for this problem then let me know.
Thanks in advance.
JJ
Hi,
I guess the problem is due to the driver class not being part of the classpath in your web application. You should include the jar containing the driver class in your classpath. Please consult the documentation provided for your web server to do the same.
Regards,
Bhushan. -
Weblogic realm authentication failure getting connection from pool
We are getting this error when we try to get a connection from the
pool for a Tx Data Source. We are successfully getting connections
from a (non-Tx) Data Source.
java.lang.SecurityException: Authentication for user Fitness_demo
denied in realm weblogic
at weblogic.security.acl.Realm.authenticate(Realm.java:212)
at weblogic.security.acl.Realm.getAuthenticatedName(Realm.java:233)
at weblogic.security.acl.internal.Security.authenticate(Security.java:125)
at weblogic.security.acl.Security.doAsPrivileged(Security.java:481)
at weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSource.java:127)
We have added the DB user as a user in the realm, which usually does
the trick; but in this case it does not. We are using Merant's
JSQLConnect type 2 driver for SQL Server, and we are running on
Solaris. The scenario works fine using Oracle Thin driver on Windows.
Do we need ACL entries or something? We do not have any ACL entries
now.
Thanks,
-wesWe are getting this error when we try to get a connection from the
pool for a Tx Data Source. We are successfully getting connections
from a (non-Tx) Data Source.
java.lang.SecurityException: Authentication for user Fitness_demo
denied in realm weblogic
at weblogic.security.acl.Realm.authenticate(Realm.java:212)
at weblogic.security.acl.Realm.getAuthenticatedName(Realm.java:233)
at weblogic.security.acl.internal.Security.authenticate(Security.java:125)
at weblogic.security.acl.Security.doAsPrivileged(Security.java:481)
at weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSource.java:127)
We have added the DB user as a user in the realm, which usually does
the trick; but in this case it does not. We are using Merant's
JSQLConnect type 2 driver for SQL Server, and we are running on
Solaris. The scenario works fine using Oracle Thin driver on Windows.
Do we need ACL entries or something? We do not have any ACL entries
now.
Thanks,
-wes -
PROBLEM DESCRIPTION :
When I try to read a clob from Oracle, I receive "ORA-03120: two-task
conversion routine: integer overflow" Error.
This error occurs only for CLOB Type and only if I try to connect to
Oracle using WebLogic JDriver/Oracle POOL.
IMPORTANT NOTE: I can read CLOB or any other data using direct JDBC
connection to ORacle with out any problem.
Below Please find the JAVA CODE for Both Working and NON Working .
Created a Connection Pool as:
Name: MyJDBCConnectionPool
URL : jdbc:weblogic:oracle
DIRVER:weblogic.jdbc.oci.Driver
NON WORKING JAVA CODE (USES WEBLOGIC JDBC CONNECTION POOL TO ORACLE):
Driver myDriver =
(Driver)Class.forName("weblogic.jdbc.pool.Driver").newInstance();
Connection mconn =
myDriver.connect("jdbc:weblogic:pool:MyJDBCConnectionPool",null);
mconn.setAutoCommit (false);
CallableStatement cs = mconn.prepareCall("{call
P_XMLTEST2(?)}"); //This returns a CLOB
cs.registerOutParameter(1,java.sql.Types.CLOB);
cs.execute();
Clob clob = null;
clob = cs.getClob(1);
String data =new String();
data = clob.getSubString(1, (int)clob.length());
System.out.println(data); //print the data
data = null;
clob=null;
cs.close();
WORKING JAVA CODE (USES DIRECT THIN JDBC CONNECTION TO ORACLE):
Driver myDriver =
(Driver)Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
Connection mconn =
myDriver.connect("jdbc:oracle:thin:@server:1521:DB",null);
mconn.setAutoCommit (false);
CallableStatement cs = mconn.prepareCall("{call
P_XMLTEST2(?)}"); //This returns a CLOB
cs.registerOutParameter(1,java.sql.Types.CLOB);
cs.execute();
Clob clob = null;
clob = cs.getClob(1);
String data =new String();
data = clob.getSubString(1, (int)clob.length());
System.out.println(data); //print the data
data = null;
clob=null;
cs.close();
ERROR MESSAGE:
ORA-03120: two-task conversion routine: integer overflow
I appreciate your help on this problem.PROBLEM DESCRIPTION :
When I try to read a clob from Oracle, I receive "ORA-03120: two-task
conversion routine: integer overflow" Error.
This error occurs only for CLOB Type and only if I try to connect to
Oracle using WebLogic JDriver/Oracle POOL.
IMPORTANT NOTE: I can read CLOB or any other data using direct JDBC
connection to ORacle with out any problem.
Below Please find the JAVA CODE for Both Working and NON Working .
Created a Connection Pool as:
Name: MyJDBCConnectionPool
URL : jdbc:weblogic:oracle
DIRVER:weblogic.jdbc.oci.Driver
NON WORKING JAVA CODE (USES WEBLOGIC JDBC CONNECTION POOL TO ORACLE):
Driver myDriver =
(Driver)Class.forName("weblogic.jdbc.pool.Driver").newInstance();
Connection mconn =
myDriver.connect("jdbc:weblogic:pool:MyJDBCConnectionPool",null);
mconn.setAutoCommit (false);
CallableStatement cs = mconn.prepareCall("{call
P_XMLTEST2(?)}"); //This returns a CLOB
cs.registerOutParameter(1,java.sql.Types.CLOB);
cs.execute();
Clob clob = null;
clob = cs.getClob(1);
String data =new String();
data = clob.getSubString(1, (int)clob.length());
System.out.println(data); //print the data
data = null;
clob=null;
cs.close();
WORKING JAVA CODE (USES DIRECT THIN JDBC CONNECTION TO ORACLE):
Driver myDriver =
(Driver)Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
Connection mconn =
myDriver.connect("jdbc:oracle:thin:@server:1521:DB",null);
mconn.setAutoCommit (false);
CallableStatement cs = mconn.prepareCall("{call
P_XMLTEST2(?)}"); //This returns a CLOB
cs.registerOutParameter(1,java.sql.Types.CLOB);
cs.execute();
Clob clob = null;
clob = cs.getClob(1);
String data =new String();
data = clob.getSubString(1, (int)clob.length());
System.out.println(data); //print the data
data = null;
clob=null;
cs.close();
ERROR MESSAGE:
ORA-03120: two-task conversion routine: integer overflow
I appreciate your help on this problem. -
I can't make a connection from JDeveloper 10g (9.0.5.0.0) to WebLogic 8.1
When I click "Test connection" JDeveloper 10g writes the following:
Cannot instantiate class: weblogic.jndi.WLInitialContextFactory
Have somebody ever established a connection from JDeveloper 10g (9.0.5.0) to WebLogic 8.1? How to do this?It connects successfully now. Thank you for the information.
But it does nothing when I try to deploy my J2EE application.
I right-click on Resources -> application.deploy, choose "Deploy to" -> my connection. It starts to do something obscure.
Then I go to the WebLogic console and it shows that there is no my application. -
WLST : Error connecting to a remote Weblogic server instance from OEPE 3.7
Attempting a to run a weblogic script connecting to a remote weblogic server instance (10.3.5), which is generating the following exception in OEPE 3.7.2 -
username = 'weblogic'
password = 'weblogic6'
url='t3://xxx.xxx.com:7001'
connect(username,password,url)
Connecting to t3://xxx.xxx.com:7001 with userid weblogic ...
This Exception occurred at Fri Feb 01 13:20:54 MST 2013.
Error occured while performing connect : Error connecting to the server : Failed to generate class for weblogic.management.mbeanservers.compatibility.internal.MBeanHomeImpl_1035_WLStub
Use dumpStack() to view the full stacktrace :
java.lang.AssertionError: Failed to generate class for weblogic.management.mbeanservers.compatibility.internal.MBeanHomeImpl_1035_WLStubconnect
Problem invoking WLST - Traceback (innermost last):
File "C:\Users\hughese\workspace\12c_wlst\wlst\heapsize.py", line 13, in ?
File "<iostream>", line 22, in connect
File "<iostream>", line 648, in raiseWLSTException
WLSTException: Error occured while performing connect : Error connecting to the server : Failed to generate class for weblogic.management.mbeanservers.compatibility.internal.MBeanHomeImpl_1035_WLStub
Use dumpStack() to view the full stacktrace
Connecting to the local weblogic server instance (t3://localhost:7001) works okay.
From the command prompt (wlst.cmd) I'm able to connect to the remote weblogic server instance -
wls:/offline> connect('weblogic','xxxxx','t3:xxx.xxx.com:7001') ;
Connecting to t3://xxx.xxx.com:7001 with userid weblogic ...
Successfully connected to Admin Server 'AdminServer' that belongs to domain 'IDMDomain'.
I've compared the CLASSPATHs between OEPE and the command prompt.
Any assistance would be greatly appreciated.
Edited by: 950635 on Feb 1, 2013 7:47 PMHi,
1)To get mysql JDBC driver to work on my Linux system, i had to add the classpath for the driver to the .bashrc:
CLASSPATH=./:home/<user>/java/mm.mysql-2.0.6/:home/<user>/java
Note that I execute the java program as the user <user> (and .bashrc is the config. file of this <user>...). Perhaps you must do this as well for the Oracle driver on your client machine. I don't know if your client machine is UNIX/LINUX or WINDOWS. It should only be clear that the CLASSPATH is set in the config. file of the user under which the java program runs and that this user has the permission to access the files.
There are no differences between accessing the database locally than accessing it by a network connection. The only thing that matters are that the connection parameters are right and that the network works properly.
2) are you sure that the table tname (case sensitivity?) exits?
Marc -
Connect from Weblogic JMS queue to SAP WAS JMS queue
Hi,
I am trying to setup a WLS 8.1 messaging bridge between a weblogic JMS queue and a SAP WAS JMS queue. I have configured a queue on both Weblogic and SAP WAS and I have set up the messaging bridge and bridge destintations in weblogic. However when weblogic tries to get the SAP initial context factory it fails with the error below.
I have added the SAP Client jars to the weblogic system classpath, and in the weblogic startup script but it still fails. Has anyone connected from an external JMS queue to a SAP WAS JMS queue that could provide me with some guidence?
<10/08/2006 08:23:45 AM WST> <Warning> <Connector> <BEA-190032> << Weblogic Mess
aging Bridge Adapter (XA)_eis/jms/WLSConnectionFactoryJNDIXA > ResourceAllocatio
nException of javax.resource.ResourceException: ConnectionFactory: failed to get
initial context (InitialContextFactory =com.sap.engine.services.jndi.InitialCon
textFactoryImpl, url = ux0800:55304, user name = username) on createManagedConnectio
n.>
Thanks
WarrenStoyan,
Thanks for that.
My problem ended up being a classpath problem. I referenced the directory of the SAP jars in the weblogic start up script. When I changed this to reference each jar individually it worked.
I have a new issue now which may have something to do with security. The trace suggests it is logging on as the guest user, even though I entered my username and password in the Messaging bridge.
#1.5#000E7FED310600A30000008A0000302D00041AA399E338B4#1155189870559#com.sap.jms##com.sap.jms.server.sessioncontainer.InboundBus instance=BWIP#J2EE_GUEST#0####165536f0283611db8903000e7fed3106#SAPEngine_Application_Thread[impl:3]_126##0#0#Error##Plain###com.sap.jms.server.exception.JMSServerInvalidDestinationException: No destination with ID=0 found.
at com.sap.jms.server.service.impl.RegistryServiceImpl.getDestinationContext(RegistryServiceImpl.java:404)
at com.sap.jms.server.sessioncontainer.InboundBus.getDestinationContext(InboundBus.java:98)
at com.sap.jms.server.sessioncontainer.InboundBus.process(InboundBus.java:153)
at com.sap.jms.server.sessioncontainer.InboundBus.enqueue(InboundBus.java:116)
at com.sap.jms.server.sessioncontainer.SessionContainer.receiveFromDispatcher(SessionContainer.java:63)
at com.sap.jms.server.routingcontainer.RoutingContainer.receiveFromDispatcher(RoutingContainer.java:447)
at com.sap.jms.server.JMSServerContainer.dispatchRequest(JMSServerContainer.java:635)
at com.sap.jms.server.JMSServerFrame.request(JMSServerFrame.java:536)
at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
at java.security.AccessController.doPrivileged(Native Method)
at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
Warren -
I am using WLS7 with SP1.
I just recently migrated from WLS6.0. When my code tries to grab a
connection from the pool, it throws an exception
java.sql.SQLException: Pool connect failed:
weblogic.common.ResourceException: Access not allowed
at weblogic.jdbc.pool.Driver.connect(Driver.java:202)
Does anyone know if anything changed from 6.0 to 7?
Here is a piece of the code that throws exception.
Driver driver =
(Driver)Class.forName("weblogic.jdbc.pool.Driver")
.newInstance();
conn = driver.connect("jdbc:weblogic:pool:" +
dbName, null);
Thanks in advance.Hi Jung,
"Jung Yang" <[email protected]> wrote in message
news:[email protected]...
Do you know how to change security setting on the connection pool?
Thanks.WebConsole:
1.Compatibility Security => ACLs
Create a new ACL,
name : weblogic.jdbc.connectionPool.yourPoolname
permission : reserve, reset
group : everynone
2.Services => JDBC => Connection Pool
Create a new Connection Pool
ACL Name : weblogic.jdbc.connectionPool.yourPoolname
In 'Target' tab, choose server and click the Apply button
Slava
>
"Slava Imeshev" <[email protected]> wrote in message
news:[email protected]...
Hi Jung,
Could you try providing weblogic user name and password
in the properties?
Could you also check security setting of the connection pool?
Regards,
Slava Imeshev
"Jung Yang" <[email protected]> wrote in message
news:[email protected]...
Well that is exactly what I am doing. The variable dbName is database
connection pool name that I created in weblogic console. Again, it
worked
in WLS6 but after migration, it stopped working.
Thanks.
"Mitesh Patel" <[email protected]> wrote in message
news:[email protected]...
In my code I am supplying name of the connection pool already
created
in
weblogic server. I am asking you to get connection from the pool
using
pool
driver.
In your case you are trying to create connection straight to
database
using pool
driver.
What I am asking is pass name of the connection pool instead of
database
name.
Thanks,
Mitesh
Jung Yang wrote:
What would be the difference between your code and mine? Mine
simple
appends dbName string value for connection pool name at the end of
"jdbc:weblogic:pool:"? And why same exact code would work in WLS6and
not
work in WLS7?
Thanks.
"Mitesh Patel" <[email protected]> wrote in message
news:[email protected]...
conn = driver.connect("jdbc:weblogic:pool:" +
dbName, null);Instead of doing this what if you use
Connection conn =
myDriver.connect("jdbc:weblogic:pool:myConnectionPool", null);
Will you please try this and see if that helps?
Mitesh
Jung Yang wrote:
Isn't that exactly what I posted for my code piece?
Thanks.
"Mitesh Patel" <[email protected]> wrote in message
news:[email protected]...
Try As described below:
The following example demonstrates how to use a database
connection
pool
from a servlet.
Load the pool driver and cast it to java.sql.Driver. The
full
pathname
of
the driver is weblogic.jdbc.pool.Driver. For example:
Driver myDriver = (Driver)
Class.forName("weblogic.jdbc.pool.Driver").newInstance();
Create a connection using the URL for the driver, plus
(optionally)
the
name of the registered connection pool. The URL of the pool
driver
is
jdbc:weblogic:pool.
You can identify the pool in either of two ways:
Specify the name of the connection pool in a
java.util.Properties
object
using the key connectionPoolID. For example:
Properties props = new
Properties();props.put("connectionPoolID",
"myConnectionPool");Connection conn =
myDriver.connect("jdbc:weblogic:pool", props);
Add the name of the pool to the end of the URL. In this case
you
do
not
need a Properties object unless you are setting a username
and
password
for using a connection from the pool. For example:
Connection conn =
myDriver.connect("jdbc:weblogic:pool:myConnectionPool",
null);
Note that the Driver.connect() method is used in theseexamples
instead of
the DriverManger.getConnection() method. Although you may
use
DriverManger.getConnection() to obtain a databaseconnection,
we
recommend
that you use Driver.connect() because this method is not
synchronized
and
provides better performance.
Note that the Connection returned by connect() is an
instance
of
weblogic.jdbc.pool.Connection.
Call the close() method on the Connection object when youfinish
with
your
JDBC calls, so that the connection is properly returned to
the
pool. A
good coding practice is to create the connection in a try
block
and
then
close the connection in a finally block, to make sure the
connection
is
closed in all cases.
conn.close();
Mitesh
Jung Yang wrote:
I am using WLS7 with SP1.
I just recently migrated from WLS6.0. When my code tries
to
grab a
connection from the pool, it throws an exception
java.sql.SQLException: Pool connect failed:
weblogic.common.ResourceException: Access not allowed
at
weblogic.jdbc.pool.Driver.connect(Driver.java:202)
Does anyone know if anything changed from 6.0 to 7?
Here is a piece of the code that throws exception.
Driver driver =
(Driver)Class.forName("weblogic.jdbc.pool.Driver")
.newInstance();
conn =
driver.connect("jdbc:weblogic:pool:"
+
dbName,
null);
>>>>>>>>>
Thanks in advance. -
Connect from JDeveloper 11g TP4 to Weblogic 10.3
Hi,
Did anybody manage to connect to Weblogic 10.3 from JDeveloper 11.1 TP4 ?
I looks different from the tutorial provided by Shay Shmeltzer on how to connect JDev 10g to Weblogic. With 11.1 TP4, I create the an Application server connection, I've put the path to the weblogic.jar in the field named "Path to Weblogic containing Weblogic Client" but when I test the connection, I get "Cannot instantiate class: weblogic.jndi.WLInitialContextFactory" which suggest the jar is not loaded. I run JDev on Linux, I've copied the file in "JDEV_HOME/jdev/lib/ext (I've created the directory)", "JDEV_HOME/jdev/extensions" and "JDEV_HOME/jdev/lib" and bounce Jdev. Same error.
The online doc doesn't say more that what I've guess. Obviously I'm doing something wrong. Can anybody help me, it may be obvious because nobody seems to have asked that question in this forum.
Thank you very much for your help. Best Regards
GregoryGregory,
an EAR file deployment will always work ;-) However, then you don't have the ADF libraries installed on WebLogic 10.3 wich will cause the next problem. So unless you deploy the whole ADF libraries with your application (appr. 70 MB) you need to enable the WLS 10.3 instance for ADF running the ADF installer from the production version. This adf installer is part of the JDeveloper / WLS installer that you can obtain from otn.oracle.com/products/jdev
At the end of the day the TP4 turns out to be what it is: a technology preview that gets you started but not more
Frank -
What is the best Connection option from WebSphere to Weblogic?
What is the best Connection option from WebSphere to Weblogic?
We are trying to send XML messages from Websphere to WLS to active some
services....
any pointers, suggestions?
Thx
VJ
Hi,
One of my clients has an environment similar to yours with an internal pair of F5s and a pair used for the access from the internet.
I am only going to focus on the method using an F5 Load Balancer and SSL Offloading. the setup of the F5 will not be covered in detail but a reference to the documentation to support SharePoint and SSL Offloading will be provided
Since you arte going to be using SSL Offloading you do not need to extend your WebApps to use separate IIS WebSites with Unique IP Addresses
Configure the F5 with SSL Offloading
Configure a Internal AAM for SSL (HTTPS) for each WebApp that maps to the Public HTTP FQDN AAM Setting for each WebApp
Our environment has an additional component we require RSA Authentication for all internet facing Sites. So we have the extra step of extending the WebApp to a separate IIS WebSite and configuring RSA for each extended WebSite.Reference:
Reference SharePoint F5 Configuration:
http://www.f5.com/featured/video/ssl-offloading/
-Ivan -
HTTPS connection from servlet to another webserver
Hi,
We want to make a https connection from a servlet in weblogic server to another
web server (not necessarily weblogic). We also need dual authentication. But whenever
we use URL.openConnection(), it always returns us weblogic's internal https and
SSL implementation. Since weblogic has no documentation about how to use these
internal classes, such as how to set trusted server certificate, and how to set
client certificate (servlet is a client of another web server). We want to use
jsse, after setting JSSE required system properties, I still get a weblogic's
httpsURLConnection. Can any of you tell me how to resolve this issue?
Thanks.
XinshiYeah, I'm using JSSE now. Here is what I did:
Security.addProvider(new com.sun.net.ssl.internal.ssl.Provide());
Provider prov = new SimpleSecureProvider();
prov.setProperty("SecureRandom.efficient", "test.EfficientSecureRandom");
Security.insertProviderAt(prov, 1);
You don't really need the provider stuff to get the example working. I use it
to get around a quick in JSSE where the random number generator takes 15-30 seconds
to generate a random sequence at start up.
SimpleSecureProvider looks like this:
public class SimpleSecureProvider extends Provider
public SimpleSecureProvider()
super("SimpleSecureProvider-", 1.0, "Hack to enable more efficient random
seed generator");
test.EfficientSecureRandom is bascially an exact copy of Sun's SecureRandom.java
with the only difference that I used my own random number generator.
Anyway, rest of the code you need looks like this:
URL url= new URL("htps://someplace.com");
URLConnection sconnection = url.openConnection();
Do whatever.
I also stored jcert.jar, jnet.jar, jsse.jar in /usr/java/jdk1.3/lib/ext
I think that is everything.
I just noticed that service pack 9 has a security example that does not require
all these jsse hacks. I'm trying to get it to work, but not having much luck.
Anybody got this working right?
"Jayesh Patel" <[email protected]> wrote:
See if this works,
1. Add the 'j2ee.jar' to CALSSPATH in weblogic startup script.
2. Set the property SSLHandlerEnabled flase in config.xml
3. Add the following property permission to the
weblogic.policy' file under a 'grant' directive
for all codebases (bottom): 'permission java.security.AllPermission'
4. Use the following bit of source code to create an https connection:
import com.sun.net.ssl.*; ....
com.sun.net.ssl.HttpsURLConnection connection;
System.setProperty ("java.protocol.handler.pkgs",
"com.sun.net.ssl.internal.www.protocol");
java.security.Security.addProvider(new
com.sun.net.ssl.internal.ssl.Provider() );
URL url = new URL( "https", hostname, query );
-Jayesh
connection = (com.sun.net.ssl.HttpsURLConnection )url.openConnection(
"Xinshi Sha" <[email protected]> wrote in message
news:[email protected]...
Hi,
We want to make a https connection from a servlet in weblogic serverto
another
web server (not necessarily weblogic). We also need dual authentication.But whenever
we use URL.openConnection(), it always returns us weblogic's internalhttps and
SSL implementation. Since weblogic has no documentation about how
to
use
these
internal classes, such as how to set trusted server certificate, andhow
to set
client certificate (servlet is a client of another web server). Wewant to
use
jsse, after setting JSSE required system properties, I still get aweblogic's
httpsURLConnection. Can any of you tell me how to resolve this issue?
Thanks.
Xinshi -
Problem in getting the database connection from a connection pool
Hai All,
I am facing a problem in getting the database connection from a connection pool created on weblogic server 8.1.
I am using the Oracle database 8.1.7.
I have configured my connection pool, datasource and JNDI in weblogic.
In my java program i have the following code to retrieve the connection.
import java.sql.*;
import java.util.Hashtable;
import javax.naming.Context;
import javax.naming.InitialContext;
class jdbcshp1 {
public static void main(String[] args) {
Connection connection = null;
try {
Hashtable ht = new Hashtable();
ht.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory"); // Wanna get rid of this.
ht.put(Context.PROVIDER_URL,"t3://localhost:7001"); // wanna get rid of this.
// Get a context for the JNDI look up
Context ctx = new InitialContext(ht);
javax.sql.DataSource ds = (javax.sql.DataSource) ctx.lookup ("myjndi1");
//Create a connection object
connection = ds.getConnection();
The above code is working fine but, the two ht.put statements are creating problem.
The problem is, after converting the application into WAR file it can be deployed
on any machine or different port on same machine. My application fails if its deployed on
weglogicserver which is at different port.
Is there any way that i can get rid of those ht.put statements or any other way to solve the problem.
any help is appreciated.
Thanks in advance
Pooja.Hai All,
Firstly, thanks for ur reply.
Even i have seen some code which uses context constructor with out any parameter and works fine.
i dont understand why its not working for my code.
When i remove those ht.put code and use context constructor with out any parameter, it giving an error.
Context ctx = new InitialContext();
javax.sql.DataSource ds = (javax.sql.DataSource) ctx.lookup ("ocjndi");
connection = ds.getConnection();The error is as follows:
javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
the above error is forcing me to include those code but if the port number is changed the code will not work. Plz let meknow if some setting have to be made.
I appreciate all ur valuable help.
Thanks once again.
Pooja. -
Calling an ejb from glassfish to weblogic server
I'd like to be able to call a stateless session bean from a glassfishV3 server that is residing on weblogic 9.2.3. (Ejb spec 2.1 NOT 3.0 please)
I've done this successfully from Tomcat to weblogic, but there are a few hiccups when trying this on glassfish.
Basically what I've attempted is this:
1.) I add these jvm properties to the glassfish startup:
-Dorg.omg.CORBA.ORBClass=weblogic.corba.orb.ORB
-Dorg.omg.CORBA.ORBSingletonClass=weblogic.corba.orb.ORB
-Djavax.rmi.CORBA.PortableRemoteObjectClass=weblogic.iiop.PortableRemoteObjectDelegateImpl
-Djavax.rmi.CORBA.UtilClass=weblogic.iiop.UtilDelegateImpl
2.) Copy weblogic.jar, tools.jar, and webservices.jar from the weblogic/server/lib directory to the glassfish lib/ext directory
...glassfish won't start then because of the weblogic.jar...
3.) Move the weblogic.jar to the WEB-INF/lib directory of my war in glassfish.
Now I try it and get:
(I'm skipping some of the stacktrace at the start)
.....java.lang.IllegalAccessError: tried to access method weblogic.kernel.KernelStatus.initialized()V from class weblogic.kernel.Kernel at weblogic.kernel.Kernel.ensureInitialized......
I'm guessing that this has to do with the "weblogic kernel" not being initialized. So now I'm stuck.
Am I going down the wrong path?
I've also tried these other proposed solutions:
1.) Changing the connection properties of the InitialContext to use these properties:
env.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
env.put(Context.PROVIDER_URL, "t3://localhost:7001");
env.put(Context.SECURITY_PRINCIPAL, "weblogic");
env.put(Context.SECURITY_CREDENTIALS, "weblogic");
2.) Using RMI over IIOP instead of T3.
None of these with any luck.
If anyone has done this successfully I'd appreciate some insight.
Regards,
EricI'd like to be able to call a stateless session bean from a glassfishV3 server that is residing on weblogic 9.2.3. (Ejb spec 2.1 NOT 3.0 please)
I've done this successfully from Tomcat to weblogic, but there are a few hiccups when trying this on glassfish.
Basically what I've attempted is this:
1.) I add these jvm properties to the glassfish startup:
-Dorg.omg.CORBA.ORBClass=weblogic.corba.orb.ORB
-Dorg.omg.CORBA.ORBSingletonClass=weblogic.corba.orb.ORB
-Djavax.rmi.CORBA.PortableRemoteObjectClass=weblogic.iiop.PortableRemoteObjectDelegateImpl
-Djavax.rmi.CORBA.UtilClass=weblogic.iiop.UtilDelegateImpl
2.) Copy weblogic.jar, tools.jar, and webservices.jar from the weblogic/server/lib directory to the glassfish lib/ext directory
...glassfish won't start then because of the weblogic.jar...
3.) Move the weblogic.jar to the WEB-INF/lib directory of my war in glassfish.
Now I try it and get:
(I'm skipping some of the stacktrace at the start)
.....java.lang.IllegalAccessError: tried to access method weblogic.kernel.KernelStatus.initialized()V from class weblogic.kernel.Kernel at weblogic.kernel.Kernel.ensureInitialized......
I'm guessing that this has to do with the "weblogic kernel" not being initialized. So now I'm stuck.
Am I going down the wrong path?
I've also tried these other proposed solutions:
1.) Changing the connection properties of the InitialContext to use these properties:
env.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
env.put(Context.PROVIDER_URL, "t3://localhost:7001");
env.put(Context.SECURITY_PRINCIPAL, "weblogic");
env.put(Context.SECURITY_CREDENTIALS, "weblogic");
2.) Using RMI over IIOP instead of T3.
None of these with any luck.
If anyone has done this successfully I'd appreciate some insight.
Regards,
Eric -
Configuration Issue in connecting oracle AQ in weblogic server 10.3.5
Hi,
I am working in Message driven bean and want to receive the message from queue called IEDWM_QUEUE and
have made all the necessary configurations for connecting oracle AQ in weblogic .... Created Foriegnserver,connections factories,destination in JMS Module(weblogic).
But Still i couldn't able to connect to JMS Destination, getting the below error
Jan 16, 2012 12:40:15 PM GMT+05:30> <Warning> <EJB> <BEA-010061> <The Message-Driven EJB: CandidateConsumer is unable to connect to the JMS destination: Queues
IEDWM_QUEUE. The Error was:
avax.naming.NamingException: The configuration of the AQjmsInitialContext is not complete. The configuration must contain datasource or (db_url,java.naming.security.principal,java.naming.security.credentials) or both
Kindly tell me if you need any further information and I request you to provide the solution, it will be more helpful for us..
With Regards,
Sridhar.THi,
If I recall correctly:
1 - Ensure you have configured and targeted a Data Source for Oracle, and check your statistics or logs to make sure that it is working.
2 - Reference this Data Source as per the AQ instructions. I think this involves using a specific property name in the context properties for the AQ initial context, where the context properties are set as part of foreign server configuration.
Tom -
Class Not Found Exception After Connecting From a JDeveloper
Hi,
I am following the tutorial on SOA and started to experience problems in deployments (all but the console, including em) after the connection to the remote weblogic (10.3.5) from JDeveloper. I would know if the connection modifies the WLS environment. Unfortunately I did not note the message before wiping the setup, but found many entries on Google referring to some ADF library. I followed the suggestion to apply the adf runtime to the WLS install but this not helped.
By the way, I would just understand if the remote connection from a JDeveloper adds some configuration which is then eventually not found in the target WLS.
Thanks
Fabio D'Alfonso
http://www.fabiodalfonso.comCan you check the log files of soa_server1, which are located in the <domain-home>/servers/<server-name>/logs.
There are probably some occurences of class not found exceptions.
When you are using the node manager to start your environment you have to make sure that StartScriptEnabled is set
to true in the nodemanager.properties file (located in the directory: <wl-home>/common/nodemanager
In the section "Starting the SOA environment" here - http://middlewaremagic.com/weblogic/?p=6040
an example is presented
Maybe you are looking for
-
I have reset my password but my iphone says my id is still disabled. why?
i have reset my password but my iphone says my id is still disabled. why?
-
Can Photoshop Batch Resize Tiff Files?
I have quite a number of tiff files that I want to resize in terms of page dimensions and retain the same resolution / dpi. Can Photoshop batch resize tiff files?
-
Audition CS5.5 not recognizing my microphone
I am using a Mackie 402-VLZ3 and Audition CS5.5 on my Acer Aspire 5736Z. When ever I try to record my laptop microphone picks it up instead of my condenser mic. I've went to control panel, manage audio devises, but only the laptop mic shows up. HE
-
Hello everyone, This is regarding configuring Redundant Interconnect Usage on 11gr2 RAC on linux. The RAC is already installed and so I think that I've to use "oifcfg" to configure the same. However, I've few questions regarding the same. oifcfg ifli
-
install windows phone 8.0 sdk on win 10 error Windows Program Compatibility mode is on. Turn it off and then try Setup again.