I need a suggestion to solve the following problem.
I have two web applications (let's say WEBAPP-A and WEBAPP-B) running under the same application server. Each login page in each application page activates a specific applet
(let's call them JAPP-A and JAPP-B, respectively). These two applets need to use the same DLL.
Each applet (JAPP-A or JAPP-B) works OK when accessing the application separately (in our case the browser used is Internet Explorer 8.0 and the JRE version of the client is 1.7.0_45). However, when redirecting from WEBAPP-A to WEBAPP-B, the applet JAPP-B crashes.
I get the error:
UnsatisfiedLinkError: 'DLL already loaded in another classloader'
So I have tried to use the same classloader for JAPP-A and JAPP-B by setting the same CODEBASE value inside the applet tag and deploying the JAR containing the JAPP-B code under the CODEBASE path, but we got the same error message.
Can anyone suggest an alternative approach in order to get the applet JAPP-B working correctly?
Deploy each applet in it's own Java Virtual Machine. E.G. from Applet Deployment Parameters: separate_jvm.
<APPLET archive="my_applet.jar" code="MyApplet" width="300" height="300">
<PARAM name="java_arguments" value="...">
<!-- use a separate JVM for this applet! -->
<PARAM name="separate_jvm" value="true">
</APPLET>
Related
Developed a rest service which uses third party jars. Reviewing their code I found that they are using ClassLoader.getSystemResource("log4j.properties") to retrieve the data. This code returns null and henceforth I get null pointer exception always. The same code if I deploy in websphere 8.5.5.7 and set server classpath it is working fine.
Since I am using Liberty in my local machine this is not retrieving the path.
I also tried setting classloader in server.xml but no use.
<library id="config">
<folder dir="/properties/dev/" includes="*.properties" scanInterval="5s"/>
</library>
<enterpriseApplication id="AbcEAR"location="AbcEAR.ear" name="AbcEAR">
<classloader privateLibraryRef="config"/>
</enterpriseApplication>
Using ClassLoader.getSystemResource() will use the system classloader, which will only be able to see things from the JDK and whatever is on the classpath. Since Liberty does not use a traditional classpath and instead uses OSGi, the system loader will be of little use in Liberty from an application perspective.
Instead, use ClassLoader.getResource() from the thread context classloader, which will take into account the Liberty classloaders.
I download the bluemix starter application package for Java Liberty and created a jsp page to use javamail api and i created the a servlet that requests for parameters to jsp page and created the another class that transport the mail using SMTP and i deploy this on bluemix.When i go to access it via internet the servlet is called but it does'nt respond anything may be it does'nt request my class that transport mesage so how can i solve this problem
and i set properties of smtp using contextparam in web.xml
Looking into the error{ requested resourse not avilable /emailsendingservlet.java} seems issue is with slash i.e try with emailsendingservlet.java instead of /emailsendingservlet.java.
When you add a slash to URL pattern then the container will look for a web application deployed with name 'emailsendingservlet'.Since this not there you will receive 404 error.
Below is the reference link:
tomcat requested resource () is not available
Problem lies in build.xml.you need to check if build.xml have a pointer to com.ibm.ws.javaee.servlet.[version].jar in the path element which is defined in its classpath.
<path id="classpathDir">
<pathelement location="bin"/>
<pathelement location="lib/com.ibm.ws.javaee.servlet.3.0_1.0.1.jar"/>
</path>
Also,Check if the jar location is mentioned wrong or missing.
I am new to spring development so i am stuck here. Is there any configuration while switching spring + maven project from linux to windows. I am running on tomcat server 7. The project is initially developed in linux. I have moved all the file from linux to wondows. While running on server, i get error The requested resource (/myproject/login/) is not available. Do i need to make any changes or add add in configuation.
Thanks in advance.
I think you have missed something.
Try this.but i'am not sure this is working or not.
Tomcat, by default invoker servlet disabled (commented out in the web.xml file). You have to create a 'servlet' and a 'servlet-mapping' entry in your web.xml.
Once you do, you can get rid of the "servlet/" part of your url.
Check out the following URL for more information regarding the invoker servlet:
http://faq.javaranch.com/view?InvokerServlet
I know there's a guide on how to create a libGDX applet, but I feel it's highly outdated and somewhat confusing. Here's what I've already done:
Created applet class in my desktop project:
public class DesktopApplet extends LwjglApplet {
private final static LwjglApplicationConfiguration DEFAULT_CONFIG =
new LwjglApplicationConfiguration() {
{
width = 512;
height = 512;
}
};
public DesktopApplet() {
super(new Core(),DEFAULT_CONFIG);
}
private static final long serialVersionUID = -1916205038641068252L;
}
Exported desktop project as a regular jar. Added the project's jar (along with gdx and all lwjgl jars in "applet/basic" folder).
Created a html file, based on basic lwjgl applet and the tutorial:
<applet code="org.lwjgl.util.applet.AppletLoader" archive="lwjgl_util_applet.jar" codebase="." width="512" height="512">
<!-- Name of Applet, will be used as name of directory it is saved in, and will uniquely identify it in cache -->
<param name="al_title" value="mygametitle">
<!-- Main Applet Class -->
<param name="al_main" value="my.packages.desktop.DesktopApplet">
<!-- List of Jars to add to classpath -->
<param name="al_jars" value="mygamejar.jar, gdx.jar, gdx-backend-lwjgl.jar, lwjgl_applet.jar, lwjgl.jar, jinput.jar, lwjgl_util.jar">
<!-- signed windows natives jar in a jar -->
<param name="al_windows" value="gdx-natives.jar, gdx-backend-lwjgl-natives.jar, windows_natives.jar">
<!-- signed linux natives jar in a jar -->
<param name="al_linux" value="gdx-natives.jar, gdx-backend-lwjgl-natives.jar, linux_natives.jar">
<!-- signed mac osx natives jar in a jar -->
<param name="al_mac" value="gdx-natives.jar, gdx-backend-lwjgl-natives.jar, macosx_natives.jar">
<!-- signed solaris natives jar in a jar -->
<param name="al_solaris" value="gdx-natives.jar, gdx-backend-lwjgl-natives.jar, solaris_natives.jar">
Created a keystore file. Deleted default lwjgl signing (META-INF folders), added timestamps to the signing command, created a bash script for jar signing and - finally - signed all jars. While signing produces no errors, jarsigner -verify returns one warning "This jar contains entries whose certificate chain is not validated." and I'm not sure how to get rid of it. Here's my signing command: jarsigner -keystore .keystore -digestalg SHA1 -tsa http://timestamp.comodoca.com/rfc3161 -storepass mypass $jar gdxkey.
Changed Java security level to medium. It allowed me to - finally - run the applet without security errors (thanks kabb!).
The applet... doesn't work. It stays that an error occurred when "Switching applet". I'm not sure if I exported the right projects - should I include a jar with desktop project or just the core and manually add all assets and libraries?
The issue is that the applet is self signed. As of JDK7u51, self signed and unsigned applications are blocked if your java security settings are set to high or above. You can read more about this here.
To be able to test your applet, you can simply go to the java control panel, go to the security tab, and set the security level to medium.
However, if you wish for other people to be able to run your applet without having to go through the hassle of changing their security settings, you'll have to get a certificate by a Certificate Authority, and sign your applet using that. Unfortunately, this costs money, and there is no workaround to it that I know of.
If you want to run your game in a browser, you could consider using GWT instead. LibGDX has some tutorials on it's wiki on how to setup a project with GWT. However, it could be a hassle, especially if you're using libraries not supported by GWT.
I am using JSF2 with Websphere 7 . I have created a shared lib successfully and have pointed application using Webpsphere Admin Console and it works successfully . But what we really want to do is to not have to point to that Shared Lib via WAS Admin Console but have some sort of application level configuration e.g in deployment.xml etc which we can point to the name of that Shared Isolated Lib and use it . I have gone through SO and google but not found any thing doing that . I however know that there are commercial application doing it but do not know how . This question from How can I specify a shared library reference at the web module level in Websphere 6.1 deployment descriptors? is closely what I am after but I not want to specify version numbers or jar names as the answer states
I found a way by simply following what WAS Admin Console was actually doing.
Create a deployment.xml in your EAR file if you do not have one already .
You will find a reference to class loader like below
<classloader xmi:id="Classloader_1311552732281" mode="PARENT_FIRST">
Modify it and add reference to the shared Liberary created on server like below
<classloader xmi:id="Classloader_1311552732281" mode="PARENT_FIRST">
<libraries libraryName="JSF2_SHARED_LIB" sharedClassloader="true"/>
</classloader>
#dbreaux has also shown a way .Accpeting my own answer as fits my needs better but big thanks to dbreaux too for advice.
Is the issue just that you don't want to have to configure each application separately, or that you don't want to use the admin console at all? You can associate a shared library with an entire server, which might be preferable to doing it for each app.
The other way to create those application associations is in the WebSphere-specific .xmi deployment files. These are created when you deploy but can also be included in WAR/EAR files. I don't know if that would help you at all. If it would, the official way to create them ahead of time is using one of the Deployment Tools, but since they're just XML, you may feel comfortable creating them manually.
To append extra details to Shahzeb's answer:
My environment: Websphere 8.5; Windows 7;(Eclipse Luna to generate testing .war file)
I have installed the war file exported from eclipse on websphere server by websphere console.
Then exported it again and unpack it to see what websphere automatically add to it to generate EAR.
[folder]META-INF
[folder]ibmconfig
[file]application.xml
[file]ibm-application-bnd.xmi
[file]ibm-application-runtime.props
[file]MANIFEST.MF
[file]was.module
[file]was.policy
[file]was.webmodule
[file]myWAR.war
And the file deployment.xml is placed in
..\ibmconfig\cells\defaultCell\applications\defaultApp\deployments\defaultApp\
whose content in form of
<?xml version="1.0" encoding="UTF-8"?>
<appdeployment:Deployment xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:appdeployment="http://www.ibm.com/websphere/appserver/schemas/5.0/appdeployment.xmi" xmi:id="Deployment_1417052686904">
<deployedObject xmi:type="appdeployment:ApplicationDeployment" xmi:id="ApplicationDeployment_1417052686904" deploymentId="0" startingWeight="1" binariesURL="$(APP_INSTALL_ROOT)/[server service name]Cell/myWAR.ear" useMetadataFromBinaries="false" enableDistribution="true" createMBeansForResources="true" reloadEnabled="false" appContextIDForSecurity="href:[server service name]Cell/myWAR" filePermission=".*\.dll=755#.*\.so=755#.*\.a=755#.*\.sl=755" allowDispatchRemoteInclude="false" allowServiceRemoteInclude="false" asyncRequestDispatchType="DISABLED" standaloneModule="true" enableClientModule="false">
<targetMappings xmi:id="DeploymentTargetMapping_1417052686904" enable="true" target="ServerTarget_1417052686904"/>
<classloader xmi:id="Classloader_1417052686904" mode="PARENT_FIRST"/>
<modules xmi:type="appdeployment:WebModuleDeployment" xmi:id="WebModuleDeployment_1417052686904" deploymentId="1" startingWeight="10000" uri="myWAR.war" containsEJBContent="0">
<targetMappings xmi:id="DeploymentTargetMapping_1417052686905" target="ServerTarget_1417052686904"/>
<classloader xmi:id="Classloader_1417052686905"/>
</modules>
<properties xmi:id="Property_1417052686904" name="metadata.complete" value="true"/>
</deployedObject>
<deploymentTargets xmi:type="appdeployment:ServerTarget" xmi:id="ServerTarget_1417052686904" name="server1" nodeName="[server service name]"/>
</appdeployment:Deployment>
(Since I have no reputation, I have to do it all in text.. )