Setting Java Properties
Hi everybody. I have been looking around, but can't find anywhere where you set Java Properties (the one's you get via System.getProperty() ) in the iAS. Our current application has a lot of these properties, and in order for getting it running on the iAS I must be able to specify Java Properties. Does anybody know where I do this (it's an OC4J mod, not JServ).
Regards, Magnus Edevag
[email protected]
It's easy - in each OC4J container there is a "server" link (down at the left side). In following screen there are three lines (again at the bottom) - last one is called Java properties. It is where you specify startup parameters for JVM. BTW, you can find them in opmn/conf/opmn.xml. Sometimes, if you hit the wrong button you have to go there and edit directly.
Myrra
Similar Messages
-
How to set proxy authentication using java properties at run time
Hi All,
How to set proxy authentication using java properties on the command line, or in Netbeans (Project => Properties
=> Run => Arguments). Below is a simple URL data extract program which works in absence of firewall:
import java.io.*;
import java.net.*;
public class DnldURLWithoutUsingProxy {
public static void main (String[] args) {
URL u;
InputStream is = null;
DataInputStream dis;
String s;
try {
u = new URL("http://www.yahoo.com.au/index.html");
is = u.openStream(); // throws an IOException
dis = new DataInputStream(new BufferedInputStream(is));
BufferedReader br = new BufferedReader(new InputStreamReader(dis));
String strLine;
//Read File Line By Line
while ((strLine = br.readLine()) != null) {
// Print the content on the console
System.out.println (strLine);
//Close the input stream
dis.close();
} catch (MalformedURLException mue) {
System.out.println("Ouch - a MalformedURLException happened.");
mue.printStackTrace();
System.exit(1);
} catch (IOException ioe) {
System.out.println("Oops- an IOException happened.");
ioe.printStackTrace();
System.exit(1);
} finally {
try {
is.close();
} catch (IOException ioe) {
}However, it generated the following message when run behind the firewall:
cd C:\Documents and Settings\abc\DnldURL\build\classes
java -cp . DnldURLWithoutUsingProxy
Oops- an IOException happened.
java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
at java.net.Socket.connect(Socket.java:452)
at java.net.Socket.connect(Socket.java:402)
at sun.net.NetworkClient.doConnect(NetworkClient.java:139)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:402)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:618)
at sun.net.www.http.HttpClient.<init>(HttpClient.java:306)
at sun.net.www.http.HttpClient.<init>(HttpClient.java:267)
at sun.net.www.http.HttpClient.New(HttpClient.java:339)
at sun.net.www.http.HttpClient.New(HttpClient.java:320)
at sun.net.www.http.HttpClient.New(HttpClient.java:315)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:510)
at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:487)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:615) at java.net.URL.openStream(URL.java:913) at DnldURLWithoutUsingProxy.main(DnldURLWithoutUsingProxy.java:17)
I have also tried the command without much luck either:
java -cp . -Dhttp.proxyHost=wwwproxy -Dhttp.proxyPort=80 DnldURLWithoutUsingProxy
Oops- an IOException happened.
java.io.IOException: Server returned HTTP response code: 407 for URL: http://www.yahoo.com.au/index.html
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1245) at java.net.URL.openStream(URL.java:1009) at DnldURLWithoutUsingProxy.main(DnldURLWithoutUsingProxy.java:17)
All outgoing traffic needs to use the proxy wwwproxy (alias to http://proxypac/proxy.pac) on port 80, where it will prompt for valid authentication before allowing to get through.
There is no problem pinging www.yahoo.com from this system.
I am running jdk1.6.0_03, Netbeans 6.0 on Windows XP platform.
I have tried Greg Sporar's Blog on setting the JVM option in Sun Java System Application Server (GlassFish) and
Java Control Panel - Use browser settings without success.
Thanks,
GeorgeHi All,
How to set proxy authentication using java properties on the command line, or in Netbeans (Project => Properties
=> Run => Arguments). Below is a simple URL data extract program which works in absence of firewall:
import java.io.*;
import java.net.*;
public class DnldURLWithoutUsingProxy {
public static void main (String[] args) {
URL u;
InputStream is = null;
DataInputStream dis;
String s;
try {
u = new URL("http://www.yahoo.com.au/index.html");
is = u.openStream(); // throws an IOException
dis = new DataInputStream(new BufferedInputStream(is));
BufferedReader br = new BufferedReader(new InputStreamReader(dis));
String strLine;
//Read File Line By Line
while ((strLine = br.readLine()) != null) {
// Print the content on the console
System.out.println (strLine);
//Close the input stream
dis.close();
} catch (MalformedURLException mue) {
System.out.println("Ouch - a MalformedURLException happened.");
mue.printStackTrace();
System.exit(1);
} catch (IOException ioe) {
System.out.println("Oops- an IOException happened.");
ioe.printStackTrace();
System.exit(1);
} finally {
try {
is.close();
} catch (IOException ioe) {
}However, it generated the following message when run behind the firewall:
cd C:\Documents and Settings\abc\DnldURL\build\classes
java -cp . DnldURLWithoutUsingProxy
Oops- an IOException happened.
java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
at java.net.Socket.connect(Socket.java:452)
at java.net.Socket.connect(Socket.java:402)
at sun.net.NetworkClient.doConnect(NetworkClient.java:139)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:402)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:618)
at sun.net.www.http.HttpClient.<init>(HttpClient.java:306)
at sun.net.www.http.HttpClient.<init>(HttpClient.java:267)
at sun.net.www.http.HttpClient.New(HttpClient.java:339)
at sun.net.www.http.HttpClient.New(HttpClient.java:320)
at sun.net.www.http.HttpClient.New(HttpClient.java:315)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:510)
at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:487)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:615) at java.net.URL.openStream(URL.java:913) at DnldURLWithoutUsingProxy.main(DnldURLWithoutUsingProxy.java:17)
I have also tried the command without much luck either:
java -cp . -Dhttp.proxyHost=wwwproxy -Dhttp.proxyPort=80 DnldURLWithoutUsingProxy
Oops- an IOException happened.
java.io.IOException: Server returned HTTP response code: 407 for URL: http://www.yahoo.com.au/index.html
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1245) at java.net.URL.openStream(URL.java:1009) at DnldURLWithoutUsingProxy.main(DnldURLWithoutUsingProxy.java:17)
All outgoing traffic needs to use the proxy wwwproxy (alias to http://proxypac/proxy.pac) on port 80, where it will prompt for valid authentication before allowing to get through.
There is no problem pinging www.yahoo.com from this system.
I am running jdk1.6.0_03, Netbeans 6.0 on Windows XP platform.
I have tried Greg Sporar's Blog on setting the JVM option in Sun Java System Application Server (GlassFish) and
Java Control Panel - Use browser settings without success.
Thanks,
George -
Viewing/setting java security properties
I am using a thrid party utility that is calling InetAddress.getLocalHost(). After checking the performance from JProfiler, I observed that this method poor at performance. Javadoc mentions that INetAddress is cached which is controlled by two java security properties: networkaddress.cache.ttl and networkaddress.cache.negative.ttl. How do I view this property value and change it if required?
I have done a little bit of more research in Java forums regarding setting these system properties. It looks like setting them is the only option to be able to connect to a Glassfish AS running on a seperate server, as the driver classes check this property at runtime to determine the host.
So I am basically left with the only choice of finding a convenient way to set these properties properly per communication channel, but unfortunately, I still am not able to find how.
Kind Regards,
S. Gökhan TOPÇ -
Setting system properties of windows using java
Hi,
I am doing a project in networking using java in which i need to get and set Operating system(Windows) properties .
I am able to do the GET part but i face problem in setting the system properties permanently.
Please help me!.
--AmyIs there any way of setting the properties other than employing the useo of JNI.
-
If I want to use java ORB to visit Visibroker ORB , how to set the Properties for init ?? can you help me ?
thanks !System.setProperty("org.omg.CORBA.ORBClass","com.inprise.vbroker.orb.ORB");
System.setProperty("org.omg.CORBA.ORBSingletonClass","com.inprise.vbroker.orb.ORB");You can get some examples here:
http://maris.site.lv/ejb.html
best regards,
Maris Orbidans -
How do I set System properties within WL6.0?
I am setting WL6.0 up to have a startup class, but this class needs to
read system properties which have not yet been set. How do I set these
up within weblogic? I was able to get the startup class set up, but it
needs these system properties to continue.
gmoCorrect on all points. The one advantage of doing this in java is that you can more easily do more
complex things like accessing configuration information from a remote data store (like a database).
Dimitri Rakitine wrote:
These are not needed if you simply replace java ...lots of options... weblogic.Server with
java ...lots of options... startmyWLS in the script which starts WebLogic, but, on the other
hand, this solution is no different from simply adding -DmyProperty=myValue to the startup script
(I think that the ultimate goal is the ability to deploy(and redeploy!) components,
without any mods to the particular vendor's startup scripts of anything of that nature).
Kumar Allamraju <[email protected]> wrote:
Thanks to robert for a quick workaround..
I tried to start the WLS with the following piece of code and actually i need to set
some additional properties
for successful server startup.
Here it is
import java.util.Properties;
public class startmyWLS
public static void main(String[] args)
Properties props = System.getProperties();
props.put("myProperty", "myValue");
props.put("bea.home", "E:\\bea");
props.put("weblogic.Domain", "mydomain");
props.put("weblogic.Name", "myserver");
props.put("java.security.policy",
"E:\\bea\\wlserver6.0\\lib\\weblogic.policy");
System.setProperties(props);
weblogic.Server.main(args);
Make sure you run this from E:\bea\wlserver6.0., as it tries to read config.xml
config\[your-domain-name] from this
directory.
Kumar
Robert Patrick wrote:
import java.util.Properties;
public class StartMyWebLogicServer
public static void main(String[] args)
Properties props = System.getProperties();
props.put("myProperty", "myValue")
System.setProperties(props);
weblogic.Server.main(args);
gmo wrote:
That won't work since it has to be 'outside' of the code. It's a service, and
services are started when weblogic is started up, not when I call a bean.
And it has to be dynamic, since the properties will vary on evry installation.
Robert Patrick wrote:
You can also use System.setProperty() or a combination of
System.getProperties() followed by a System.setProperties()...
gmo wrote:
They are not normal system properties. I'm using some open source code, and
it requires settings to be system properties, but they are specific to the
application, which means that they are not already in the system
properties. I know how to get them, and after some more research, you can
set them on the command line when starting up weblogic. However, is this
the best way to set system properties?
Robert Patrick wrote:
What "system properties" are you trying to find?
gmo wrote:
I am setting WL6.0 up to have a startup class, but this class needs to
read system properties which have not yet been set. How do I set these
up within weblogic? I was able to get the startup class set up, but it
needs these system properties to continue.
gmo
Dimitri -
Where to set Java system parameter for embedded WLS in JDev 11g?
Hi,
I am trying to test web service invocation via JAX-WS proxy generation on Jdeveloper 11g.
When I test client code, I got following error message.
Exception in thread "main" java.lang.Error: Jaxrpc 1.1 method is not supported.
at weblogic.webservice.core.rpc.ServiceFactoryImpl.loadService(ServiceFactoryImpl.java:65)
From a forum discussion, it was suggested to add following java parameter in the path.
-Ddebug=true -Djavax.xml.rpc.ServiceFactory=oracle.j2ee.ws.client.ServiceFactoryImpl -Djavax.xml.soap.SOAPConnectionFactory=oracle.j2ee.ws.saaj.client.p2p.HttpSOAPConnectionFactory -Djavax.xml.soap.SOAPFactory=oracle.j2ee.ws.saaj.soap.SOAPFactoryImpl-Dweblogic.log.Log4jLoggingEnabled=true -Djbo.debugoutput=console
I can not find where to set this parameter under "Tools"->"Preferences". Is there any place in IDE that I can set this value?
Thanks for the help,
JimThe parameters are defined in the Run configuration of your application. You find the Run configuration in the project properties under run. Open the 'Default' configuration, there you find the java properties where you put the parameters.
Timo -
Setting system properties: difference between "-D" and "System.setProperty"
Hi.
I have a program that relies on the jogl library to display graphics. Internally, jogl loads a native library from disk, with a System.loadLibrary() call. In turn, loadLibrary searches the paths in the system property "java.library.path" to find the jogl DLL/SO files. So, it is my responsibility to ensure that the "java.library.path" property is correctly set.
There are two ways that I know of to set system properties: as an argument to the JRE via the "-D" option and from within an application with the System.setProperty method. However, I have noticed that only the former gives the desired behavior. That is, if I do:
java -Djava.library.path=lib MyProgram{code}
the code in jogl.jar is able to successfully find and load the native libraries in lib/, but if I do:
{code:java}System.setProperty("java.library.path", "lib");{code}
at the beginning of main in my program (before the classes requiring jogl are loaded), I end up with an UnsatisfiedLinkError.
Why does this happen? Why do the 2 methods produce different results? Is specifying native library paths on the command line the only way to ensure that they are found?See the [System Properties Tutorial|http://java.sun.com/docs/books/tutorial/essential/environment/sysprop.html] section on "Writing System Properties" which says:
Warning: Changing system properties is potentially dangerous and should be done with discretion. Many system properties are not reread after start-up and are there for informational purposes. Changing some properties may have unexpected side-effects.
Also see the [setting java.library.path property in java code|http://forums.sun.com/thread.jspa?threadID=627890] thread in the JNI forum. -
Access java properties from C++/JNI program
Hello all,
Is it possible to access the Java properties of a JNI VM from a C++ program?
If so, could the code or process be explained to me.
I want to be able to identify a specific VM that is retrieved by the JNI_GetCreatedJavaVMs
call. I set a user property when the VM was created, and would like to verify its value
before calling AttachCurrentThread.
Thanks in advance.
MarkAre you saying that you set a system property (via System.setProperty() or -D)?
If so, just use the JNI invocation API to call System.getProperty().
Without error checking, that looks something like this:bool isMySystem( JNIEnv* env ) {
const string PropertyName = "IsMySystem";
jclass systemClass = env->FindClass( "java/lang/System" );
jmethodID getPropertyMethod = env->GetStaticMethodID( systemClass, "getProperty", "(Ljava/lang/String;)Ljava/lang/String;" );
jstring propertyNameString = env->NewStringUTF( PropertyName.c_str() );
jstring propertyString = env->CallStaticObjectMethod( systemClass, getPropertyMethod, propertyNameString );
if ( propertyString == 0 ) {
return false;
const char* property = env->GetStringUTFChars( propertyString, 0 );
boolean isMine = ! strcmp( property, "Yes" );
env->ReleaseStringUTFChars( propertyString, property );
return isMine;
}Using Jace, http://jace.reyelts.com/jace (a free, open-source toolkit), this would look more like:bool isMySystem() {
String property = System::getProperty( "IsMySystem" );
return property.isNull() ? false : prop == "Yes";
}In the end, Jace ends up making all of the exact same calls, but you can see how much easier it is to use.
God bless,
-Toby Reyelts -
Help Please: how to set JDBC properties for data encryption in BC4J
Hello,
I am trying to implement JDBC Thin Driver Support for Data Encryption and Integrity.
With java.sql.Connection and java.util.Properties, one would do something like the following code:
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
Properties props = new Properties();
int level = AnoServices.REQUIRED;
props.put("oracle.net.encryption_client", Service.getLevelString(level));
props.put("oracle.net.encryption_types_client", "( RC4_40 )");
props.put("oracle.net.crypto_checksum_client",Service.getLevelString(level));
props.put("oracle.net.crypto_checksum_types_client", "( MD5 )");
Connection conn = DriverManager.getConnection ("jdbc:oracle:thin:@localhost:1521:main", props);
But, how can we do this with BC4J objects? Can we set this properties via EnvInfoProvider class? Please help. Thank you very much in advance.
ZhirongHi,
Try adding the code in the PBO part of your custom program used for the custom screen which you have created and added inside the BADI.
Regards,
Harish -
How to set CORS properties for BLOB Storage using node?
Hi - I just got started with Azure using a Node-based web site and mobile services.
I am following various documentation in order to provide an API for users to upload images via a time-restricted SAS for the BLOB Storage.
In order to upload my image, I need to set the CORS configuration for the BLOB Storage. Unfortunately this cannot be done via the management portal.
I'm unclear as to how to accomplish this. I'm considering using the startup.js file in my mobile service to make a post request to the BLOB Storage REST API:
http://msdn.microsoft.com/en-us/library/windowsazure/hh452235.aspx
Are there appropriate methods in the Node SDK to make this easier, especially the signing part?
What is the recommended way for setting CORS properties for the BLOB Storage via Node?
Thanks for your help
StefanUnfortunately Node SDK does not support CORS functionality yet. Your option would be to write code which consumes the REST API for setting CORS. Not sure if it helps but there's a free tool out there written by my company which you can use to set CORS
on your storage account. More information about this tool can be found here:
http://blog.cynapta.com/2013/12/cynapta-azure-cors-helper-free-tool-to-manage-cors-rules-for-windows-azure-blob-storage/
Hope this helps. -
Static lookup lists:read data from a Java *.properties file
Hi
i need to make static lookup lists i am using read data from a Java *.properties file
i am using the Class "PropertyFileBasedLookupViewObjectImpl" that wrote by Steve Muench in ToyStore.
but i need to use the default language for that i update the loadDataFromPropertiesFile()
method to find the correct properties file
String temp=Locale.getDefault().getLanguage();
String propertyFile =
getViewDef().getFullName().replace('.', '/')+"_"+temp+ ".properties";
the problem:
For English(TEST_en.properties) it is good and working
For Arabic(TEST_ar.properties) read from correct file _ar.properties
but the dispaly character is wrong
When Debug
In the File 1=دمشق
In debug 1=/u32423Depending on your use case you can either use a programmatic VO or directly expose the JV class as a data control.
http://docs.oracle.com/cd/E18941_01/tutorials/jdtut_11r2_36/jdtut_11r2_36.html -
Setting portlet properties on different pages
Hello,
New to Personalization so I apologize if this is obvious.
Is there a way to have the same portlet available on multiple
pages and allow a user to set different properties in a profile
based on the page the portlet is in? For example, if portlet X
is available on page A and page B and the edit tab allows the
user to set value Val1 in a property, is there a way to qualify
the Val1 property with a namespace so that it is associated with
the page it is on? Currently if I have some properties defined
in a profile and I set those profile values in an edit page
and get them in the top portlet, then those same profile values
will be associated with that portlet on all pages. That is with
using the um:getProperty tag. Is there some way through roles
to namespace profile values based on the page the portlet is on?
Thanks,
CurtCurt,
Sure you can.
Just define separate user property sets and store the information based on
the page the user is on.
You can easily determine the page id using portal API (for example look at
the jsp which renders the page tabs in the framework directory).
Regards,
Michael Goldverg
"Curt" <[email protected]> wrote in message
news:[email protected]..
>
Hello,
New to Personalization so I apologize if this is obvious.
Is there a way to have the same portlet available on multiple
pages and allow a user to set different properties in a profile
based on the page the portlet is in? For example, if portlet X
is available on page A and page B and the edit tab allows the
user to set value Val1 in a property, is there a way to qualify
the Val1 property with a namespace so that it is associated with
the page it is on? Currently if I have some properties defined
in a profile and I set those profile values in an edit page
and get them in the top portlet, then those same profile values
will be associated with that portlet on all pages. That is with
using the um:getProperty tag. Is there some way through roles
to namespace profile values based on the page the portlet is on?
Thanks,
Curt -
How do I set file properties (win XP) ?
Does anyone know how to set/modify a windows file properties inside Labview ? For exemple : change the author, the comment... etc.
Thank you !
J.K.Hello,
It is not possible with advanced file I/O LabVIEW VIs.
There is a possible workaround by using low level Windows functions in a dll.
Perhaps the easier would be to set your properties at the top of your file.
You will find some explanations here :
http://forums.ni.com/ni/board/message?board.id=170&message.id=85101&requireLogin=False
regards
Marc L.
NIF -
Labels pointing to pie slices with lines (or how 2 set chart properties in code behind)
I want to be able to create lines outside of my pie chart with labels and have those lines drawn to connect to the pie chart. I saw that this can be done in code behind in the following thread:
MSDN thread on lines to pie slices
But my problem is I never declared an instance of my chart when I am using my code behind. My code that makes the reports visible is basically (but not completely) the following:
ReportDataSet.Tables.Add(ReportDataTable)
ReportViewer.Visible = True
Dim ReportDataSource As ReportDataSource = New ReportDataSource("ReportDataSource", ReportDataSet.Tables(0))
ReportViewer.LocalReport.ReportPath = ReportToDisplay.RDLCFileName
ReportViewer.LocalReport.DataSources.Clear()
ReportViewer.LocalReport.DataSources.Add(ReportDataSource)
ReportDataSource.Name = ReportToDisplay.DataSetName
ReportViewer.DataBind()
ReportViewer.LocalReport.Refresh()
ReportViewer.ShowReportBody = True
ReportViewer.Width = RVWidth
ReportViewer.Height = RVHeight
So how do I set chart properties for my report given the above code? As long as I can set my chart properties with the above code, I should be able to get this to work given the above thread and the link to the Label-Outside-of-Pie and Line-Color properties
(or whatever) info on Microsoft's info pageHello,
Based on your description, you want to design a
pie chart with outside lables and pie line inside a .rdlc report. If so, you can add the Chart report item into the report after open a client report definition (.rdlc) file in graphical design mode. And then Set the
PieLabelStyle property and PieLineColor property. Please refer to the following screen shot:
The link your post above it about the
Chart Web server control. As pre my undersntand, you cannot reference a Web server control inside .rdlc file.
If you have any question about using Chart Web server control, you can post a question on
Chart Controls for .NET Framework forum.
Regards,
Fanny Liu
If you have any feedback on our support, please click here.
Fanny Liu
TechNet Community Support
Maybe you are looking for
-
Multi-Mapping Error after copying into new namespace
Hi everybody, we got a BPM running using a multi-mapping. We decided to design new namespaces. After copying every IR object (datatype, message-type, mappings etc.) --> SXMB_MONI shows a mapping-error. But when I take the payload and test the mapping
-
Osx 10.8.2 driver for deskjet 5550?
Will HP ever, ever release an HP Deskjet 5550 driver for OSX 10.8.2? If not, why not? It's a perfectly good printer that I now cannot use. Thanks . . . Signed, A frustrated HP Printer Owner This question was solved. View Solution.
-
I'm not even sure where to begin with this one, but I have an hallucination that there is some combination of software and admin settings that would allow me to perform simultaneous upgrades system wide to the 18 odd Macs that I have in my office. As
-
Lync Setup and SQL Shared Instance Issues
I'll try to make this short and sweet. We are running a shared instance with non-standard port set up for our new deployment of Lync 2013. When setting up the SQL server stores I messed up and didn't put the FQDN but it still allowed me to create th
-
I created a dll using VC++ to open/read MS Access Database file. The dll works when running outside TestStand, When I used the dll in TestStand, the MS Acces Database file could not open.