Ampassword returns NullPointerException
I got error running /opt/SUNWam/bin/ampassword -e The exception isException in thread "main" java.lang.NullPointerException
at com.iplanet.services.util.Base64.encode(Base64.java:55)
at com.iplanet.services.util.Crypt.encode(Crypt.java:240)
at com.iplanet.services.util.Crypt.encode(Crypt.java:262)
at com.sun.identity.security.EncodeAction.run(EncodeAction.java:108)
at java.security.AccessController.doPrivileged(Native Method)
at com.iplanet.services.ldap.ServerConfigMgr.main(ServerConfigMgr.java:257)From the debug log file, I found something like: ERROR: Crypt: Initialize JSS
java.lang.SecurityException: Unable to initialize security library
at org.mozilla.jss.CryptoManager.initializeAllNative2(Native Method)
at org.mozilla.jss.CryptoManager.initialize(CryptoManager.java:827)
at com.iplanet.services.util.JSSEncryption.<clinit>(JSSEncryption.java:250)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:164)
at com.iplanet.services.util.Crypt.createInstance(Crypt.java:128)
at com.iplanet.services.util.Crypt.<clinit>(Crypt.java:101)
at com.sun.identity.security.EncodeAction.run(EncodeAction.java:108)
at java.security.AccessController.doPrivileged(Native Method)
at com.iplanet.services.ldap.ServerConfigMgr.main(ServerConfigMgr.java:257)I've already setenv LD_LIBRARY_PATH "/usr/lib/mps:/opt/SUNWam/lib"Does the error related to any privileges on the machine because I logged in as a normal user to run the ampassword command. Also I have problem running amadmin command too. The command outputs Info 112: Entering ldapAuthenticate method!
Success 0: No Exceptions! LDAP Authentication success!
Info 113: Calling SSO method!
Error 9: Operation failed: null
YES it is permissions related. You need to run it as
root or follow the instructions for changing AM to
run as a non root userThanks so much. :)
Similar Messages
-
WPUMFactory.getUserFactory returning NullPointerException
Hi All,
I am trying to do an application for creating a folder in KM repository.
I have written as follows.
public class KMAbstractComp extends AbstractPortalComponent
public void doContent(IPortalComponentRequest request, IPortalComponentResponse response)
try
com.sapportals.portal.security.usermanagement.IUser user = WPUMFactory.getUserFactory().getEP5User(request.getUser());
catch (Exception e)
response.write(e.toString());
But this statement is returning NullPointerException can anyone help me in this regard to resolve this issue.
Thanks,
Bhavyasri.M.Hi Marcel,
Thanks for the reply!!!!
I have written my code like this.
import com.sap.security.api.*;
import com.sapportals.portal.prt.component.*;
import com.sapportals.wcm.repository.*;
import com.sapportals.wcm.util.uri.RID;
import com.sapportals.wcm.util.usermanagement.WPUMFactory;
public class KMAbstractComp extends AbstractPortalComponent
public void doContent(IPortalComponentRequest request, IPortalComponentResponse response)
try
IUserFactory iuf = UMFactory.getUserFactory();
IUser u =iuf.getUserByUniqueName("user");
com.sapportals.portal.security.usermanagement.IUser user = WPUMFactory.getUserFactory().getEP5User(u);
ResourceContext ctxt = new ResourceContext(user);
RID rid = RID.getRID("/documents");
IResource resource = ResourceFactory.getInstance().getResource(rid,ctxt);
ICollection collection = (ICollection)resource;
IResourceList reslist = collection.getChildren();
catch (Exception e) {
response.write(e.toString()
But it is showing NullPointerException.
I tried to juz print the
WPUMFactory.getUserFactory()
. But actuall its is printing null. This might be the problem, i guess. Can u plz tell me the way to resolvve this??
Thanks,
Bhavyasri.M. -
MSSQL datatypes that return NullPointerException
Using XSQLServlet with BEA Systems type 4 jDriver for SQL Server 7.0 Version: 5.1.0, I get the following error:
oracle.xml.sql.OracleXMLSQLException: java.lang.NullPointerException
while trying to access the following MSSQL Server datatypes which have non null values:
1. binary
2. image
3. sql_variant
4. timestamp
5. uniqueidentifier
6. varbinary
The problem is NOT with the jDriver for SQL Server because I've built a class that returns non null data for all datatypes. The problem must lie with XSQL Servlet.
To test, I use the following:
xsql file:
<xsql:query null-indicator="yes"
connection="{@connection}"
max-rows="{@max-rows}"
xmlns:xsql="urn:oracle-xsql"> {@sql}
</xsql:query>
url:
http://aetius/xsql/demo/query.xsql?connection=bea&sql=select+a,c,d,e+from+TYPES
I'll delete column names, eg column b which is a binary data type, from the above URL to eliminate the java.lang.NullPointerException error.
I've created the TYPES table to contain every MSSQL datatype.
CREATE TABLE [dbo].[TYPES] (
[a] [bigint] NULL ,
[binary] (10) NULL ,
[c] [bit] NULL ,
[d] [char] (10) NULL ,
[e] [datetime] NULL ,
[f] [decimal](18, 0) NULL ,
[g] [float] NULL ,
[h] [image] NULL ,
[int] NULL ,
[j] [money] NULL ,
[k] [nchar] (10) NULL ,
[l] [ntext] NULL ,
[m] [numeric](18, 0) NULL ,
[n] [nvarchar] (10) NULL ,
[o] [real] NULL ,
[p] [smalldatetime] NULL ,
[q] [smallint] NULL ,
[r] [smallmoney] NULL ,
[s] [sql_variant] NULL ,
[t] [text] NULL ,
[timestamp] NULL ,
[v] [tinyint] NULL ,
[w] [uniqueidentifier] NULL ,
[x] [varbinary] (50) NULL ,
[y] [varchar] (50) NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
BTW the MSSQL Server datatypes that DO work with XSQL Servlet:
1. bigint
2. bit
3. char
4. datetime
5. decimal
6. float
7. int
8. money
9. nchar
10. ntext
11. numeric
12. varchar
13. real
14. smalldatetime
15. smallint
16. smallmoney
17. text
18. tinyint
19. varchar
Steve.Thanks for the quick response.
The problem does NOT seem to be in the XML SQL Utility. In other words using an instance of OracleXMLQuery in my data type test Java program, I have a successful output including the data types in question.
Here is the Java program:
package examples.jdbc.mssqlserver4;
import java.io.*;
import java.sql.*;
import java.util.Properties;
import oracle.xml.sql.query.OracleXMLQuery;
public class Steve
public static void main(String [] args)
Properties props = new Properties();
props.put("user", "lemkau");
props.put("password", "lemkau");
props.put("server", "Northwind@Aetius:1433");
Driver myDriver = null;
try
String driverName = "weblogic.jdbc.mssqlserver4.Driver";
String url = "jdbc:weblogic:mssqlserver4";
// String driverName = "com.inet.tds.TdsDriver";
// String url = "jdbc:inetdae7:aetius:1433";
myDriver = (Driver) Class.forName(driverName).newInstance();
Connection conn = myDriver.connect(url, props);
try
Statement stmt = conn.createStatement();
stmt.execute("select * from TYPES");
ResultSet rs = stmt.getResultSet();
if(rs!=null)
OracleXMLQuery qry = new OracleXMLQuery(conn, rs);
String xmlString = qry.getXMLString();
System.out.println(" OUPUT IS:\n"+xmlString);
while (rs.next()) {
System.out.println("bigint" + " - " + rs.getString("a"));
System.out.println("binary" + " - " + rs.getString("b"));
System.out.println("bit" + " - " + rs.getString("c"));
System.out.println("char" + " - " + rs.getString("d"));
System.out.println("datetime" + " - " + rs.getString("e"));
System.out.println("decimal" + " - " + rs.getString("f"));
System.out.println("float" + " - " + rs.getString("g"));
System.out.println("image" + " - " + rs.getString("h"));
System.out.println("int" + " - " + rs.getString("i"));
System.out.println("money" + " - " + rs.getString("j"));
System.out.println("nchar" + " - " + rs.getString("k"));
System.out.println("ntext" + " - " + rs.getString("l"));
System.out.println("numeric" + " - " + rs.getString("m"));
System.out.println("nvarchar" + " - " + rs.getString("n"));
System.out.println("real" + " - " + rs.getString("o"));
System.out.println("smalldatetime" + " - " + rs.getString("p"));
System.out.println("smallint" + " - " + rs.getString("q"));
System.out.println("smallmoney" + " - " + rs.getString("r"));
System.out.println("sql_variant" + " - " + rs.getString("s"));
System.out.println("text" + " - " + rs.getString("t"));
System.out.println("timestamp" + " - " + rs.getString("u"));
System.out.println("tinyint" + " - " + rs.getString("v"));
System.out.println("uniqueidentifier" + " - " + rs.getString("w"));
System.out.println("varbinary" + " - " + rs.getString("x"));
System.out.println("varchar" + " - " + rs.getString("y"));
ResultSetMetaData md = rs.getMetaData();
// System.out.println("Number of columns: " + md.getColumnCount());
for (int i = 1; i <= md.getColumnCount(); i++) {
String name = md.getColumnName(i);
// System.out.println("Column Name: " + name);
// System.out.println("Column Length: " + md.getColumnDisplaySize(i));
stmt.close();
conn.close();
catch(SQLException se)
System.out.println("An exception was raised " + se);
catch(Exception e)
System.out.println("An exception was raised " + e);
Here is the result:
"C:\Program Files\Oracle\JDeveloper 3.1.1.2\java1.2\jre\bin\java" -XXdebug -mx50m -classpath "C:\Program Files\Oracle\JDeveloper 3.1.1.2\myclasses;C:\Program Files\Oracle\JDeveloper 3.1.1.2\lib\jdev-rt.zip;C:\Program Files\Oracle\JDeveloper 3.1.1.2\lib\connectionmanager.zip;C:\weblogic\mssqlserver4v70\classes;C:\weblogic\mssqlserver4v70\license;C:\xsql\lib\Sprinta2000.jar;C:\xsql\lib\oraclexsql.jar;C:\xsql\lib;C:\xsql \lib\xsu12.jar;C:\xsql\lib\oraclexmlsql.jar;C:\xsql\lib\classes12.zip;C:\xsql\lib\xmlparserv2.jar;C:\Program Files\Oracle\JDeveloper 3.1.1.2\java1.2\jre\lib\rt.jar" examples.jdbc.mssqlserver4.Steve
System Output: OUPUT IS:
System Output: <?xml versi on = '1.0'?>
System Output: <ROWSET>
System Output: <ROW num="1">
System Output: <a>1234567890</a>
System Output: <b>0904D000340000000000</b>
System Output: <c>true</c>
System Output: <d>abc </d>
System Output: <e>2000-10-25 09:41:20.34</e>
System Output: <f>9</f>
System Output: <g>9.2</g>
System Output: <h>0904D000340000000000</h>
System Output: <i>9</i>
System Output: <j>18.50000000</j>
System Output: <k>ALFKI </k>
System Output: <l>Soft drinks, coffees, teas, beers, and ales</l>
System Output: <m>9</m>
System Output: <n>hello</n>
System Output: <o>9.199999809265137</o>
System Output: <p>2000-10-25 09:41:00.0</p>
System Output: <q>9</q>
System Output: <r>9.20000000</r>
System Output: <t>Soft drinks, coffees, teas, beers, and ales</t>
System Output: <u>00000000000002B1</u>
System Output: <v>1</v>
System Output: <w>1AFFD361F32ED04996AA62054E954531</w>
System Output: <x>0904D000340000000000</x>
System Output: <y>abc</y>
System Output: </ROW>
System Output: </ROWSET>
System Output:
All previously questionable data types listed below using an URL in a browser are now OK using OracleXMLQuery in a Java program.
data type column name
1. binary b
2. image h
3. sql_variant s
4. timestamp u
5. uniqueidentifier w
6. varbinary x
Does this help pinpoint the problem?
null -
Get Session Object return NullPointerException
Hi,
i write my code this give me NullPointerException
ClientBean client = (ClientBean)FacesContext.getCurrentInstance().getExternalContext().
getRequestMap().get("client");
here is my faces-config.xml
<managed-bean>
<description>
Client Bean
</description>
<managed-bean-name>client</managed-bean-name>
<managed-bean-class>ClientBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
Anybody have an idea why ?
thanks,
piwiYour bean is defined with session scope and you use the method getRequestMap for request scope attributes.
Try getSessionMap(). -
CachedRowSet returns NullPointerException
<p>Hi folks,</p><p>I am passing a populated CachedRowSetImpl object to ReportClientDocument in run-time.</p><p>First time around I get the following error:</p><pre>java.lang.NullPointerException<br /> java.io.Reader.<init>(Reader.java:61)<br /> java.io.InputStreamReader.<init>(InputStreamReader.java:80)<br /> java.util.Properties.load(Properties.java:266)<br /> javax.sql.rowset.spi.SyncFactory.initMapIfNecessary(SyncFactory.java:371)<br /> javax.sql.rowset.spi.SyncFactory.getInstance(SyncFactory.java:557)<br /> com.sun.rowset.CachedRowSetImpl.<init>(CachedRowSetImpl.java:224)<br /> org.apache.jsp.Clob_002dviewer_jsp._jspService(Clob_002dviewer_jsp.java:112)<br /> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)<br /> javax.servlet.http.HttpServlet.service(HttpServlet.java:802)<br /> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)<br /> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)<br /> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)<br /> javax.servlet.http.HttpServlet.service(HttpServlet.java:802)</pre><p> </p><p>The second time I run the same JSP, I don't get this error.</p><p> Any thoughts?</p><p> Tim <br /></p>
<p> </p><p>Looking at the stack trace, it doesn't appear to be a JRC issue. I've traced back the call in the Java sources, and it appears in the CachedRowSetImpl constructor.<br /></p><p>Googling, I found the issue to be common. One link I found was this:</p><p>/message/2227591#2227591 [original link is broken] </p>
-
Certificate not found Security BEA-090169
<pre>HI</pre>
I am trying to Access a External Webservice( which is a https... I am facing a lot of problem.
Initially I was having ConnectException.. We found out that it was due to proxy setting on our end So We set the proxy setting in our SetDomainEnv File
set JAVA_PROPERTIES=-Dplatform.home=%WL_HOME% -Dwls.home=%WLS_HOME% -Dwli.home=%WLI_HOME% -Dproperties.home=%DOMAIN_HOME%\properties -DproxySet=true -Dhttps.proxyHost=hostname -Dhttps.proxyPort=4443 -Dhttp.proxyHost=http-hostname -Dhttp.proxyPort=8080 -Dhttp.nonProxyHosts="localhost|*.domain" -Dhttps.nonProxyHosts="localhost|*.domain"
This a solved the ConnectException problem..
But now still I am not able to get the response from the Webservice.. Its returning NullPointerException..
Even we trid to connect from outside the fireWall(Proxy).. Still we are getting the Problem .. Looks like it si looking for some Certs.. which it is not finding..
I even tried with 2more setting in setDomainEnv
-Dweblogic.security.SSL.ignoreHostnameVerification=true -Dweblogic.security.SSL.enforceConstraints=off
That did not Help
What I have to do to Solve this Issue.. Do we need to set some Certs.. If So How to set that?
Below is the Stack Trace..
<Apr 12, 2006 11:12:39 AM EDT> <Notice> <Security> <BEA-090169> <Loading trusted
certificates from the jks keystore file C:\bea\weblogic81\server\lib\DemoTrust.
jks.>
<Apr 12, 2006 11:12:39 AM EDT> <Notice> <Security> <BEA-090169> <Loading trusted
certificates from the jks keystore file C:\bea\JDK142~1\jre\lib\security\cacert
s.>
<Apr 12, 2006 11:12:39 AM EDT> <Warning> <WLW> <000000> <Id=Control; Method=com.member.control.web_service.ExternalControl.CreateResponse(); Failure=com.bea.control.ServiceControlException: SERVICE FAULT:
Code:java.lang.NullPointerException
String:null
Detail:
END SERVICE FAULT>
Error in Global excpetion
com.bea.control.ServiceControlException: SERVICE FAULT:
Code:java.lang.NullPointerException
String:null
Detail:
END SERVICE FAULT
at com.bea.wlw.runtime.core.control.ServiceControlImpl.invoke(ServiceCon
trolImpl.jcs:1240)
at com.bea.wlw.runtime.core.dispatcher.DispMethod.invoke(DispMethod.java
:377)
at com.bea.wlw.runtime.core.container.Invocable.invoke(Invocable.java:42
3)
at com.bea.wlw.runtime.core.container.Invocable.invoke(Invocable.java:39
6)
at com.bea.wlw.runtime.jcs.container.JcsProxy.invoke(JcsProxy.java:388)
at $Proxy13.CreateResponseRecord(Unknown Source)
at membership.artemis.processes.DonnelleyInterfaceProcess.donnelleyContr
olCreateResponseRecord(DonnelleyInterfaceProcess.jpd:322)
at membership.artemis.processes.DonnelleyInterfaceProcess_wf$ImplControl
Send17.invoke(DonnelleyInterfaceProcess_wf.java:169)
at com.bea.wli.bpm.runtime.Perform.execute(Perform.java:32)
at com.bea.wli.bpm.runtime.ProcessState.executeInternalCallback(ProcessS
tate.java:726)
at membership.artemis.processes.DonnelleyInterfaceProcess_wf$_ProcessSta
te.executeInternalCallback(DonnelleyInterfaceProcess_wf.java:400)
at com.bea.wli.bpm.runtime.ProcessState.executeInternalCallback(ProcessS
tate.java:685)
at com.bea.wli.bpm.runtime.ProcessState.processNodeOrchestration(Process
State.java:681)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.bea.wlw.runtime.core.dispatcher.DispMethod.invoke(DispMethod.java
:371)
at com.bea.wli.bpm.runtime.JpdInternalDispMethod.invoke(JpdInternalDispM
ethod.java:87)
at com.bea.wlw.runtime.core.container.Invocable.invoke(Invocable.java:42
3)
at com.bea.wlw.runtime.core.container.Invocable.invoke(Invocable.java:39
6)
at com.bea.wlw.runtime.core.container.Invocable.invoke(Invocable.java:24
8)
at com.bea.wlw.runtime.core.bean.BaseContainerBean.invokeBase(BaseContai
nerBean.java:224)
at com.bea.wlw.runtime.core.bean.BMPContainerBean.invoke(BMPContainerBea
n.java:2033)
at com.bea.wli.bpm.runtime.ProcessContainerBean.invoke(ProcessContainerB
ean.java:163)
at com.bea.wlwgen.PersistentContainer_z1h55v_ELOImpl.invoke(PersistentCo
ntainer_z1h55v_ELOImpl.java:207)
at com.bea.wlwgen.DonnelleyInterfaceProcessBMPContAdpt.invokeOnBean(Donn
elleyInterfaceProcessBMPContAdpt.java:102)
at com.bea.wlw.runtime.core.bean.BaseDispatcherBean.runAsInvoke(BaseDisp
atcherBean.java:153)
at com.bea.wlw.runtime.core.bean.BaseDispatcherBean.run(BaseDispatcherBe
an.java:85)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
dSubject.java:363)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:
147)
at com.bea.wlw.runtime.core.bean.BaseDispatcherBean.invoke(BaseDispatche
rBean.java:50)
at com.bea.wlw.runtime.core.bean.AsyncDispatcherBean.onMessage(AsyncDisp
atcherBean.java:248)
at weblogic.ejb20.internal.MDListener.execute(MDListener.java:370)
at weblogic.ejb20.internal.MDListener.onMessage(MDListener.java:262)
at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:2678)
at weblogic.jms.client.JMSSession.execute(JMSSession.java:2598)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
<Apr 12, 2006 11:12:39 AM EDT> <Warning> <WLW> <000000> <Id=top-level; Method=co
m.bea.wli.bpm.runtime.ProcessState.processNodeOrchestration(); Failure=com.bea.w
li.bpm.runtime.UnhandledProcessException: Unhandled process exception [ServiceEx
ception]>
<Apr 12, 2006 11:12:39 AM EDT> <Warning> <WLW> <000000> <A message was unable to
be delivered from a WLW Message Queue. Attempting to deliver the onAsyncFailure
event>
<pre></pre>
Regards
Ravi UpasiHi,
Please try specifying the following properties for your weblogic start script.
For Weblogic 8.1
-Dhttp.proxyUser=proxy user name
-Dhttp.proxyPassword=proxy server password
For Weblogic 9.0
-Dweblogic.webservice.client.proxyusername=proxyUsername
-Dweblogic.webservice.client.proxypassword=proxyPassword
Thanks
Seshi. -
I am İshak Teyran , the data manager of a team which attends to IBM XML Challenge Turkey, we are trying to build a dynamic web project in Rational Software Architect 7.5, WAS 7.0 , DB2 9.5 EE.
the article of Vitor Rodrigues - http://www.ibm.com/developerworks/data/library/techarticle/dm-0901rodrigues/index.html - describes how to map xml to java using pureQuery however we need to do the same using JPA.. is there any difference?
we are trying to achieve the same using JPA. but unfortunately we failed..
for simplifying lets assume we have two tables , STUDENT ( id int, name char) and COURSES ( studentID int , and lessons xml) ... these two tables are related to each other with studentID foreign key... and we want to have student and courses java files where courses.java includes proper mapping to xml column lessons..
i tried to make an .xsd file for xml column lessons.. and then i created its java file.. then i used JPA for creating student and courses java files but it always turns me a null pointer exception.. i dont know why.. and as result , only student.java is being created..
i have tried following steps.
My database connection and the tables are already present.
1- i have created a new dynamic web site project, namely dene..
from project facets i enabled dynamic web module, faces support (base, enhanced componnents) , Java Persistence, Javascript Toolkit, JavaServer faces, JSTL, Web 2.0 , Websphere Web(Co-existence),Websphere Web(Extended),Default Style Sheet facets.. and these facets musts be enabled for our project.
2- i have created the CourseList.xsd and using -JAXB- i have created lessons.java
3- i right clicked project and from the menu .. JPA tools->Generate Entities .. i choose connection and tables to generate entities but unfortunately no entity gets created ... when i only choose student table to generate the entity of, Student.java is being created however Courses.java always returns nullpointerexception..
the stack trace of the exception is in the picture i attached.. here is its link.... [http://www.ibm.com/developerworks/forums/servlet/JiveServlet/download/430-250134-14212507-336353/hata.JPG]
i have thought it might be because i use the openjpa and jaxb libraries of RSA.. and then i tried to load the latest versions of JAXB and openjpa .. i added all of their .jar files to the application classpath.. (if it is sufficient to add only openjpa-1.2.0.jar and jaxb-api.jar files let me know it please).. but this did not work neither..
the only exception i get is :
An internal error occurred during: "Generating Entities".
java.lang.NullPointerException
while creating lessons.java and the entity java files i am making sure that i give the same package name for both ... but i never succeeded creating courses.java..
in RSA when i right click to project and go te JPA Tools menu there is a menu item "Configure Project for JDBC deployment" .. what is this for.. i have also tried using this and then trying to create entities but this failed too..
then when they did not work ;
i have decided to code the classes myself but in order to get things a little easier, i opened my DB and converted the XML column to a SMALLINT column .. just not an XML column... and then using JPA in RSA - i did not include openJPA jars in my project externally- i created the classes .. both Course.java and Student.java have been created well, because the column that was actually xml was converted to small integer..
and if i add the related persistence and strategy lines :
@Persistent
@Strategy("org.apache.openjpa.xmlmapping.XmlValueHandler")
to their proper places and editing the function and attributes data types and return types and then if i re-convert the column to XML data type in database, do you think it will work properly?
so i really need a suggestion.. any help will be appreciated..
what would you suggest?
how can we achieve this goal for those two tables i mentioned above in RSA and using JPA ?Hi Tushar
You will need to be more specific. Do you want an XML layout to use for importing or exporting SAP Business One objects? Maybe give us details of the specific object. Most DI API objects have a write to XML which will give you the layout for that object. You can also refer to the REFDI.CHM file under the SDK Help folder.
Kind regards
Peter Juby -
Mapping in XI - cannot access Global Container parameters
Hi all,
we have the following problem in graphical XI mapping.
Trying to retrieve the run-time value of a global parameter, we cannot access the value itself (e.g. test using "display queue" menu).
We use 2 simple user-defined functions (getIdoc and corresponding setIdoc).
The source code for our custom get/set methods is:
public String getIdoc(Container container){
// This is a CUSTOM global parameter set <- cannot get the value itself
//String codMsgExport = (String) container.getGlobalContainer().getParameter("idoc");
//return codMsgExport.toString();
GlobalContainer globalContainer;
java.util.Map map;
globalContainer = container.getGlobalContainer();
map = globalContainer.getParameters();
// This is a STANDARD global parameter set <- cannot get the value itself, as well
String headerField = (String) map.get(StreamTransformationConstants.INTERFACE_NAMESPACE);
return headerField;
public String setIdoc(String codMsgExport,Container container){
container.setParameter("idoc", codMsgExport.toString());
String retValue = (String) container.getGlobalContainer().getParameter("idoc");
return retValue.toString();
=> anyway, get method returns only blank values (testing by "display queue" with some custom values...)
It seems as if the parameter is seen, as pointing to a not existing variable - e.g. getParameter("idoczz") - XI runtime returns a NullPointerException.
Some XI server details:
Runtime Environment
Java version: 1.4.2_06
Java vendor: Sun Microsystems Inc.
Version
Service pack: 14
Release: 30_REL
Thanks all!
Gianluca TacchellaHi Sudharshan and Bhavesh,
I forgot to put a value under the tab PARAMETERS (this is the reason for the blank value, thanks:)).
Anyway, modifying (run-time by the set function) the standard runtime constant => leads to a get function with a single value returned (out) for "display queue", despite of test valorization: the initial value set under tab PARAMETERS.
Instead of using the runtime (standard) constant, using my (custom) global variable => leads to NullPointerException ("display queue" for get function) EVEN IF I initialize the variable (e.g. initIdoc() function called once at top-level target message).
under JAVA_SECTIONS_TOOLTIP button:
Global Variables
String idoc;
Initialization Section
idoc = "";
Clean-Up Section
idoc = "";
public String initIdoc(Container container){
GlobalContainer globalContainer;
globalContainer = container.getGlobalContainer();
// this is the only way NOT to get a NullPointerException
if ( globalContainer.getParameter("idoc") == null )
globalContainer.setParameter("idoc", "a");
return globalContainer.getParameter("idoc").toString();
initIdoc:
out (*)
[a]
(*) despite of initialization under JAVA_SECTIONS_TOOLTIP button
public void getIdoc(ResultList result,Container container){
//String codMsgExport = (String) container.getGlobalContainer().getParameter("idoc");
//return codMsgExport.toString();
GlobalContainer globalContainer;
java.util.Map map;
globalContainer = container.getGlobalContainer();
map = globalContainer.getParameters();
//String headerField = (String) map.get(StreamTransformationConstants.INTERFACE_NAMESPACE);
// this returns null (out stream)
//String headerField = (String) map.get("idoc");
//if ( globalContainer.getParameter("idoc") == null )
//globalContainer.setParameter("idoc", "");
// this returns NullPointerException
String headerField = globalContainer.getParameter("idoc").toString();
//result.addValue(headerField);
// this returns NullPointerException
//return headerField.toString();
//return globalContainer.getParameter("idoc").toString();
result.addValue(globalContainer.getParameter("idoc").toString());
=> leads to NullPointerException
public String setIdoc(String codMsgExport,Container container){
GlobalContainer globalContainer;
globalContainer = container.getGlobalContainer();
java.util.Map map;
map = globalContainer.getParameters();
//globalContainer.setParameter(StreamTransformationConstants.INTERFACE_NAMESPACE, codMsgExport.toString());
//container.setParameter("idoc", codMsgExport.toString());
//String retValue = (String) map.put(StreamTransformationConstants.INTERFACE_NAMESPACE, codMsgExport.toString());
// this returns a NullpointerException
//String retValue = (String) map.put("idoc", codMsgExport.toString());
globalContainer.setParameter("idoc", codMsgExport.toString());
//return "True"; // pointer for debug
//return retValue.toString(); // pointer for debug
return globalContainer.getParameter("idoc").toString();
setidoc:
in0 out (*)
[1] [1]
[2] [2]
(*) as if this "idoc" parameter is not the globally managed (JAVA_SECTIONS_TOOLTIP button), but one which lives inside the function and not outside for the get function..
Regards,
Gianluca -
BufferedWriter write = new BufferedWriter(new FileWriter("file100.txt"));
write.write("testttttttttttttttt");
write.close();
File f1 = new File("file100.txt");
System.out.println(f1.exists()); --- this returns true
System.out.println(ClassLoader.getSystemResource("file100.txt").toString()); -- this returns NullPointerException, why??
also
File f = new File("file1.txt");
System.out.println(f.exists()); -- returns false, but file1.txt is in the same directory as file100.txt, the only difference is it wasn't created in the program, it's already there
Please help! thank you!System.out.println(ClassLoader.getSystemResource("file1
0.txt").toString()); -- this returns
NullPointerException, why??The ClassLoader should be used to load java classes to memory, since file100.txt isn't a java class getSystemResource . To read a File use FileReader or FileInputStream.
>
also
File f = new File("file1.txt");
System.out.println(f.exists()); -- returns false,
se, but file1.txt is in the same directory as
file100.txt, the only difference is it wasn't created
in the program, it's already thereIs that the directory the program was started from? That wil most likely be the current directory is you don't specify a path. -
Yet another question on code optimization
Hello again
Sorry for asking too many questions, but I really want to learn how to simplify my work.
Let's say I have this ArrayList that gets initialized every time a user clicks on a new combobox item and a set of numbers are added to it. I then add this arrayList to another arraylist that is initialized outside of the actionlistener class.
So basically every time the user clicks the inner arraylist is added to outer arraylist. But I don't want to have duplicate results if the user chooses to go back to the previous JTextAreas and delete the contents to start typing new stuff. The way i am doing this is like this:
ArrayList<String> filler = new ArrayList<String>(); //The filler that has to be unique, so the user won't screw with the pattern
filler.add("A*?1qkQOz]4X1QedyhA`H-6$U[I{]0n<RT.W})(J+z7o.<q[g5[y0YA2tv+c@WN");
//For each JtextArea object add a filler so that no Nullpointerexception happens with the use of arraylist.set()method....
for (int i = 0; i <textAreaObjs.size(); i ++){
allValues.add(filler);
//Replace the unique filler with the actual user input saved in innerList which is of type ArrayList.
allValues.set(textCounter,innerList);
//Remove all the unnecessary fillers
for (int outerArrayCounter = 0; outerArrayCounter < allValues.size(); outerArrayCounter ++){
for (int innerArrayCounter = 0; innerArrayCounter < allValues.get(outerArrayCounter).size(); j++){
if (allValues.get(outerArrayCounter).get(innerArrayCounter).equals("A*?1qkQOz]4X1QedyhA`H-6$U[I{]0n<RT.W})(J+z7o.<q[g5[y0YA2tv+c@WN")){
allValues.remove(outerArrayCounter);
outerArrayCounter--;
break;
}I tried the different methods of the ArrayList like arraylist.set() and if there is a null at this location: do this, if not do something else but they returned Nullpointerexceptions...
I tried the isEmpty method too but that only checks to see if the whole list is empty and not specific parts of the array....
Is there a better, faster, and simpler way of doing this?
Thanks for the help.I thought this might help... an example of a Sorted[Descending]Map of Lists... I didn't tackle the "frequency aspect" I just generated a random "key" for the map... and a random string to stuff in the Word...
I presume your Word is {String word, int lineNumber, int startIndex} from the source-document... and now you need to query your frequency table for "the most common word" or maybe "the top five words".
You can fill in the blanks.
... and BTW... If I where doing this for real I'd be awfully tempted to extend TreeMap into a "generic" DescendingTreeMap, which I would stick somewhere in my common utils package, from whence it could be reused in future by myself and others.
If you want the code for krc.utilz.RandomString just ask.
package forums;
import java.util.Collections;
import java.util.Collection;
import java.util.SortedMap;
import java.util.TreeMap;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.util.Comparator;
import java.util.Random;
import krc.utilz.RandomString;
public class SortedDescendingMap
private static final RandomString RANDOM_STRING = new RandomString();
private static final Random RANDOM = new Random();
private class DescendingIntegerComparator implements Comparator<Integer>
@Override
public int compare(Integer a, Integer b) {
return -1 * a.compareTo(b);
@Override
public boolean equals(Object o) {
return this == o; // yes I do mean reference-equals.
private class Word
private final String word;
public Word() {
this.word = RANDOM_STRING.nextString(5);
@Override
public String toString() {
return this.word;
private final SortedMap <Integer,List<Word>> freqTable;
private SortedDescendingMap() {
freqTable = new TreeMap<Integer,List<Word>>(new DescendingIntegerComparator());
private void populate() {
for (int i=0; i<50; i++) {
List<Word> list = new ArrayList<Word>();
for (int j=1; j<=5; j++) {
list.add(new Word());
freqTable.put(RANDOM.nextInt(5), list);
private void print() {
for ( Map.Entry<Integer,List<Word>> entry : freqTable.entrySet() ) {
System.out.println(entry.getKey()+": "+entry.getValue());
public static void main(String[] args) {
try {
SortedDescendingMap map = new SortedDescendingMap();
map.populate();
map.print();
} catch (Exception e) {
e.printStackTrace();
}This doesn't mean that I like you, and you're still a Putz! ;-)
Cheers. Keith. -
Remove Personalization at User Level - Saved Searches
All,
There is a problem in the Saved Searches. We are on 11.5.10. The page immeditely throws error when a custom view is created using "Save Search" button.
It says,
## Detail 0 ##
java.lang.NullPointerException
at oracle.apps.fnd.framework.webui.OADataBoundValueCustomization.getValue (OADataBoundValueCustomization.java:191)
I am not able to revert this view created through save search. I tried by setting the Disable Self-Service Personal to Yes at that user level where i created the view and bounced apache. But the error still exists.
Is there any means like by "Functional Administrator" responsibility where these views can be removed?
Thanks,
PadmajaPl see if a similar issue reported in MOS Doc 859190.1 (Personal Worklist Returns NullPointerException When 'Disable Self - Service Personal' Is Set To Yes) can help
HTH
Srini -
hi
i am reading in an xml file using jdom.
i just want to simply access values between tags. there is a tag somewhere in my xml file "<accession>P1170</accession>" (so i'd want to extract 1170).
However the following file returns NullPointerException and I dont know why.
is this the simplest way to do what im trying to do anyway or is there a better way?
Thanks in advance
T-Fox
import java.io.*;
import org.jdom.*;
import org.jdom.input.*;
import org.jdom.output.*;
import java.util.*;
public class PrettyPrinter {
public static void main(String[] args) {
String filename = "proper.xml";
try {
SAXBuilder builder = new SAXBuilder();
Document doc = builder.build(new File(filename));
Element root = doc.getRootElement();
String str = root.getChild("accession").getText();
} catch (Exception e) {
e.printStackTrace();
}this is the xml code im trying to extract from
so things like 'P17110' between 'accession'
or 'Chorion protein S36' between 'protein'
<?xml version="1.0" encoding="UTF-8"?>
<uniprot xmlns="http://uniprot.org/uniprot"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://uniprot.org/uniprot http://www.uniprot.org/support/docs/uniprot.xsd"><entry dataset="Swiss-Prot" created="1990-08-01" modified="2006-02-07">
<accession>P17110</accession>
<name>CH36_CERCA</name>
<protein>
<name>Chorion protein S36</name>
</protein><gene>
<name type="primary">Cp36</name>
<name type="synonym">S36</name>
</gene><organism key="1">
<name type="scientific">Ceratitis capitata</name>
<name type="common">Mediterranean fruit fly</name><dbReference type="NCBI Taxonomy" id="7213" key="2"/>
<lineage>
<taxon>Eukaryota</taxon>
<taxon>Metazoa</taxon>
<taxon>Arthropoda</taxon>
<taxon>Hexapoda</taxon>
<taxon>Insecta</taxon>
.......................any help appreciated. -
How to set MultiregionValue to Null?
I have Name string multiregional field in the main table. It has values for different regions:
Name("rus___") = "1"
Name("engUSA")="2"
Name("ukr___")="3"
I need to set these values to null, null, null. Here is the code:
MultiregionValue name = new MultiregionValue();
name.setValue("rus___",new NullValue());
name.setValue("engUSA",new NullValue());
name.setValue("ukr___",new NullValue());
record.setFieldValue(repository.getFieldId("MDM_MAIN", "NAME"),name);
Values chenge only in main region.
Name("rus___") = null
Name("engUSA") = "2"
Name("ukr___") = "3"
How can I solve this problem?record.setFieldValue(repository.getFieldId("MDM_MAIN", "NAME"),null);
returns NullPointerException
record.setFieldValue(repository.getFieldId("MDM_MAIN", "NAME"),new NullValue());
problem is not solved.
Anyway, such solution is not appropriate for me. I need set some region values to null and other not. For example, not only (null, null, null) but also ("1231",null, "tere"), (null, "two", null) and so on. I wanted to simplify the problem description. -
Java.lang.NullPointerException returned from webservice
Hi I have an axis client which sends an image attachment to an axis webservice, however I am returned with a null pointer exception,
this is my client,
package chapter5;
import java.net.URL;
import org.apache.axis.client.Service;
import org.apache.axis.client.Call;
import org.apache.axis.encoding.XMLType;
import org.apache.axis.encoding.ser.JAFDataHandlerSerializerFactory;
import org.apache.axis.encoding.ser.JAFDataHandlerDeserializerFactory;
import javax.xml.rpc.ParameterMode;
import javax.xml.rpc.namespace.QName;
import javax.activation.DataHandler;
import javax.activation.FileDataSource;
public class AttachmentServiceClient{
public AttachmentServiceClient(){}
public static void main(String args[]){
try{
String filename = "D:\\images\\products\\r.jpg";
//create the data for the attached file
DataHandler dhSource = new DataHandler(new FileDataSource(filename));
String endpointURL = "http://localhost:8080/axis/services/AttachmentService";
String methodName = "addImage";
Service service = new Service();
Call call = (Call)service.createCall();
call.setTargetEndpointAddress(new URL(endpointURL));
call.setOperationName(new QName("AttachmentService",methodName));
call.addParameter("sku",XMLType.XSD_STRING,ParameterMode.PARAM_MODE_IN);
QName qname = new QName("AttachmentService","DataHandler");
call.addParameter("image",qname,ParameterMode.PARAM_MODE_IN);
//register the datahandler
call.registerTypeMapping(dhSource.getClass(),qname,JAFDataHandlerSerializerFactory.class,JAFDataHandlerDeserializerFactory.class);
call.setReturnType(XMLType.XSD_STRING);
Object[] params = new Object[]{"SKU-111",dhSource};
String result = (String)call.invoke(params);
System.out.println("The response: "+result);
; }catch(Exception e){
System.err.println(e.toString());
this is my webservice,
package chapter5;
import javax.activation.DataHandler;
import java.io.FileOutputStream;
import java.io.File;
import java.io.BufferedInputStream;
public class SparePartAttachmentService{
public SparePartAttachmentService(){}
public String addImage(String sku,DataHandler dataHandler){
System.out.println("trying");
try{
String filepath = "c:/wrox-axis/"+sku+"-image.jpg";
FileOutputStream fout = new FileOutputStream(new File(filepath));
BufferedInputStream in = new BufferedInputStream(dataHandler.getInputStream());
while(in.available()!=0){
fout.write(in.read());
}catch(Exception e){
return e.toString();
return "Image: "+sku+" has been added successfully!!";
I did a test by stripping out the attachment being sent by the client and just let it send the string,
then in the webservice I stripped out the lines for the attachment and just returned the string and it worked ok, so it has been deployed correctly.
I have the Java Activation framework both in tomcat commons and my webapps lib dir.
I'm pretty sure the error is being thrown here,
public String addImage(String sku,DataHandler dataHandler){
any help would be greatly appreciated,
thank you,
JP.Ok, I have now successfully got the stack trace to show where the exception bubbled, Im suprised its in the axis client as I assumed it was in the webservice, but this whole exercise has been extremely beneficial,
anyway this is the client code again and the stack trace error, I now think the problem lies within the JAF, possibly, however, im doing something incorrectly,
package chapter5;
import java.net.URL;
import org.apache.axis.client.Service;
import org.apache.axis.client.Call;
import org.apache.axis.encoding.XMLType;
import org.apache.axis.encoding.ser.JAFDataHandlerSerializerFactory;
import org.apache.axis.encoding.ser.JAFDataHandlerDeserializerFactory;
import javax.xml.rpc.ParameterMode;
import javax.xml.rpc.namespace.QName;
import javax.activation.DataHandler;
import javax.activation.FileDataSource;
import javax.activation.DataSource;
import java.io.File;
public class AttachmentServiceClient{
public AttachmentServiceClient(){}
public static void main(String args[]){
try{
String filename = "D:\\javaDev\\utilities\\coldfusionMX\\Java\\javapetstore\\r.jpg";
//create the data for the attached file
DataHandler dhSource = new DataHandler(new FileDataSource(new File(filename)));
String endpointURL = "http://localhost:8080/axis/services/AttachmentService";
String methodName = "addImage";
Service service = new Service();
Call call = (Call)service.createCall();
call.setTargetEndpointAddress(new URL(endpointURL));
call.setOperationName(new QName("AttachmentService",methodName));
call.addParameter("sku",XMLType.XSD_STRING,ParameterMode.PARAM_MODE_IN);
QName qname = new QName("AttachmentService","DataHandler");
call.addParameter("image",qname,ParameterMode.PARAM_MODE_IN);
//register the datahandler
call.registerTypeMapping(dhSource.getClass(),qname,JAFDataHandlerSerializerFactory.class,JAFDataHandlerDeserializerFactory.class);
call.setReturnType(XMLType.XSD_STRING);
Object[] params = new Object[]{"SKU-111",dhSource};
try{
String result = (String)call.invoke(params);
System.out.println("The response: "+result);
}catch(Exception f){
f.getStackTrace();
f.printStackTrace();
}catch(Exception e){
System.err.println("error");
stack trace
C:\wrox-axis>java chapter5.AttachmentServiceClient
java.lang.NullPointerException
at org.apache.axis.AxisFault.makeFault(Unknown Source)
at org.apache.axis.SOAPPart.getAsString(Unknown Source)
at org.apache.axis.SOAPPart.getAsBytes(Unknown Source)
at org.apache.axis.Message.getContentLength(Unknown Source)
at org.apache.axis.transport.http.HTTPSender.invoke(Unknown Source)
at org.apache.axis.strategies.InvocationStrategy.visit(Unknown Source)
at org.apache.axis.SimpleChain.doVisiting(Unknown Source)
at org.apache.axis.SimpleChain.invoke(Unknown Source)
at org.apache.axis.client.AxisClient.invoke(Unknown Source)
at org.apache.axis.client.Call.invoke(Unknown Source)
at org.apache.axis.client.Call.invoke(Unknown Source)
at org.apache.axis.client.Call.invoke(Unknown Source)
at org.apache.axis.client.Call.invoke(Unknown Source)
at chapter5.AttachmentServiceClient.main(AttachmentServiceClient.java:45
Caused by: java.lang.NullPointerException
at org.apache.axis.encoding.ser.JAFDataHandlerSerializer.serialize(Unkno
wn Source)
at org.apache.axis.encoding.SerializationContextImpl.serializeActual(Unk
nown Source)
at org.apache.axis.encoding.SerializationContextImpl.serialize(Unknown S
ource)
at org.apache.axis.encoding.SerializationContextImpl.outputMultiRefs(Unk
nown Source)
at org.apache.axis.message.SOAPEnvelope.outputImpl(Unknown Source)
at org.apache.axis.message.MessageElement.output(Unknown Source)
... 13 more -
NullpointerException while returning XML bean from JDBC Control
Hi,
I have a simple jdbc control method which returns multiple rows of a table. i am trying to get the data in XML bean format and followed the instruction provided in the help documentation.
None of the columns in table has null values.
The exception I am getting is
Exception in getActiveAlertList
java.lang.NullPointerException
at org.apache.beehive.controls.system.jdbc.RowToXmlObjectMapper.mapRowToReturnType(RowToXmlObjectMapper.java:102)
at org.apache.beehive.controls.system.jdbc.DefaultXmlObjectResultSetMapper.mapToResultType(DefaultXmlObjectResultSetMapper.java:59)
at org.apache.beehive.controls.system.jdbc.JdbcControlImpl.execPreparedStatement(JdbcControlImpl.java:365)
at org.apache.beehive.controls.system.jdbc.JdbcControlImpl.invoke(JdbcControlImpl.java:223)
Any help is appreciated.Hi!
I?m facing this same problem.
Have you found a solution?
I also tried to migrate an WL 8 application, that works with a DB Control, but got the error anyway.
If you, or someone else, found the solution, please share. I?d appreciate.
Thanks.
Gustavo
Maybe you are looking for
-
Can not list all user in Sun Iplant Directory Server5.0
wls61sp1 sun directory server5.0 when I config the LDAP v1 Realm, can only get the users from one user dn such as "o=NetscapeRoot,ou=beagz,cn=group1" but if group1 include another group group1-1, and a user include in group1-1,such user can not be se
-
import java.awt.BorderLayout; import java.awt.CardLayout; import java.awt.Dimension; import java.awt.event.MouseEvent; import java.awt.event.MouseMotionListener; import javax.swing.JFrame; import javax.swing.JPanel; public class G { CardLayout ca
-
How do I save a modified image?
I am a total beginner and have just managed to modify an image (I think). How do I save it? One tutorial said you do not save in Photoshop you export but I cant find an export button. Second question is - there are lots of tutorials and videos but is
-
How can I install a prior version of Photoshop Elements?
I own the CDs for Photoshop Elements 11, but have never installed it. How can I install PSE 11? I've loaded the serial numbers into my account, but I don't see any place to download PSE 11.
-
The New Ipad Air Problem with Yahoo Messenger Webcam
I installed yahoo messenger in my new ipad air. The webcam is not working. Please suggest me how to fix it. Thanks